Show HN: Building a web server in assembly to give my life (a lack of) meaning
github.com
I’ve also written a more detailed writeup here: https://imtomt.github.io/ymawky/
github.com
I’ve also written a more detailed writeup here: https://imtomt.github.io/ymawky/
And super educational. Since then I've been pondering which problems require dropping down to the assembly level. E.g. implementing a JIT compiler, a coroutine runtime, etc.
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.
I made a self documented (all the related links are in the file) single makefile (https://gist.github.com/ontouchstart/d3ad8e4d0adf63532303a90...) so that anyone can build ymawky from scratch and dig deeper by tinkering.
I can see the potential of doing some implementation of APL/J/K at levels even lower than C, like how those guys did APL\360 using assembly language. It is going to be super fun in the era of everyone using LLM to pump out verbose Python/TS/Rust code with context windows bigger than the whole operating system.
In a comparison between a similar fork-per-connection server written in C and this, I would imagine the throughput would be about the same, because the bottleneck in this model is fork() itself rather than the actual code. It probably matters more for binary size and startup time than requests/sec. Would be fun to actually benchmark, though.
Congratulations to the OP for the accomplishment.
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):
You don’t have to. It’s perfectly okay to take your modern car to a mechanic and hire a contractor for your remodeling needs.
But some people like to do it themselves, even when the project is large.
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.
Humbling.
One of my first assembly projects was a CGI Script 100% in x86 assembly.
A full web server is certainly more impressive! Though I'd recommend to beginners to look up CGI and mod_cgi in Apache first lol
The script has been lost to time. I wrote it 5+ computers ago and I don't even know where input that backup...
The overall gist is that CGI Bin specification sets Environmental variables, STDIN and STDOUT to various values. A minimal pure assembly that writes <h1> Hello World </h1> over stdout is your minimalist CGI Script.
A bit of research into what those STDIN/Environmental variables is needed for more. I knew this may e 20+ years ago but have long forgotten....
With access to the various input parameters offered over CGI, you can easily access form data (buttons and whatever clicked by the user). Use some smart file writing to store sessions and off you go....
-------
Maybe start with a Perl CGI tutorial. Then go backwards to C, and finally raw assembly by hand
Thanks for the tips on CGI! Definitely going to look into it more. The server-side execution of CGI scripts definitely interests me more than the CGI scripts themselves, so I’ll probably just look for some existing (simple) CGI scripts and work on building the env vars and executing them.
My overall lesson was to stick with Perl / CGI-bin.
That being said, I wrote in "Human Readable Assembly" back then. Ex: function calls were:
mov eax, string
call myFunction
.db '\n' ; this parameter for myFunction
I would put compile time constants after the functions. Then I would before returning, pop the return address off the stack and add reg, 1, and push it back on.It's horribly inefficient to do this today. But it allows you to write more flexible assembly functions that were more readable. Especially with macro-assemblers with some kind of preprocessor.
P.S.: I would love a copy of that book please!
Really cool project though!
Modularizing it into multiple files was easier than I expected it to be, you basically have other functions/labels in other files, and mark them as .global at the top. The Makefile compiles each file into their own .o, which you then link all together. You can "b" or "bl" to any label from any other file, as long as it's global and linked together. Same with data in .bss or .data, mark them as .global and they can be accessed from elsewhere.
Bookmarking this — going to read the source on my Sunday off.
The absolute best projects ever posted here are the ones made for no other reason than “just because I wanted to”.
In general, stable syscall numbers are just a Linux thing. Everyone else uses blessed system libraries
I had a very hard time simply using and even utilizing C++ or Java.
C and Turbo Pascal especially was easier because the compiled code was very much resembling to hand written code.
As the author described, you can do in 4.000 lines what others can do with way less pain in 100.
So you build macros, come up with your own library and in the end you kind of build a meta language build on top of assembly because some lines are so hard to grasp that you delegate working code into a library for reuse.
It is funny how much we take conventions for numbers for granted. If you happen to know assembly and its intricacies you immediately will learn to work with a sign bits which mark negative numbers. But how do you know? Maybe you use the whole addressable space only for positive numbers.
Small things that make a huge different.
Nice article, I enjoyed your adventures and would do the same.
Higher level languages are more convenient for 99% of things, but the directness of Assembly gives me a rush unlike any other. I didn't live through the C64/Amiga, but I was obsessed with old C64/ZX emulators growing up.
Once I was doing 3D I quickly started moving everything but the inner loops to Turbo C, because I'm not a total masochist :)
It would be awesome to read a blog post about the project. Your approach, lessons learned, unexpected stuff, etc.
- 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-specific
jk. Metal as fuck. Love it.
...
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.
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.
Maybe it's finally time to move on from being a career programmer.
Artisanal code, or bespoke code, has always been the best paid and most satisfying work. If we no longer have a new generation of curious people who enjoy solving hard problems, it's only going to become more valuable.
What I realized was that knowing what my software did, being able to explain every part of it and being able to rewrite it from scratch if necessary, was much more valuable than just delivering it. The powers that be who run companies are looking for communication, so they understand what they're getting, someone who can speak the same language as them and materialize it into code that works. LLMs are a decent imitation of that, but they're fatally flawed, because they never understand a whole stack.
> And the only people who will ever be in that position are the ones who take the time and effort, out of sheer curiosity, to learn how things work.
People learn something new all the time, AI does not learn anything, it just simulates and hallucinates. But the core question is not addressed with that. What would you do if you have to compete against AI, and AI is better? We already see these with the new generation of humanoid robots from China. Those things make Boston Dynamics robots look like tinker-toys in comparison - already as-is. Give it ten more years and we finally reached AI skynet for real.
success through cleverness and inventiveness - not yet fucked by AI
achievement through stubborn persistence - you can still dig deep holes in the garden
you still could have a character, if you were lucky
human agency? not yet fucked up, but it's gonna be
achievement earned through one's own qualities or effort? - intact somewhat
Nothing beats Go.
When you use HTMLX (goat) + sqlc (goat) + pgx (another goat) + Chi (yet another goat) and Sqlite (goat).
Most apps will not need anything more than Sqlite, i've several sqlite apps doing a couple of million visits per day.
Compiles to signal binary blazingly fast.
Deploy using systemd service, capture logs with alloy / Loki graphana setup, set up alerts and monitoring and go home.
And you can serve millions of requests on a server with 512MB RAM.
I don't think you'd ever need more speed than this.
Everything else is bloated, slow and doesn't give you enough room for optimization.
Here's the latency of one of my hobby projects (network latency not included): https://i.ibb.co/hJ6FQtyw/d3d6c9d15765.png
Request rate: https://i.ibb.co/Fq80nfJ4/67fcdbdb7491.png
It's running in US and EU (helps avoid atlantic routrip tax), in this one i am doing some 100s of checks, not simple CRUD work. With Go you can optimize a lot without complexity of Rust.
I didn't need to implement an Intel RDRAND streamer in C and assembler, but it was a ton of fun: https://github.com/ehbar/rdrand-stream
OP, I really liked this project. Kudos for publishing it!
I'm sure I'm not the only one who has fantasized about doing something like this as a self-soothing enterprise. Kudos to you for actually doing it!
Today, I just think, "how long would LLMs have taken to write this?"
I mourn the death of a human artform.
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.
For me it's about making the computer do awesome things - I do not care how I get there I just want it to do whatever I can conjure in my head.
And a fair aside, the result will be "good enough" approximation of what I conjured in my head, but never the thing itself. For me to do the exact thing I conjured in my head it will require to pick up the mouse and draw the rest of the owl. I don't know if that's more telling of my imagination being demanding or my standards.
Probably not the case for anime pictures, but in other domains, you can use chatGPT as a first level and then go on the improve it from there. To make a parallel: if you draw with a pencil on a piece of paper, you would still think of yourself a doer even if you did not manufacture your pencil or paper.
So far I can't say the same for leveraging LLM's and, in the off-chance that there is, we have an entire software development industry that doesn't even know how to filter for "it".
When I go on a trek, the end of trek landmark is nowhere nearly as significant as the experience of reaching it.
If I were to be magically transported there without the lives experience it would take almost all of the joy out of it. Some people get a kick out of doing hard things that are interesting but seemingly beyond one's ability. Making it an easy commodity spoils the fun.
As for teleportation, if it were, say, trip to moons of Saturn I can make exceptions.
Sure, if you want 300,000 spoons, it’s far better to use a factory process and get essentially identical results. But if you only want a few spoons and accept (or even value) that the spoons will all be a little different, hand-forging them is quite enjoyable.
I’ve written enough assembly and done enough blacksmithing to know that the metaphor isn’t quite apt. But there’s both tremendous effort and satisfaction involved in both.
Nobody actually needs a web server built in assembly language, it serves no practical purpose. And I say that as someone who learned to program 6502 assembly language in 1983 and has sporadically used assembly of various architectures since.
The absurdity of building it would have been the curiosity draw pre-LLMs, but when it existing is just a series of prompts away it really loses all of its meaning.
But yeah... hooray for AI. Can't wait until we learn to harness it to supercharge the most important and valuable thing we do as a human society in modern times: stuff increasingly intrusive ads in front of everyone at all times.
Wasn’t it used for that before anything else? Google invented transformers and had LLMs internally before chatgpt got released. Presumably they were using them for ads, because their public demos were insane things like talking to the moon.
According to friends who worked at Google (no direct knowledge myself, so don't know exactly how true it is), they mostly sat on the tech. Google News had internal prototypes of using them to expand/contract/summarise and/or add details/context to news articles and translate them to different languages, but it was never fully productised.
Then after ChatGPT got popular, sudden panic to start using them in products company-wide.
The difference is that now it is worthless: there is no learning, no person caring about the result, nothing aspirational for the public to look towards... we used to enjoy those challenges, used to be proud of solving complex problems... now? Yeah, whatever, execute execute commit push, let another LLM "review" and call it a day.
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.
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 more demoralizing.
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.
Or employable. Which sucks if you're over 50.
They are factories that product goods on a whim. There is nothing to compare them to as we never had anything like that. This is not industrial revolution this is obliteration of work at its core.
Just because they’re not a pure extension of our bodies or minds like a hammer or pencil doesn’t mean they will magically break the concept of work.
Yesterday I went to a bookstore: saw an interesting book cover then I thought "ah, looks like AI"... all excitement went away. There won't be a "new complexity frontier" for artists that used to draw book covers. Or writers, actors, writers, etc.
AI is currently not enabling any use case which previously was "too hard". It is just reducing the value of stuff by increasing the offer and making people delulu about what they can achieve without proper knowledge.
Making good stuff requires paying attention to a lot of details. Even "simple" stuff can become incredible complex once you actually learn about how it must be done. Most of what we humans do is working on that space, not chasing projects Manhattans.
What do we get if population is disconnected of the true complexity of creating stuff? Perceived value decreases and if everything is perceived equally bad people will stop caring about quality. That is why fascism likes uneducated people.
So, that is about the AI contribution to "value" itself.
Now, is it true that AI will allow us to create more complex stuff that is not practical now? I would strongly disagree. The reason is Kolmogorov complexity: it is not possible to find the shortest program that describes a task. Describing it with natural language will not magically give us permission to avoid having to describe that complexity. What is the point of switching from C to English, if I still have to specify every little detail in a much ambiguous and verbose language? Programming languages are not the challenge, they are the solution to the problem of having to specify complex tasks in a reproducible way.
Now gathering everything together: that is why I think that generative AI makes things worthless: value reduction, complexity perception reduction (which reduces value), a population ignorant of the complexity will choose subpar options because "they are all the same garbage" and we will not get any superior engineering capability anyway.
Writing whole software projects in assembly has been worthless and pointless for a couple of decades now. Even the projects who can put together a solid case will limit assembly to very specific components executed only in specific bits of a hot path. Perhaps the most performance-sensitive code we have today is high frequency trading and that field is dominated by C++.
Also, virtually all mainstream compiler suites have flags that output assembly,and that feature is largely ignored and unused.
What's next, human human contact abstracted away by brain stimulation?
And the transhumanist arsewipes gonna have a field day.
Never too late to ignite the nukes...
Of course! Corona/junta/scarecrowvirus don't transmit over the wire, while ads, taxes and surveillance do alright!
Isn't that kind of view pathetic and sad, though? Why would anyone pick up and guitar or play a piano if they could just listen to the same song already made by someone else? I struggle to understand this view of people that pretend to not understand why being an expert of some skill is perceived as valuable by some people. This is also belies next problem with this line of thinking which is that it says "we don't need to learn X to do Y because we have AI" but misses the same AI could easily replace the need to have you think to do Y in the first place. I don't know.
So, in my view, more people will (or should) understand now what is hard when building complex things, if they pass the stage of "I have a nice POC that works for this one case".
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...
But you're not doing it. The ai is doing it.
If the op can write a web server in assembly language then I'm pretty sure they could have done it in a higher-level language. But they did what they did for the journey and the learning along the way. Vibe coding it omits all that, and misses the point of the exercise.
The “you” doesn’t necessarily refer to you. Im addressing 90% of the developers out there. We love playing around technology… but I doubt we will be thinking the same once we become unemployable. But here we are, having fun with the tools of companies that want to finish us. How ironic
While I work in IT today, that wasn’t always true. I am certain I spent more free time playing with computers when my work did not involve computers at all. While I enjoy working with computers at a variety of different levels, when I do it all day, I don’t typically wanna do it when I get home. If Anthropic means there are no more IT jobs, software jobs, etc. etc. etc. (which I think is highly unlikely) then I guess I will have to do a non-tech job just like 99% of the other human beings. If that comes to pass,I expect in my spare time I will suddenly reacquire a love for tinkering with computers.
Only exciting if you already got a lot of programming under your belt, like Carmack, or a product guy.
If LLMs are good for doing things we aren't already doing, it indicates the overall addressable "value" that LLMs could provide for such things is actually quite low. If the task has necessary prerequisites that you don't currently possess, but you haven't spent the effort to jump that hurdle yet, then it's a good indication the value of completing that task is very low. Even if, maybe especially if, we're talking about personal projects where the value proposition is personal and not momentary, it indicates the person already feels in their bones that the return on doing this thing is not worth the effort.
I'm struggling with this with my leadership at work. We have developed a thing that is going to remove the need to hire temps [0] for data entry when we get clients who send us large amounts of their "data," aka "a thousand 30-slide PowerPoints each with one line graph of interest sitting in the corner of one slide somewhere." It is an ask that comes up a lot, it's always very expensive in both the time and money axes for the client for that task, but overall it's just a small part of the contact budget. I'm all for using what we've built to cut down the time cost for our clients, but my leadership thinking it's going to lead to massive cost savings for our clients seem to forget just how much time we spend in meetings and planning and documentation and testing and reevaluation and more meetings versus actually executing on things.
It's also bad business. To me, giving results faster should be a premium offering. We should be charging more, not less.
[0] We don't actually hire temps, we turn our junior data analyst into temps by burning them out with tons of unpaid overtime. They then leave and we have to back fill them at rather extreme cost of overhead for hiring compared to the direct contract overtime we didn't provide.
>> without the limitation of your ability to hand code it.
yeah its nice though this in 100% of cases results of software of even lower quality we had before.
so hard to tell where is the win here. the fact that you can generate some code does not make it a win, just a curious fact.
If you are having an LLM generate the assembly language for you, that is not even remotely close to writing the assembly language yourself.
I don't find it exciting even in the slightest. I can think of nothing more boring and unsatisfying than having an LLM generate all of your code for you.
I mean, I understand why some think this could be exciting from a "I can get something done fast because the LLM generates it for me" standpoint -- because their excitement stems from something getting done at all instead of just sitting in the pool of ideas forever. However, you will never know the code generated by an LLM like you know the code you wrote yourself. Also you will never gain the same satisfaction of finishing a project where the code was written by an LLM that you gain from finishing a project where you wrote the code yourself.
If you are a person that doesn't care about coding or doesn't like to code at all, I could totally see why you'd find this exciting - to you it's all about avoiding work you don't care for or want to do yourself anyway. Also, a high percentage of people who do love coding have zero interest in writing assembly language, so if they were required to write some for a project, I could also see them being happy with having an LLM generate that part of the project for them.
However, I think for people who genuinely love to write code, the situation is the opposite of what you said -- it is far more sad than it is exciting. In fact, for many of them it has already reached the point of depressing for many reasons. I don't think it is primarily because the LLMs have gotten significantly better at generating code (which they have). I think some of the bigger reasons are that so many people who now pay people to produce code have:
1) got a very short-sighted and "rose-colored-glasses" view of what LLM-produced code will do for their company.
and
2) deeply under-appreciate the value of having a person or team of persons who understand their business, the hardware and software required to support their business, and the work required to both keep things running and handle new requirements as they come along. Because of that under-appreciation, many already have punted ( and/or are preparing to punt) those people to the curb because they think they can just have an LLM do their job and save a ton of money.In the long run I think most (if not close to all) of those businesses are going to be sorry if they over-indulge in replacing human-produced code with LLM-produced code. I think the ones who lean too heavy on the LLM side are going to eventually collapse into a heap of unmanagable dumpster-fire code that they can't understand nor maintain. A whole new world of incidental complexity will consume every project, and in the long run it will just eat them alive (figuratively speaking, of course :-D ).
Yes, an LLM can write it, it’ll probably work. Yet, it’ll remain meaningless slop while this is not.
We need to stop thinking of software as carpenters where the magic is some physical skill and that is the "CRAFT WE MUST PROTECCT".
And at least your comment was grounded in reality; a lot of people I talk to (who are not coders) seem to think a good software engineer writes every line and every word with thoughtful genius and AI just spams code so one is better than the other. And they are convinced its some naunced smart take and they understand software development on a inner level or whatever.
And the base assumption still holds true (pure AI-generated code is garbage) but its mostly because its badly designed and is still a pretty poor architect. And there is a need to pushback against slop but why do we need to elevate typing code as if its some sacred acctivity? Most of the work a good coder does is in their mind with little connection to the phyiscal reality of the world.
Look, I still got my physical copy of Michael Abrash's Graphics Programming Black Book with its genius content about hand-optimizing cycle count on 486 and Pentium processors, beating compilers at that time.
It was an absolute artform, but completely obsolete by today.
I'm afraid it's an elite skill in the sense that juggling is also an elite skill. It's impressive for the first few seconds you gaze into it, but once the novelty factor wears off you understand that it's wasted effort that leads to a project that suffers from a massive maintainability problem, is limited in which platforms it can run, and brings no advantage whatsoever. It's an gimmick that has no practice use.
This is the software development equivalent of an amateur guitarist posting shredding videos on YouTube.
In the same way we appreciate Japanese wood joinery, why not not just appreciate this? Someone might even learn a trick or two reading it.
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://en.wikipedia.org/wiki/Software_craftsmanship
This sort of project is more in line with parlour tricks, juggling, and stunt shows. Trying to frame this sort of project as software craftsman is like discussing the whole Jackass series as cinema next to Hitchcock and Scorcese. It may take skill and practice to be punched in the nuts, but that doesn't make it a craft.
To which change, exactly?
Some 120 years ago recordings music was a living phenomena produced in the moment. Musicians worked at restaurants and coffee shops everywhere, being useful without being super stars.
Music didn’t disappear with recordings, but the works is certainly different.
AI music is yet to be anything but a curiosity. Recorded music changed so much about everyday life that you can’t imagine the world before it.
I mourn the death of a human artform.
So what art form can a human make with an LLM assisting?With LLMs, we can't tell anymore if something is a labor of love with hundreds of hours of work behind it, or half a dozen prompts to Claude Code.
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.
Yes, it's not deterministic, and if you were using it commercially, the ROI would be terrible, and it's certainly not reliable but for a hobby project.... why not?
Encouraging people to understand the layer of abstractions they're building on is helpful, doesn't matter if they do it by hand or with clankers.
LLMs lower the barrier for execution - they make you faster. The unstated question is: faster at what - they can make you faster at something clever, or faster at the entirely wrong thing...
Your point is correct if we're looking at it through a scarcity lens - the effort to make it certainly decreased a lot - but that doesn't mean that anything is now worthless. We can just move onto doing bigger, better things now, until we hit the next limits...
But we know that long term use of LLMs does not lead to better understanding, it leads to reliance on the LLM for the person to be able to function at their job.
I'm not claiming to have a definite answer to either, but I think the right question to ask is - are you going to benefit from using it in the long run? If yes, carry on, if no, re-evaluate what you're doing :)
If you come to rely on specific tools such that you can't do your job without them, you're no longer doing the job you think you're doing, you're now just a tool operator. If I don't have a computer of some kind, I'm not writing software, I'm just a manager. If my team can't work because GitHub is down, then we've done a bad job of being software developers.
The experience taught me that there are two kinds of tools: those that are necessary and those that are nice to have. Yes, that job sucked, and yes, I quit that job, but more because they refused to pay me the overtime I needed to get it done with such crappy tools.
I had another job where we were one client of many on site with a vendor for a training event and the vendor couldn't get a system configured correctly for our cohort to continue on. Part of the problem was their configuration system was garbage, very easy to get wrong, very time consuming to manually edit. While they were dicking around with throwing edits against the wall, I wrote an HTML page with JavaScript to make a UI to edit the data in an much more natural way and then generate the config file. It took 10 minutes and saved us hours of waiting so that we could continue on with the training. Perhaps the takeaway from that experience was that Valve's engineers write shitty config systems. All I know is we got the training event done and I walked away with a piece of paper that said I was now a Certified Hardware Vendor, which we then used to sell more contracts on our own.
Would we have considered writing a server in C writing it in assembly? No.
Well, look at this way, the needs of commerce are going to solve the conflict between practical and the beautiful. I think those of that value the beautiful aspects of coding will find new avenues of expression. For example, I'm about to get back into C programming to build a play.date game engine for an MMO.
Is not the end of the world. Is a change.
The artform only dies if you let it. Even if your employer is so idiotically myopic as to forbid you to ever write your own code, you can still continue the art on your own time. I for one don't care how "good enough" any AI-lableled technology gets at writing code. I will continue to hone my craft until the day I either die, become too unwell to do it, or some other creative endeavor consumes all of my personal time.
I'd be doing the same kind of thing if I had more free time.
I don't know how much you know about assembly code, but people write it professionally to squeeze performance, typically on a server, and servers are lot more likely to run Linux than Mac. The project in question literally is a web server. Who runs a real production-grade web server on a Mac?
Some of it is in pursuit of productization feedback. Some of it isn’t.
The general audience here is (or at least, used to be) tech enthusiasts, and you can usually assume that crowd will enjoy cool shit in tech.
Personally I’ve had to occasionally hand write x86 assembly for work on a handful of occasions to ensure certain runtime guarantees were met that the programming language i was using couldn’t provide directly. I’ve used it a ton in hobby projects because it’s just kinda cool, and i want to have a better understanding of that world.
As for why it wouldn't run on Linux, there are some pretty big differences in the actual assembly. One pretty superficial difference is calling conventions -- MacOS uses the x16 register for syscall numbers, Linux uses x8. Calling the kernel in Mac uses "svc #0x80", in Linux it's "svc #0". That's ~120 lines that need to be replaced, but easy enough to just use sed. Syscall numbers are all different, as are the struct layouts for sigaction(), MacOS has an "sa_tramp" field that Linux doesn't have. Enforcing max processes is done here using the MacOS-specific proc_info() syscall, which can be used to get the number of children any given process has. Linux doesn't have an equivalent, so process tracking would need to be done differently. Finally, Linux has the getdents64() syscall, rather than getdirentries64(), which uses a different struct and is called differently.
I'm sure an LLM could make all those changes, but it's a pretty large codebase, so it would probably make some mistakes or miss things.
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.