Show HN: Building a web server in assembly to give my life (a lack of) meaning
I’ve also written a more detailed writeup here: https://imtomt.github.io/ymawky/
- rdevilla - 22052 sekunder sedanTen 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.
- Thanemate - 23413 sekunder sedanI'm oddly enthusiastic about seeing someone who beings the HACKER in HackerNews. But at the same time, this made me remember the days when display of skill and craftsmanship were rewarded in the industry.
Maybe it's finally time to move on from being a career programmer.
- stbev - 21670 sekunder sedanI 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.
- matteohorvath - 15204 sekunder sedanIt's a beautiful project, well crafted. To reflect to the other comments, projects like this are more like a Minecraft map for me. There are giant and amazing maps, small survival maps, local hosted for my friends and myself, and commercial focused high scale servers. Building a house, or designing a new road in the server became extremely easy with AI, put the value created in the world depends on the original purpose of the server and whether creating more houses and roads actually makes sense. I think it's a super thing that commercial server can build out faster and be bigger with more houses and roads on it, but The love an art project creates in the world is incomparable.
- tgma - 17874 sekunder sedanIf 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.
- trollbridge - 32077 sekunder sedanGave me a warm feeling to know that someone would actually still bother to do this by hand. I'm not the only one!
- toshikatsu-oga - 1859 sekunder sedanLove the honesty in the title. I'm 49, learned to code two years ago after 30 years as a carpenter, and "to give my life meaning" hits closer than most career ladders ever did.
Bookmarking this — going to read the source on my Sunday off.
- chrisweekly - 32179 sekunder sedanThat fake O'Reilly book cover is pure gold.
- behaviors - 17719 sekunder sedanWell done. Been working on a similar smaller project for RISC-V. This is excellent
- dddddaviddddd - 24464 sekunder sedanEven though it's a meaningless comparison, I'd be interested to see how performance compares (max requests per second?) for this compared to fully-featured web servers.
- marc_g - 22779 sekunder sedanThis is cursed and wonderful. I especially appreciate status code 418. I hope I run into that in the wild one day, then I'll think of you!
- dalleh - 21118 sekunder sedanWith the bubble of LLMs, these projects are really appreciated. Keep up the good work!
P.S.: I would love a copy of that book please!
- dragontamer - 20029 sekunder sedanHmmmm.
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
- mappu - 23612 sekunder sedanSyscalls on macOS aren't guaranteed to be stable - Go found out the hard way and in 1.12 they changed to call libSystem.dylib instead.
In general, stable syscall numbers are just a Linux thing. Everyone else uses blessed system libraries
- ybouane - 23433 sekunder sedanWe are moving to AI and stopped writing code / scratching our heads, and you're here writing a web server in assembly.
Humbling.
- thatxliner - 32396 sekunder sedanI'm wanting to read this repository as a learning tool, so it'd also be nice to include docs—even AI-generated docs, but obvious I'd prefer docs with your own design notes and decisions—about the architecture of the code.
Really cool project though!
- Ati985 - 23558 sekunder sedanYour determination to make this happen was remarkable — and you truly accomplished it. Congratulations
- cylinder714 - 28774 sekunder sedanHere's a piece on writing portable ARM64 assembly: https://ariadne.space/2023/04/12/writing-portable-arm-assemb...
- _the_inflator - 31686 sekunder sedanI feel the guy’s suspicion towards any high level language. I exclusively programmed in assembly on C64, Amiga and the recognized that this ain’t sustainable on PC because there are more and more edge cases or different machine configurations.
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.
- digitaltrees - 30543 sekunder sedanI don’t know why, but this project has me irrationally excited!
- AppAttestationz - 19173 sekunder sedanI suspect that the test suite isn't great. Bun has so many different behaviors compared to other JS engines, sometimes just plain wrong or contradicting the spec. Test suite didnt catch those..
- scuff3d - 2712 sekunder sedanThis is awesome! I'll have to try reading through the code when I have more time.
It would be awesome to read a blog post about the project. Your approach, lessons learned, unexpected stuff, etc.
- washingupliquid - 22820 sekunder sedanDidn't Steve Gibson do this like 25 years ago? AFAIK his "Shields Up" site is written in Win32 assembly.
- rogeliodh - 29261 sekunder sedanAwesome. Any resource recommendations to learn ARM assembly?
- boring-human - 29044 sekunder sedanEven after we've all retired (pretty soon for those who can afford it) or transitioned out of software engineering (for those who can't), we'll still get to amuse each other with home-brew projects like this. Warm fuzzy feeling - I'll take it!
- bananaboy - 25657 sekunder sedanThis is amazing, great work! I love it!
- polotics - 2600 sekunder sedando you know about rwasa?
...
- arrty88 - 22483 sekunder sedanLove this so much.
- niftynanometer - 15082 sekunder sedanInsane
- shevy-java - 19724 sekunder sedanIf it is written in assembly, why is it for MacOS only?
- JSR_FDED - 26901 sekunder sedanThis 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.
- xyst - 28082 sekunder sedanNeed a straight binary port now
- nunez - 25506 sekunder sedanWhere's your SKILLS.md? How did your agents make this?
jk. Metal as fuck. Love it.
- jjbigs - 29949 sekunder sedanThis is fucking nuts
- faangguyindia - 28666 sekunder sedanI've used Python (django/flask/fast api), Java (springboot), Ruby on Rails for writing web applications and APIs.
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.
- imtomt - 33018 sekunder sedanThis post seems to now link to the writeup rather than the repository, sorry! The repo can be found at the top of that page, or directly here: https://github.com/imtomt/ymawky
- idovmamane - 8228 sekunder sedan[dead]
- vladsiu - 19932 sekunder sedan[dead]
- feiz45607 - 27310 sekunder sedan[flagged]
- paolatauru - 18639 sekunder sedan[dead]
- Ami985 - 23772 sekunder sedan[dead]
- feiz45607 - 27013 sekunder sedan[flagged]
- ankur-ag - 19740 sekunder sedan[dead]
- OutOfHere - 29577 sekunder sedanAn agentic LLM should be pretty good at Arm64 assembly generation, but maintainability of large code could become an issue. Why would it not run on Linux?
- maomaoati985 - 23598 sekunder sedanYour determination to make this happen was remarkable — and you truly accomplished it. Congratulations
Nördnytt! 🤓