Awesome. Any resource recommendations to learn ARM assembly?
Show HN: Building a web server in assembly to give my life (a lack of) meaning
21–30 of 246 posts
Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#22Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#23Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#24Nothing 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.
Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#25An 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?
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.
Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#26Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#27I'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 se…
Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#28I'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 se…
Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#29Here's a piece on writing portable ARM64 assembly: https://ariadne.space/2023/04/12/writing-portable-arm-assemb...
Re: Show HN: Building a web server in assembly to give my life (a lack of) meaning
#30I'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 se…
Did you reply to the wrong submission?