frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

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

https://github.com/imtomt/ymawky
159•imtomt•3h ago•61 comments

Show HN: I made a Clojure-like language in Go, boots in 7ms

https://github.com/nooga/let-go
135•marcingas•12h ago•39 comments

Show HN: Rust but Lisp

https://github.com/ThatXliner/rust-but-lisp
116•thatxliner•8h ago•61 comments

Show HN: Countries where you can leave your MacBook at a random coffee shop

https://vouchatlas.com
12•canergl•6h ago•11 comments

Show HN: Mochi.js: bun-native high-fidelity browser automation library

https://mochijs.com/
40•ccheshirecat•16h ago•19 comments

Show HN: Modafinil - Let agents continue running while MacBook lid is closed

https://github.com/narcotic-sh/modafinil
4•hamza_q_•3h ago•6 comments

Show HN: Remind – schedule Claude Code on your Mac

https://olliewagner.com/remind
3•olliewagner•4h ago•0 comments

Show HN: Create flashcards with Space CLI

https://getspace.app/cli
18•friebetill•15h ago•6 comments

Show HN: Free tool to mark points and polygon regions

https://tack.pics
19•magikMaker•3d ago•6 comments

Show HN: TRUST – Coding Rust like it's 1989

https://github.com/wojtczyk/trust
161•wojtczyk•3d ago•87 comments

Show HN: Git for AI Agents

https://github.com/regent-vcs/re_gent
114•doshay•1d ago•65 comments

Show HN: GETadb.com – every GET request creates a DB

https://www.getadb.com/
38•nezaj•1d ago•42 comments

Show HN: Free OSS transcription app I made and found it's faster than wispr flow

https://mumbli.app/
4•fireharp•8h ago•1 comments

Show HN: Chuchu, an Android SSH client built on libghostty

https://github.com/jossephus/chuchu
6•jossephus01•15h ago•0 comments

Show HN: CADara – I made an open-source in-browser CAD

https://cadara.app
32•ttouch•1d ago•7 comments

Show HN: A search engine for deleted YouTube videos (1.5B+ indexed since 2005)

https://tube.archivarix.net/
10•archivarix•15h ago•2 comments

Show HN: Tilde.run – Agent sandbox with a transactional, versioned filesystem

https://tilde.run/
199•ozkatz•3d ago•132 comments

Show HN: Airbyte Agents – context for agents across multiple data sources

150•mtricot•4d ago•47 comments

Show HN: AirScore – Daily air-quality emails synthesizing EPA, NOAA, and pollen

https://getairscore.com
2•JHARDIMAN•13h ago•0 comments

Show HN: My AI agents bully each other to prevent context drift

https://wuphf.team
4•najmuzzaman•13h ago•0 comments

Show HN: Agent-skills-eval – Test whether Agent Skills improve outputs

https://github.com/darkrishabh/agent-skills-eval
76•darkrishabh•3d ago•36 comments

Show HN: I built an open-source email builder, alternative to Beefree/Unlayer

https://play.templatical.com
160•oahmadov•3d ago•48 comments

Show HN: Real-workload SQLite benchmarks on Hetzner's cheapest VPS

https://s13k.dev/blog/real-workload-sqlite-bench-on-5-dollar-vps/
6•s13k•15h ago•0 comments

Show HN: JSLike, a CSP-Safe Interpreter for JS, TS, JSX, TSX in JS

https://github.com/artpar/jslike
6•artpar•15h ago•2 comments

Show HN: Stage CLI – An easier way of reading your AI generated changes locally

https://github.com/ReviewStage/stage-cli
44•cpan22•2d ago•31 comments

Show HN: Local AI search for your video library (local, open source)

https://edit-mind.com
2•iliashad•18h ago•1 comments

Show HN: nocal is a calendar that turns your week into a workspace

https://nocal.app/
7•bcmuse•18h ago•1 comments

Show HN: Concord – Feature rich TUI for discord

https://github.com/chojs23/concord
7•jpellamo•18h ago•4 comments

Show HN: Hallucinopedia

http://halupedia.com/
304•bstrama•3d ago•266 comments

Show HN: PHP-fts – Full-text search engine in pure PHP, no extensions

https://github.com/olivier-ls/php-fts
87•asmodios•3d ago•23 comments
Open in hackernews

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

