[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

>a 1 line c program takes 88k on windows

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 144
Thread images: 20

File: hello_world.png (12KB, 328x178px) Image search: [Google]
hello_world.png
12KB, 328x178px
>a 1 line c program takes 88k on windows
>>
>>56337595
>88k is almost literally nothing even by toaster-PC standards
Seriously why would this matter unless you restricted yourself to 30+ year old hardware?
>>
File: 1447528893132.gif (109KB, 205x260px) Image search: [Google]
1447528893132.gif
109KB, 205x260px
>>56337595
>88k
>>
>>56337595
>compiling using VS
>88K
What the fuck did you expect?
>>
Fine, I will bite.
>What are runtime libraryies
>What are multiple sections
>What are PE headers
>What is section alignment
Most of that is the linked in CRT code especially when you are using POSIX API's that are built on top of WinApi.
If you use WinApi you can go around 3 KB , you could do 600 bytes in the 32 bit OS days due to being able to drastically reduce section alignment area sizes.
Most linux applications end up being the same due to linking in 20 different libraries.
Hell linking in libc does it well enough.
>>
>>56337639
Terry was able to write an OS in 2MB.
>>
Looks like you're compiling in debug mode friendo
>>
>>56337721
Can I check my emails with it yet?
>>
>>56337748
Only emails from Jesus.
>>
>>56337595
Remove debug symbols, compile with Os and use upx
>>
>>56337721
Only possible due to him getting help from our lord and saviour Jesus Christ.
>>
>>56337748
why would you use your computer to connect to the internet if you have the option to connect to GOD
>>
>>56337748
Have you forgotten all those ASM x86 OS'es that fit on a 1.44MB floppy and have working networking and TCP stack?
>>
>>56337748
Well, I can check emails on my C64 with 64k of RAM with software on a floppy that's 300KB using TCP/IP connection.
>>
>>56340575
Yes.
>>
>>56340608
Simply not true, the CPU of the commodore 64 could never accomplish networking
>>
>>56337595
>1 line
>in C
>>
>>56342008
Aside from the fact that newlines have no semantic meaning in C, the following is a valid C program:
int main;

Go ahead, compile it and see for yourself. It's gonna crash as soon as libc jumps to address 0, but that's beside the point.
>>
File: contiki2.gif (14KB, 768x544px) Image search: [Google]
contiki2.gif
14KB, 768x544px
>>56341964
Contiki
>>
File: contiki-eyecandy-desktop.png (2KB, 384x271px) Image search: [Google]
contiki-eyecandy-desktop.png
2KB, 384x271px
>>56342061
>>56341964
Contiki provides multitasking and a built-in Internet Protocol Suite (TCP/IP stack), yet needs only about 10 kilobytes of random-access memory (RAM) and 30 kilobytes of read-only memory (ROM).[1] A full system, including a graphical user interface, needs about 30 kilobytes of RAM.
>>
>>56337748
No, you can't invade and insert impurities into TempleOS systems, CIA nigger.
>>
>a 1 like Go program takes 3MB
>3MB
>>
>>56342081
>>56342061
will it run Battlefield 4 on max settings with 60+ FPS?
>>
File: le v face.jpg (54KB, 720x540px)
le v face.jpg
54KB, 720x540px
>>56342100
>>
>>56337701
That's a decent post but you're wasting your breath - the sad fact is that very few people who browse /g/ in 2016 can understand what you've just wrote.
>>
>>56342081

This is n3370 & 1337o
>>
>>56337639
even on 30 year old hardware that's fuck all
>>
>>56337595
1 line python program is 23 bytes.
>>
>>56337701
The smallest possible size for a Linux ELF executable that will still run correctly is
45 bytes.
>>
>>56337639
Because people don't like getting cucked.
>Ohh, I spend thousands on this amazing hardware, but it's ruined by bloated software.
>>
File: python.faggot.png (2KB, 614x53px) Image search: [Google]
python.faggot.png
2KB, 614x53px
>>56342440
And a 1 line python.exe is 6.9mb.
>>
>>56337639
It's lazy programming, that's why.
>>
>>56337595
That's not a C issue but a 'you're unable to use the right parameters for the compiler and linker' problem.
>>
>>56337701
>Most linux applications end up being the same due to linking in 20 different libraries.
My 4000 line C++ compiles to 78k with the symbols in.
Dis nigga writing hello world supposedly.
>>
>>56337701
dat Windows bloat doe
>>
>"hello world" with UE4
>3gb
>>
>>56337595
>#import *.*
>>
>>56342558
>.exe
>python

nice try anon.
>>
File: 1470736971892.jpg (40KB, 355x417px) Image search: [Google]
1470736971892.jpg
40KB, 355x417px
>10 PRINT "HELLO WORLD"
>20 END
>>
File: 1472488016741.jpg (66KB, 450x600px)
1472488016741.jpg
66KB, 450x600px
>>56342830
>>
>not using solding to make ur programs
>>
Should have used crinkler
>>
>>56342815
No nice try here anon, only real python with real .exe's
http://www.py2exe.org/
>>
>>56342558
Why the fuck does this dogshit exist?

Does windows not come packaged with Python?
>>
>>56343037
>winblows
>package with anything
>>
>>56343037
>Windows
>prepacked with anything useful
>>
>>56343052
>>56343055
u right senpaitachi, not sure why I thought that.
>>
>>56342558
Not necessarily. Yes assuming that's with py2exe. But the thing with Python is that it's a interpreter not a compiler. Any python program is the size of bytes of the file and the size of the interpreter. And you can have multiple programs using the interpreter.

With C++, it's not like that. Each program needs a copy of its own libraries while python can share.
>>
>>56343070
mcFucking killurself
self loathing macFagget
>>
Hello world in go takes something like 25MB
>>
>>56343181
Forget to take your autism meds?
>>
>>56343181
something wrong famalam? word filters got u down?
>>
>help i just pressed compile and it's 88k
>>
>>56343037
>Does windows not come packaged with Python?

Thank god it doesn't. Python is terrible.
>>
>>56343262
>assblasted winbabby detected
>>
>>56337595
And this is why your browser takes gigantic amounts of RAM then
>>
>>56343268
Forced indentation is for babbys

>mfw I see python code
>>
>>56343434
cry more bracketfag
>>
>>56343434
You indent your code anyway.
>>
>>56337595
The Apple Macbook Pro with Retina Display doesn't have this problem.
>>
>>56342715
>using LOC as a measurement of complexity
Using LOC is a really shitty measurement. You could have your entire codebase on a single line if you wanted to. Use function points and follow an ISO standard to calculate it.
>>
>>56343612
nah anon, you see, this guy discovered java yesterday. He writes all his code without spaces or indents because whitespace doesnt matter and wasting bytes isnt something a realโ„ข programmerโ„ข would do.
>>
>>56343134
>Each program needs a copy of its own libraries
>what is dynamic linking?
>>
>>56343711
Are you going to dynamic link iostream/stdio.h for each program that needs it?
>>
>>56343655
I agree
the standard way of measuring complexity should be the number of entropy bits
>>
>>56343746
You don't link to headers but yes, dynamically linking to the standard C library is normal on Linux.
$ ldd helloworld
linux-vdso.so.1 (0x00007fff003b7000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc3b626d000)
/lib64/ld-linux-x86-64.so.2 (0x000055a866bb1000)
>>
>>56342715
Maybe the compiler just thought your code was shit and optimized away pretty much everything of it?
>>
>>56342830
Too long. the Bat file, is only 20 bytes.
You do not need an END statement in MSBasic.
>>
>>56344187
>MSBasic
>not glorious Commodore BASIC
>>
me@machine> cat p.c
#include <stdio.h>
int main(void){
printf("Hello world!\n");
}
me@machine> gcc p.c
me@machine> ./a.out
Hello world!
me@machine> du -h a.out
796K a.out


Can someone explain this? Because it seems much worse than what's on Windows. Is this "GNU quality"?
>>
>>56342848
Just how did you flip this picture?
>>
File: 1472585662896.jpg (71KB, 450x600px) Image search: [Google]
1472585662896.jpg
71KB, 450x600px
>>56344505
Are you kidding?
>>
File: Screenshot_2016-08-30_23-34-54.png (8KB, 225x113px) Image search: [Google]
Screenshot_2016-08-30_23-34-54.png
8KB, 225x113px
>>56344450
>>
>>56344450
You need to add some parameters to the compiler to optimize the executable.
>>
>>56344450
$ du --apparent-size -h --si a.out 
8.5k a.out


>>56344590
Don't forget to use --apparent-size.
Without it "du" shows you the space occupied by the file system.
>>
>>56344450
>>56344590
>>56344834
> not using ls -lh like a normal human being to get the actual number of bytes in the fucking file.
6.6K for me, BTW.
>>
1 line hello world on electron or nw.js is like 60mb... Nothing wrong with it
>>
>>56337595
Optimize for size and strip symbols you retard
>>
>>56342746
>not writing in x86asm
>>
>>56346425
>2016
>x86
>not amd64
>>
#include <stdio.h>

int main(int argc, char **argv)
{
unsigned int i = 0;

for (i = 1; i <= 100; ++i) {
if (i % 3 == 0) printf("Fizz");
if (i % 5 == 0) printf("Buzz");
if (i % 3 && i % 5) printf("%i", i);
printf("\n");
}

return 0;
}


> gcc -o a main.c
> for %I in (fb.exe) do @echo %~zI
23660
>>
File: cthread.jpg (235KB, 898x1146px)
cthread.jpg
235KB, 898x1146px
>>
>>56342558
The screenshot clearly says 6.9 KB, not mb.

>>56343434
>forced indentation
If you were a halfway decent programmer, you'd indent things naturally in the first place, and python wouldn't be "forcing" you to indent any more than C "forces" you to spell "stdio" correctly.

>>56343746
Isn't that a better option, if you have lots of C/C++ programs on your machine? It avoids unneccessary duplication (especially since static linking usually links in the WHOLE library, not just the functions you use).

>>56346478
>amd64
>amd
nice meme
>>
File: 002.jpg (384KB, 1024x768px) Image search: [Google]
002.jpg
384KB, 1024x768px
>>56337701

>What are runtime libraryies
>What are multiple sections
>What are PE headers
>What is section alignment

Why are these needed in a hello world program?
You are only proving OP's point.
88K is a lot. Some people made 3D FPS shooters that weigh under 100kb.
>>
>>56341964
>this_isnt_even_bait_this_is_a_fishing_pole.jpg
>>
>>56348555
It's not Visual Hello World Studio 2015, dumbass.
>>
>>56337595
>Implying boilerplate code grows with overall application size

gee maybe that's because windows is designed to run programs more complicated than your brainfuck fizzbuzz interpreter
>>
dynamic linking is balls

>x.so is shared etc etc
static link faggots
>>
>Maybe the compiler just thought your code was shit and optimized away pretty much everything of it?

>Shit code
>everything can be optimized by the build system

No you're thinking of good code. Being able to be optimized by a compiler is a good thing.
>>
>>56337701
>>56342146
I enjoyed it, i didn't fully understand it. But u got the gist.
>>
>>56342537
>ruined

Oh god totally so slow omg windows just doesn't work at all it's so slow with all the bloatware it takes at least 10ms to open a browser instead of 3ms jesus literally unusable

fucking kill yourself, tell me how exactly my experience is "ruined"?
>>
>>56337595
>1 line

But that 1 line could be an include of a massive library. Even if it isn't, there's quite a bit of startup code added to anything you compile to be executed under an OS.
>>
File: 1471349058936.png (15KB, 300x300px) Image search: [Google]
1471349058936.png
15KB, 300x300px
>>56350686
>How do I multitask
>>
>>56337595
Simply because telemetry gets baked in everything compiler with visual studio.
>>
>>56351135
>my system is CONDITIONALLY slow, even then compared to the 15 minute boot time of an average windows98 I'm literally in heaven

again, kys
>>
File: 1471553157271.png (461KB, 870x722px) Image search: [Google]
1471553157271.png
461KB, 870x722px
>>56351352
>I love the fact that my time is more expendable than developer time
>>
>>56351352
>15 minute boot time
Not him but I have a 486DX4 12MB RAM with 98 and it takes about 70sec to boot to desktop.
True that an SSD machine today will boot with just 10 seconds
>>
>>56351380
>any inefficiency, no matter how small, must be blown up to be as big of an issue as possible because it's /g/

literally no-one except the trolls on /g/ would actually take issue with the power of modern computing compared to it's possible theoretical capacity.

>talking about expendable time

>shitposting on /g/
>>
>>56351411
/bait
>>
>>56351411
Wow, you sure a are dumbfuk
>>
File: pascal.png (30KB, 737x616px) Image search: [Google]
pascal.png
30KB, 737x616px
>c program
Found the problem!
>>
>>56354298
>.984 bytes
seems legit
>>
>>56337701
>>What are runtime libraryies
No idea.
>>
>>56346478
>there will be people who unironically think there's a difference
AT&T syntax > Intel syntax
>>
>>56354351
Literally the easiest thing to try and check for yourself, moron.
>>
>>56354391
you can't split a byte more than 8 ways
>>
>>56354401
>split a byte
What the hell are you talking about?
>>
>>56354411
Can't have a fraction of a byte stored on a disk.
>>
File: 1451320824538.jpg (30KB, 542x296px) Image search: [Google]
1451320824538.jpg
30KB, 542x296px
>>56354351
>>56354401
>>56354420

Holy shit, do Americans get dumber by the day?
>>
>>56354420
Well, technically you can, but your disk is going to store data in half-kilobyte blocks anyway.

I'm still puzzled as to what the shit you're talking about though.
>>
>>56348236
>The screenshot clearly says 6.9 KB, not mb.
And just with that, I disregarded everything you said
>>
>>56354445
probably, but i'm not american
(also, you have no sense of humor)
>>56354460
this one is just too slow
>>
>>56354469

Oh, so you were just pretending to be retarded...
>>
>>56354494
Oh, you're just new.
>>
>>56354298
>>56354351
>>56354391
>>56354401
>>56354411
Americans use commas instead of periods
41,984 vs 41.984
>>
@56354505

Yeah, I just reached this photoblog from reddit.
>>
>>56354512
Oh
It's that bullshit.
What the fuck even is this useful for?
>>
>>56344450
TinyCC 1536 bytes
>>
>>56342558
>>56343009
It's 6.9mb because py2exe has to compact essentially an entire python interpreter into the .exe.

This has gotta be bait.
>>
>>56337595

Oh no! My 1MB hard drive is fucked.
>>
>>56337595
post the code

also did you strip the exe?
>>
>>56337595
You're doing it wrong.
http://nullprogram.com/blog/2016/01/31/
>>
>>56354671
>1MB
>complaining

Talk to me when you have a 1 byte hard drive.
>>
>>56344450

myuser@freebsdbox:~ % cat p.c
#include <stdio.h>
int main(void)
{
puts("hello world");
}
myuser@freebsdbox:~ % clang p.c
myuser@freebsdbox:~ % ./a.out
hello world
myuser@freebsdbox:~ % du a.out
8 a.out


Yes, that's GNU quality.
>>
File: go.png (3KB, 162x144px) Image search: [Google]
go.png
3KB, 162x144px
>>56337595
Go takes 1,89MB
>>
File: nstb9ePdOq1sjhtm9o7_r1_400.png (145KB, 300x300px) Image search: [Google]
nstb9ePdOq1sjhtm9o7_r1_400.png
145KB, 300x300px
>>56354741
GODDAMMIT GNU/+LINUX ABSOLUTELY #REKT AND BTFO!!!!!1
>>
>>56337721
But he's a genius, op brain is going niggerlicious
>>
>>56342054
If you don't specify the return type of a function in C, it just assumes it's an int. So you don't even need the 'int' part. You can literally just put:
main;
And it will compile. And segfault instantly when you try to run it.
>>
>>56354813
Although the executable file generated is 8.5kb.
>>
>>56354298
HUEs leave
>>
>a 1 line c program takes 88k on windows
Well duh, the telemetry needs to go somewhere.
>>
>>56342094
That's because it comes with its own libraries for portability you fucking autistic nigger.
>>
>>56354718
>1 byte hard drive
Do you, like, have a tiny strip of paper that you write eight 1s and 0s on or something?
>>
>>56354718
My HDD consists entirely of a single D flip-flop.
>>
File: AwnJetK.jpg (82KB, 720x720px) Image search: [Google]
AwnJetK.jpg
82KB, 720x720px
>>56354718
>>56355115
>>
>>56355141
>>56350254
Scratch that. I'm a retard and mixed up pathing and linking.
>>
>>56355151
>4gb

Still too big.
I need a minimal HD here son, not that bloated shit.
>>
>>56348555
his point is that it's not only windows.
>>
when elite was under 50kb
>>
>>56355151
Holly fuck this is qute!
Anyone has a photo of internals?
>>
>>56338683
bless you friend
>>
>>56348555

>Why are these needed in a hello world program?

Because every time you type "printf", it doesn't work with magic dumbass; it works with like 70k lines of code.
>>
>>56337721
You can write programs that are tiny in assembly on Windows platform too. If you need your program to be tiny, you can't rely on visual studio or whatever to compile it.
>>
>>56354867
its PT not BR, too much detail in the words "ยดยด" i am suprized that cmd dont show a weird char...
Thread posts: 144
Thread images: 20


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.