Live data from Hacker News

Show HN: Building a web server in assembly to give my life (a lack of) meaning

github.com

161–170 of 246 posts

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#161

Ten years ago, I would have kowtowed to someone elite enough to build something like this. Today, I just think, "how long would LLMs have taken to write this?" I mourn the death of a human artform.

It's far more exciting than sad. Got an idea that you'd need assembly language for - now you can do it instead of..... never doing it because it would have been impossible for you in any practical way. Look to the positive instead of lamenting something that never would have happened. It's unbelievably exciting that you can now program a computer virtually without the limitation of your ability to hand code it.

I think for programmers the enjoy is to write it by his own, not to just have a toy. If I just want a web server in asm the easiest is to just decompile an existing one into assembly and call it a day.

Only exciting if you already got a lot of programming under your belt, like Carmack, or a product guy.

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#162

Ten years ago, I would have kowtowed to someone elite enough to build something like this. Today, I just think, "how long would LLMs have taken to write this?" I mourn the death of a human artform.

It was an artform and a necessity. It's even more of an artform now.

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#163

Earlier quoted context omitted.

It's far more exciting than sad. Got an idea that you'd need assembly language for - now you can do it instead of..... never doing it because it would have been impossible for you in any practical way. Look to the positive instead of lamenting something that never would have happened. It's unbelievably exciting that you can now program a computer virtually without the limitation of your ability to hand code it.

If you've got an idea that you need assembly language for, you can use a compiler to create that assembly language. It'll probably do a better job than an LLM. Assembly projects are interesting because they're written in assembly, not because they contain assembly.

You'd be surprised, again.... most compilers don't generate very good code, mostly because

1. the time for optimisation is limited

2. the constraints are overlapping and just completely intractable beyond a single function (do you want to inline this, saving on the call and increasing binary size, or not do it because it's cold?)

3. they don't have domain-specific knowledge about your code, and even with PGO, they might incorrectly decide what's hot and what's not - typical example are program settings. You didn't enable a setting during PGO instrumentation, compiler sees you didn't call that path, shoves it out of line. Now your PGO-optimised code is worse than -O2. And compilers have different levels of adherence to manual branch hinting - on MSVC you get a reorder at best, Clang and GCC try much harder at [[likely]] and [[unlikely]].

4. There's still quite a bit of low-hanging fruit left, mostly because progress is jagged ;) For example our calling conventions generally suck - this is actually why inlining is so helpful - and the inertia makes everyone emit the default calling convention and that's it.

For example, did you know that compilers have very inconsistent support for struct unpacking? It can be much faster to write

  int32 meow(int64 a, int64 b);
than

  struct mytype {
    int64 x;
    int64 y;
  };

  int32 meow(mytype a);
because the first one goes through registers on the MSVC ABI, the second one gets lowered to the caller passing a pointer to the stack. Before someone says "oh this just means MS sucks" - fair, but for std::unique_ptr the situation is the other way around... on the MSVC ABI the callee cleans it up so it's truly zero-cost, but on the Itanium ABI using it is worse than using T* as a raw pointer... see the GCC codegen :)

These examples might seem a bit cherrypicked but this is only scratching the surface, not to talk about the codegen in higher-level languages, which is even more dreadful. Manually optimising your code can usually get a magnitude worth of free performance, which is just tragic.

I wouldn't even rule out LLM codegen in the future - although they're quite unreliable today so you'd get miscompiles like crazy - but there's just so much low-hanging fruit left on the table that it wouldn't be too out of step...

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#164

Ten years ago, I would have kowtowed to someone elite enough to build something like this. Today, I just think, "how long would LLMs have taken to write this?" I mourn the death of a human artform.

It was an artform and a necessity. It's even more of an artform now.

I appreciate the effort. But why not put the skills into something that would be genuinely useful to others or solve a pain point? Open source the results or handover to someone who would like to maintain it.

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#165
post #68

I am attempting to write a software renderer in WebAssembly because, for some reason, I feel the need to go against the direction this vibe coded world is going, and I want to feel challenged again. I don't know if I will ever finish it, it is crazy, and by no means useful. But gosh it feels so good. Congratulations to the OP for the accomplishment.

As in 3D software renderer? I cut my teeth on those throughout my teens and the start of my professional career, in x86 and C. I wanted to see how an LLM would do writing one in pure 8088 assembler for CGA and it one-shot a nice demo (I fed it the vectors for the Elite ship in the prompt): https://imgur.com/a/Dy5rUku

How well does that run on real hardware (or PCem/86box)?

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#166
post #81

Earlier quoted context omitted.

Human artform is still alive and well as evidenced by this post. Yes, an LLM can write it, it’ll probably work. Yet, it’ll remain meaningless slop while this is not.

The problem, at least for me, is that by now I'm so desensitized that I won't even bother looking at something, because it could potentially be the product of a few prompts. The LLM noise is drowning out the human signal, so to speak. Same for articles, blog posts, etc. It only takes a few em-dashes, a few "it's not this, it's that" to lose faith in the text's authenticity, and with that, any interest in its content.

[dead]

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#167

Earlier quoted context omitted.

The first paragraph of the README says this was hand written so I’m not sure why you’re bringing up LLMs

Because it's absurd for most people to write too much Assembly by hand.

What if the author wants to learn? Is learning just out of style now?

I'd be doing the same kind of thing if I had more free time.

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#168
post #116

Earlier quoted context omitted.

As in 3D software renderer? I cut my teeth on those throughout my teens and the start of my professional career, in x86 and C. I wanted to see how an LLM would do writing one in pure 8088 assembler for CGA and it one-shot a nice demo (I fed it the vectors for the Elite ship in the prompt): https://imgur.com/a/Dy5rUku

Yes, exactly, a 3D software renderer. But the goal is to do (almost) everything from scratch and by hand. No LLMs, no std library, no compilers. Just a few imported math functions (such as sin and cos). Not the same as bare metal programming but close

Awesome, do it! I love this kind of thing and do it regularly, mostly as part of the demoscene. I've written a bunch of demos for MS-DOS/VGA/Pentium 100 era hardware. All my own tools, almost all my own code (just using some standard library functions and someone else's mod player although that's on my list of things to write myself). All in mostly C with smatterings of assembly for speed (triangle rasteriser inner loops etc).

I also wrote a demo for 386/CGA hardware last year and I plan on porting that one to an 8086 as I think it is simple enough that it should be able to run on one. I've done a demo for the Sega Master System and I'm about to start a project for the Game Gear.

I also made a bare metal demo for the Leapster Explorer (an ARM-based kids toy).

I don't use AI for any of this because for me the interesting part is the journey as well as the final result. I want to learn how things work, and I enjoy writing the code.

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#169
Get a better f* meaning to life, will you?

Example: spend time looking at health/nutrition. I assure you that in 5 years you will get more satisfaction and returns than the assembly code you wrote.

One important caveat - the subject of health/nutrition is SIGNIFICANTLY more complicated than assembly code, and not may sources out there know what they are talking about. Computers are child's play compared to biology.

Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning

#170

Ten years ago, I would have kowtowed to someone elite enough to build something like this. Today, I just think, "how long would LLMs have taken to write this?" I mourn the death of a human artform.

It's not just art though. It's human thinking and problem solving and learning that is dying.

I have a (relatively well informed) view that people who aledge that "if you used an llm you did no thinking or problem solving" have never in fact used an a llm to generate anything particular complex.

You do indeed need to do quite a bit of thinking and problem solving, to build things with an llm.

If you disagree, repeat this project, so you can share with us how little thinking it required.

Post reply on HN