10 ms·
Examining Windows 1.0 Hello.c
- smitty1e 6y ago> I was inspired to investigate the original HELLO.C for Windows 1.0, a 125 line behemoth that was talked about in hush tones. Should that have been "125k line"? Not to get too pedantic, but the units seem needful for "behemoth".
- CyberDildonics 6y agoNo, windows did not require a 125 thousand line program to display hello world.
- smitty1e 6y agoThe question was serious; the repercussions, severe; the message, received.
- billforsternz 6y agoVery nice, grace under pressure. Upvoted, along with the original question.
- smitty1e 6y agoThanks!
- saagarjha 6y agoHotel, Trivago.
- NCommander 6y agoEven for Windows 1.0, I can see ways to cut this thing down to size. The point though is that this is what MSFT actually included in the SDK, and I remember reading about in "Programming Windows" and other sources. It just took me a few years (or maybe decades) from reading about it to actually try it.
- billforsternz 6y agoNo, at the time it did seem monstrous and barbaric to need 125 lines for hello.c, when 5 or 6 was quite properly considered the norm. "Behemoth" is a relative term in this case. Edit: In the decades since nothing has changed in my mind. The messy Windows boilerplate code that made up the other 120 lines or so should have been refactored architecturally and hidden by a framework, API call, something, anything.
- grawprog 6y ago125 lines seems fairly 'behemoth' for a hello world C program to me. This for example is a hello world for sdl: #include <SDL/SDL.h> int main(int argc, char *argv[]) { int gogogo = 1; SDL_Event event; SDL_Init(SDL_INIT_EVERYTHING); SDL_WM_SetCaption("Hello World! :D", NULL); SDL_SetVideoMode(800, 600, 32, SDL_HWSURFACE); while (gogogo) { SDL_WaitEvent(&event); if (event.type == SDL_QUIT) gogogo = 0; } SDL_Quit(); return 0; } https://www.badprog.com/c-sdl-simple-directmedia-layer-hello-world https://www.badprog.com/c-sdl-simple-directmedia-layer-hello...
- krapp 6y agoBecause all of the platform-specific code is offloaded to the library and compiled in. It's still there, hidden behind the abstractions.
- pantalaimon 6y agoIt's pretty impressive that binaries from Windows 1.0 still manage to run on Windows 10. I wish desktop Linux had even a fraction of that level of backwards compatibility.
- jrwr 6y agoWhen running Xorg/X11 they do still run, that protocol from the old days has not changed much, its the libs that the programs use are the moving target, but if you have a nice static compiled X11 App, it will still display!
- Zardoz84 6y agoTWM keeps working fine on the latest version of Linux, and TWM predates Linux for many years!.
- CyberDildonics 6y agoYou would think mapping memory, files, pipes and general IO would have stabilized by now, at least in their basic forms.
- NCommander 6y agoThey did in 32-bit Windows (NT3.1 is pretty much the same on a core level from Win 10). The problem here was that the 8088 suffered from segmentation which put "interesting" constraints on programs, and then Intel's 80286 was alded to the point that it was only successful in the sense of "faster 8088" and not bringing 32-bit computing as was promised.
- CyberDildonics 6y agoI was talking about linux in the era of virtual memory.
- Narishma 6y agoThe 286 is a 16-bit CPU, it never promised 32-bit computing. That was its successor, the 386.
- chkaloon 6y agoAmazing work. Thanks for the trip down memory lane
- NCommander 6y agoYou're welcome. I just got tipped off on this ending up here. The rabbit hole was incredibly deep, but by time I was out of it, I was determined to share the pain with the rest of the world :)
- mmoez 6y agoThis is a copy from an original article which was already posted on HN a few days ago and which did not get any traction. https://news.ycombinator.com/item?id=23237045 https://news.ycombinator.com/item?id=23237045 Could you please refer to the original article below and credit the original site it was published on: https://soylentnews.org/article.pl?sid=20/05/10/1753203 https://soylentnews.org/article.pl?sid=20/05/10/1753203
- BalinKing 6y agoOP's article starts with "The following is a guest post by NCommander of SoylentNews fame!", so I don't think there are any real attribution issues here.
- NCommander 6y agoI'm fine with either showing up, although it originally was posted to SoylentNews (which I'm a site administrator), and then sent to neozeed to post as SN deals with news more like HN and I didn't want it to get lost in the archives. It's also on DEFCON 201's blog.
- dblohm7 6y agoPASCAL != stdcall
- NCommander 6y agoIt does in Microsoft's world who #define it like that. As I remember, and if I'm wrong, I'll correct it, the different on 32-bit was that stdcall and pascal change the order of how arguments are injected.
- dblohm7 6y agoThat's because PASCAL was used for 16-bit Windows. They only define it as stdcall in 32-bit and 64-bit compilers for source compatibility reasons. The 16-bit Windows SDK does not define PASCAL as stdcall. PASCAL pushes arguments left to right. stdcall pushes arguments right to left.
- lihaciudaniel 6y agoExplain msdos now, article is well written
- heinrich5991 6y agoThe article links to a place where you can run Windows 1.0 in a browser: https://www.pcjs.org/software/pcx86/sys/windows/1.01/ https://www.pcjs.org/software/pcx86/sys/windows/1.01/. Interestingly, even Windows 1.0's notepad had "Insert Time/Date (F5)". I always wondered where that came from, but apparently it's backward compatibility to Windows 1.0.
- speps 6y agoI wonder if it's to support the fact that Windows 1.0 bugs were tracked in a text file. Source: https://devblogs.microsoft.com/oldnewthing/20200317-00/?p=103566 https://devblogs.microsoft.com/oldnewthing/20200317-00/?p=10... > The history of defect tracking in the Windows team goes back to Windows 1.0, which used a text file.