https://github.com/imtomt/ymawky
158•imtomt•3h ago
This is ymawky, a static file web server for MacOS written entirely in ARM64 assembly. It supports GET, PUT, DELETE, HEAD, and OPTIONS requests, and supports Range: bytes=X-Y headers (which allows scrubbing for video streaming). It decodes percent-encoded URLs, strictly enforces docroot, serves custom error pages for any HTTP error response, supports directory listing, and has (some) mitigations against slowloris-like attacks.

I’ve also written a more detailed writeup here: https://imtomt.github.io/ymawky/

Comments

imtomt•3h ago
This 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
dang•2h ago
Whoops that was my fault. Fixed now. (I emailed you, btw, that we'd changed your title, but I forgot to switch the URL back to the repo. Both links are cool.)

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!

imtomt•2h ago
Hey, thank you! Means a lot. It's an odd sort of meditation, but is surprisingly the most almost-therapeutic project I've worked on. Something about the constraints of Assembly that really pull you into the minutiae and clears your head, maybe.
thatxliner•3h ago
I'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!

imtomt•2h ago
Thanks, I appreciate it a lot! I tried to comment my code pretty heavily (~3000 lines of code, ~1000 lines of comments all together), since this was a learning project for myself in the first place. Hopefully those will be of some use. But separate in-depth documentation is definitely a good idea, I'll work on adding that. In the meantime I'm always down to answer any questions about it!
thatxliner•2h ago
My first question would be where should I start reading? It seems like you modularized it into multiple assembly files (how does that even work?)
imtomt•2h ago
Honestly, read the main file, ymawky.S first. Then I'd read through get.S maybe, checking parse.S on an as-needed basis for parsing-related functions. delete.S or options.S are pretty short, too, so give those a read too.

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.

vasco•35m ago
If you'd be happy with that then you can generate them yourself!
chrisweekly•3h ago
That fake O'Reilly book cover is pure gold.
imtomt•2h ago
That book is exactly what inspired me to make this in the first place, haha. The subtitle of the book gave me the acronym I named it.
____tom____•39m ago
Fauxreilly!
trollbridge•2h ago
Gave me a warm feeling to know that someone would actually still bother to do this by hand. I'm not the only one!
imtomt•2h ago
Thank you! I've been obsessed with this idea for a while, finally decided to start on it, then obsessed over it for a couple weeks. I'd love to see some of your projects if you have anything similar, I'm glad I'm not the only one too! I think most programmers would benefit a lot from taking a few weeks or months to try and learn some assembly, and demystify how CPUs and compiled languages work.
_the_inflator•2h ago
I 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.

imtomt•2h ago
Thank you! The thing about eventually building your own meta language ends up happening all the time with bigger assembly projects. I do have a fair few quality-of-life macros too, but probably fewer than I should. I did end up needing to implement by hand what would be standard functions, things like atoi, itoa, strlen, memcpy, streqn.

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.

digitaltrees•2h ago
I don’t know why, but this project has me irrationally excited!
jjbigs•2h ago
This is fucking nuts
OutOfHere•2h ago
An 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?
shepherdjerred•2h ago
The first paragraph of the README says this was hand written so I’m not sure why you’re bringing up LLMs
imtomt•2h ago
I wrote it for MacOS because I don't have a Linux machine right now :( Once I get one up and running again, I'll probably work on porting this.

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.

tgv•30m ago
You could always start in a virtual environment.
rogeliodh•2h ago
Awesome. Any resource recommendations to learn ARM assembly?
imtomt•1h ago
Honestly, just reading existing assembly to get a feel for how it works, and then violently googling everything that goes wrong. The ARM Architecture Reference Manual (aka "The ARM ARM") ended up being really helpful for looking up what specific instructions do and how they're called. Another really helpful tool is writing something in C/C++, and compiling with "gcc -O1 -S file.c" to see the assembly gcc generated. It helps to mess around a lot with smaller programs in gdb or lldb.
boring-human•2h ago
Even 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!
imtomt•1h ago
Thank you! This is one of the nicest things I've heard in a while.
cylinder714•2h ago
Here's a piece on writing portable ARM64 assembly: https://ariadne.space/2023/04/12/writing-portable-arm-assemb...
imtomt•1h ago
Thanks for the link, bookmarking. I should note ymawky's main portability issues are unfortunately at the syscall layer rather than the asm layer. proc_info() and getdirentries64() are pretty Darwin-specific, so making it portable would require reworking that whole area rather than adjusting register/calling conventions.
faangguyindia•2h ago
I'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.

sampullman•1h ago
Did you reply to the wrong submission?
tonyedgecombe•1h ago
They replied to the title.
iamgopal•1h ago
How are you merging sqlc and pgx with sqlite ?
lelandbatey•1h ago
Specifically how can you use pgx with sqlite while pgx is a postgres-specific library? Sqlc works great with Postgres or Sqlite, Sqlc works with pgx when connecting to Postgres, but pgx can't be used with Sqlite AFAIK
losteric•1h ago
Can you share what some of those apps are?
plusplusungood•1h ago
What's your point?
faangguyindia•1h ago
You don't need to use assembly for high performance web app when you can just use Go.
ericbarrett•1h ago
You don't, but it's so much cooler when you do! Not everything needs to be a beige utilitarian module optimized for business consumption.

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!

imtomt•1h ago
Woah, that's really cool! I'm glad you did that even if you didn't need to. I honestly think everyone needs to write more assembly, because it's so much cooler.
arrty88•15m ago
I’ve written all of these languages and more professionally. I agree none match the speed and simplicity of golang. Go is that efficient.
xyst•1h ago
Need a straight binary port now
imtomt•1h ago
Why stop there? Next, I'm prying open a CPU and poking the transistors with a 9V battery and paperclips to make it execute what I want. Slower, but you get so much control.
JSR_FDED•1h ago
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.

t-3•53m ago
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.
bananaboy•1h ago
This is amazing, great work! I love it!
nunez•1h ago
Where's your SKILLS.md? How did your agents make this?

jk. Metal as fuck. Love it.

imtomt•58m ago
Ahh you caught me. I just kept telling ChatGPT dot com "no, make it less efficient" and copied whatever output it gave me. jk, thank you!
dddddaviddddd•52m ago
Even 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.
imtomt•27m ago
Honestly haven't benchmarked it, but I would imagine ymawky would be considerably slower than most fully-featured web servers. ymawky uses fork-per-connection, which is fundamentally slower than what production servers like nginx or Apache use. nginx uses event-driven IO (kqueue/epoll), which can handle thousands of concurrent connections without the overhead of forking the process on each request. Apache uses pools of threads which handle multiple connections without needing to be spawned per-request. A head-to-head against any other web server would mostly measure "fork-per-connection vs event loop/thread pools", which assembly has nothing to do with.

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.

arrty88•18m ago
Should i ask my Claude to benchmark it against nginx or will you ask yours
mappu•38m ago
Syscalls 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

imtomt•21m ago
Yeah, I know MacOS syscalls aren't stable. Interesting point about Go, I hadn't heard about that. Unfortunately I'm a masochist though, and want to avoid libSystem.dylib as much as possible. The only reason I link against it at all is because MacOS requires it for executables to run, I never actually call into it. Figured I'd just update the syscall numbers if/when they change.
maomaoati985•38m ago
Your determination to make this happen was remarkable — and you truly accomplished it. Congratulations
Ati985•37m ago
Your determination to make this happen was remarkable — and you truly accomplished it. Congratulations
ybouane•35m ago
We are moving to AI and stopped writing code / scratching our heads, and you're here writing a web server in assembly.

Humbling.

Thanemate•34m ago
I'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.

noduerme•21m ago
What a dismissive comment. Now that anyone can have an LLM write code for them, the only people who have value to bring to a project are the ones who can improve upon the LLM's output. That is, the ones who have a deep enough understanding of the logic and language. 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. Whatever your alternative is to this, there is no future in the alternative.
washingupliquid•25m ago
Didn't Steve Gibson do this like 25 years ago? AFAIK his "Shields Up" site is written in Win32 assembly.
eptcyka•19m ago
Then it is unlike this, as this is written in arm64, not x86, and not for Win32.
marc_g•24m ago
This 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!
arrty88•19m ago
Love this so much.
rdevilla•12m ago
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.

stbev•5m ago
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.