Simpler "Hello World" Demonstrated In C 582
An anonymous reader writes "Wondering where all that bloat comes from, causing even the classic 'Hello world' to weigh in at 11 KB? An MIT programmer decided to make a Linux C program so simple, she could explain every byte of the assembly. She found that gcc was including libc even when you don't ask for it. The blog shows how to compile a much simpler 'Hello world,' using no libraries at all. This takes me back to the days of programming bare-metal on DOS!"
Missing the point (Score:5, Funny)
Interesting, but she does sort of sidestep the whole 'Hello World!' part of a hello world program.
Re:Hello World (Score:5, Funny)
FYI, Steve Jobs came up with the idea for the "Hello World" app.
He also holds the design patent on the touch wheel interface for it.
I can code that app in... (Score:5, Funny)
45 bytes, huh? I can do it in....
#!/bin/sh
exit 42
18 bytes and it's portable across all Unices. Maybe the assembler version is faster, though?
YES!!!! FINALLY (Score:5, Funny)
Thank God we have finally crossed this hurdle. The baffling complexity of helloworld.c is no longer an obstacle to world domination.
I think we can now finally say once and for all that 2010 will be the year of Linux on the desktop.
Stoner code. (Score:4, Funny)
OK, when I first read this, I thought to myself, "now why in the hell would anyone care to do this?"
Then it dawned on me. One stoned programmer said to another....Yeah, that's probably how it went down. Both now, and back in 1979, when you could still smoke in the Data Center...
any torrent links? (Score:1, Funny)
Seth
Re:YES!!!! FINALLY (Score:1, Funny)
No it won't. Do not be foolishly optimistic. Until videogames are readily available on Linux (and I mean commercial games like Call of Duty), no general consumer would be compelled to use Linux on Desktop (may not apply for netbooks).
Re:YES!!!! FINALLY (Score:3, Funny)
Thank God we have finally crossed this hurdle. The baffling complexity of helloworld.c is no longer an obstacle to world domination.
I think we can now finally say once and for all that 2010 will be the year of Linux on the desktop.
No it won't. Do not be foolishly optimistic. Until videogames are readily available on Linux (and I mean commercial games like Call of Duty), no general consumer would be compelled to use Linux on Desktop (may not apply for netbooks).
*sigh*
Sell your Seagate shares *now* ... (Score:1, Funny)
... and pile up on 64x8 TTL Proms!
Re:Hello World (Score:5, Funny)
No Steve Jobs designed "iHello World", which is actually one byte larger than the standard hello world app, but he's litigating against everyone who creates "Hello World" since 100% of it is quite obviously a subset of "iHello World".
Re:Hello World (Score:1, Funny)
FYI, Steve Jobs came up with the idea for the "Hello World" app.
He also holds the design patent on the touch wheel interface for it.
His was a variant that was tradmarkable. "iHello iWorld". Sadly it being an executable file means it to won't run on an iphone.
Re:11k Is Too Big? (Score:2, Funny)
It's just a 20th-century digital processing appliance.
Mine is a 21st-century appliance, thank you very much!
Re:11k Is Too Big? (Score:5, Funny)
You're right! I'm going to throw my laptop out the windows right now! Reading slashdot will be so much more fun on a computer smaller than a sunflower seed.
That's exactly it (Score:4, Funny)
Guy reminds me of an old joke.
What's the difference between a bitch and a whore?
A whore fucks everyone. A bitch fucks everyone but you.
Let the lawn derby begin (Score:4, Funny)
One of the earliest processors I used had only 256 bits of RAM (Yes, that's right 256 B I T S of memory)
Re:I can code that app in... (Score:4, Funny)
Re:BTDT (Score:1, Funny)
Why do you hate women so much? Is it out of self loathing that you had to become one?
Re:11k Is Too Big? (Score:1, Funny)
Hahaha, wtf? That was actually an apt car analogy.
Now, get off my lawn!
Re:Old news is VERY OLD (Score:1, Funny)
That's just the Lords of Cobol being pissed that the Lords of Fortran did it first.
Re:Not a C program (Score:1, Funny)
Step four, leave out step four to save time.
Re:BTDT (Score:5, Funny)
The fact that people would even still use C at all for anything anywhere ever shocks me.
I started writing device drivers in Ruby, and have never looked back.
In order to get Ruby to run on my system, I run it in an interpreter. The interpreter is written in Java, which is a much faster language and therefore more suitable as an interpreter.
The JVM on my system is written in C#. I know that C# is comparable to Java in terms of efficiency, but since this is a Windows machine, I figure it's "closer to the metal."
The implementation of the .NET framework on my computer (and the Windows operating system itself) is written in Ruby. Since I already have a Ruby interpreter on my system, this presents no problems.
Re:BTDT (Score:3, Funny)
I remember those. We used to have to carry them around in the snow, uphill both ways. ;-)
Re:11k Is Too Big? (Score:3, Funny)
Indeed.
At 11kB each, my 1TB harddrive would only fit some 97 million programs.
And so he should! (Score:3, Funny)
"Hello World" uses over 90% of his "iHello World" work. You would be hard pressed to make a fair use argument here. ;-)
Re:Old news is VERY OLD (Score:3, Funny)
... and I read it in 2002. On slashdot [slashdot.org].
Re:11k Is Too Big? (Score:3, Funny)
One of the earliest machines I learned programming on only had 256 bytes of memory.
You lucky bastard.
My parents could never afford such computer. I had to learn programming on a computer with only 1 bit of memory (Yes that's right: 1 B I T of memory!)
Those were the days. And you tell the kids these stories and they won't believe you...
Re:11k Is Too Big? (Score:5, Funny)
My God, are you saying that people should use the right tools and techniques for the job at hand, rather than applying the same limited ones to every problem they come across?
Re:BTDT (Score:5, Funny)
I have a suggestion: If you write your JVM in Visual Basic instead of C#, it'll be portable, since most old microcomputers included BASIC in ROM. And, of course, .NET already brings Visual Basic.NET!
-dZ.
Re:11k Is Too Big? (Score:3, Funny)
Re:29 bytes ! Beat that !!! (Score:2, Funny)
But you're including that bloated library DOS. Much better to bypass all that cruft and just use the hardware directly. Also, why write the whole string. The user will just have to know that 'h' stands for hello world. It's a training issue!
mov ax,0b800h
mov ds,ax
xor di,di
mov byte ptr[di],'h'
ret
Re:Missing the point (Score:1, Funny)
I once tried to make the elf my bitch. The GM (and oddly other players weren't too amused.
Re:How about 28 bytes?! (Score:2, Funny)
Why did you put it in your porn folder?
Re:11k Is Too Big? (Score:2, Funny)
Nope! Now, hand me that pickaxe, I need to dig myself a memory upgrade.
http://df.magmawiki.com/index.php/Computing [magmawiki.com]