Live data from Hacker News

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

github.com

141–150 of 246 posts

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

#141
post #47

This is a great resource, thank you! The last time I did anything in assembler was x86 under DOS. Your code makes ARM64 with a modern OS less scary than I thought it would be.

Arm is very nice to write assembly for. Having a proper load/store register-centric architecture rather than a stack-centric like x86 makes the mental load of writing code go waaay down, so the attractiveness of HLLs for ease of writing code is greatly diminished on RISC.

Hell no. Far too many registers, not enough instructions, and (especially with ARM64) weird restrictions that arose from trying to pack things into 32-bit instructions as efficiently as possible.

I've been writing x86 Asm for a few decades. RISCs are simpler in all the wrong ways. After all, "just use a (stupid) compiler" was the whole philosophy.

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

#143

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.

Haven't used LLMs for assembly yet, I did try to use it on some DSLs with few docs, the results were much less impressive than those with popular, higher level languages AI companies scraped a gazillion repos for.

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

#144
post #88

Earlier quoted context omitted.

The difference is not that it’s “worthless”. The difference is that now it’s “practical” to implement given the low effort. I wouldn’t be sad about defeating lower complexity challenges. There are always higher complexity challenges that arise once we start operating in a world when you can do more. The bar raises.

The point is the death of the celebration of excellence and technical mastery. Once insurmountable challenges are now trivial to implement with, as you say, "low effort." For those who were attracted to computing by the grind and the grand narrative that you, too, with sufficient effort, discipline, and merit, could become a revered craftsman, LLMs trivialize an entire lifetime of practice. I can't think of anything…

Did hammers obviate the technical mastery of finding a suitable rock? Or did they elevate the definition of “technical mastery”?

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

#145
post #88

Earlier quoted context omitted.

The difference is not that it’s “worthless”. The difference is that now it’s “practical” to implement given the low effort. I wouldn’t be sad about defeating lower complexity challenges. There are always higher complexity challenges that arise once we start operating in a world when you can do more. The bar raises.

The point is the death of the celebration of excellence and technical mastery. Once insurmountable challenges are now trivial to implement with, as you say, "low effort." For those who were attracted to computing by the grind and the grand narrative that you, too, with sufficient effort, discipline, and merit, could become a revered craftsman, LLMs trivialize an entire lifetime of practice. I can't think of anything…

Would you apply the same reasoning to the building of horse drawn carriages and mass produced motor vehicles? A hand built PDP-11 to a Thinkpad?

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

#146

If it is written in assembly, why is it for MacOS only?

Assembly for the correct architecture is only one part of getting an executable running on a machine. - Dynamic libraries (e.g. for calling into the kernel, but also user space dynamic libraries) are OS-specific (.so for Linux, .dylib for macOS, .dll for Windows) - Executable format is OS-specific (ELF for Linux, Mach-O for macOS, PE for Windows) - Dynamic loading and linkage of both the above are also therefore OS-s…

And even if you avoid external libraries, you still need to interact with the kernel to do I/O, and that involves system calls that are also non-portable.

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

#147
post #120

Earlier quoted context omitted.

What an odd take. It is often titled "software craftsmanship". Is the craftsman not allowed to practice? Not everything needs an immediate real-world application. Not everything needs to be enterprise-grade, bulletproof, web-scale or whatever. It needs to work for the creator, and sometimes not even that. In the same way we appreciate Japanese wood joinery, why not not just appreciate this? Someone might even learn a…

> What an odd take. It is often titled "software craftsmanship". No, not really. This is exactly the opposite example of software craftsmanship. Software craftsmanship involves things like technical excellence in delivering maintainable software that is adaptable to change. Picking assembly, of all things, for a web server represents a complete failure in the analysis of both the problem and solution domain. https://…

> Software craftsmanship involves things like technical excellence in delivering maintainable software that is adaptable to change.

To which change, exactly?

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

#148
post #99
post #92

If you actually start writing big stuff in assembly, esp a macro-assembler, you'd quickly realize it is more verbose, but not fundamentally that different from higher level programming. You basically need to get a hang of how to build abstractions with procedures and macros and you'd be good to go. Reading assembly effectively is often much harder than writing it.

Yeah, that's what I realized during this, too. You need to be much more explicit, but the way any given function works isn't fundamentally different. "strlen" will always iterate through a string searching for a NULL byte whether it's in C, Rust, Assembly, or whatever other language. I think it can feel almost more straightforward than other languages, since you're laying out exactly what the CPU needs to do, in what…

> "strlen" will always iterate through a string searching for a NULL byte whether it's in C, Rust, Assembly

Not all languages use NULL terminated strings. I think Rust actually stores the string length alongside a pointer to the start of the string data. You can do the same in C, but you'd have to do it manually using a struct. In assembly you could do the same thing since you get to decide basically everything.

https://www.youtube.com/watch?v=y8PLpDgZc0E

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

#149
post #139

Earlier quoted context omitted.

The point is the death of the celebration of excellence and technical mastery. Once insurmountable challenges are now trivial to implement with, as you say, "low effort." For those who were attracted to computing by the grind and the grand narrative that you, too, with sufficient effort, discipline, and merit, could become a revered craftsman, LLMs trivialize an entire lifetime of practice. I can't think of anything…

If your goals were fame, then yes. But you can still pursue excellence even if there is an alternative “easy” path. The equivalent is something like hand tool woodworking - it’s still a thing despite the advent of machines, but more of a niche. You can still aim to become excellent, but maybe you won’t be famous.

> but maybe you won’t be famous.

Or employable. Which sucks if you're over 50.

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

#150

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.

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.
Post reply on HN