10 ms·
Show HN: Building a web server in assembly to give my life (a lack of) meaning
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/ https://imtomt.github.io/ymawky/
- Ati985 5mo agoYour determination to make this happen was remarkable — and you truly accomplished it. Congratulations
- ybouane 5mo agoWe are moving to AI and stopped writing code / scratching our heads, and you're here writing a web server in assembly. Humbling.
- dwedge 5mo agoYeah, humbling - I know which path I prefer
- bigstrat2003 5mo agoWho's "we"? I have too much self-respect to turn in crappy clanker-generated code rather than doing a good job myself.
- washingupliquid 5mo agoDidn't Steve Gibson do this like 25 years ago? AFAIK his "Shields Up" site is written in Win32 assembly.
- eptcyka 5mo agoThen it is unlike this, as this is written in arm64, not x86, and not for Win32.
- marc_g 5mo agoThis 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!
- imtomt 5mo agoThis 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 https://github.com/imtomt/ymawky
- dang 5mo agoWhoops 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 5mo agoHey, 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 5mo agoI'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!
- vasco 5mo agoIf you'd be happy with that then you can generate them yourself!
- imtomt 5mo agoThanks, 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 5mo agoMy 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 5mo agoHonestly, 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.
- deleted 5mo ago[deleted]
- chrisweekly 5mo agoThat fake O'Reilly book cover is pure gold.
- imtomt 5mo agoThat 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.
- orthogonal_cube 5mo agoI frequently reference this exact meme to people whenever someone complains about complicated or difficult-to-write code. Now that’s you’ve made this project I suppose we have zero room to complain anymore!
- ____tom____ 5mo agoFauxreilly!
- trollbridge 5mo agoGave me a warm feeling to know that someone would actually still bother to do this by hand. I'm not the only one!
- imtomt 5mo agoThank 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 5mo agoI 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 5mo agoThank 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.
- qingcharles 5mo agoI don't know. Certainly the PC had a lot of options, but it wasn't impossible. My first piece of commercial software was written entirely in x86 assembler and had to navigate things like graphics card options and multiple sound card options. It could be done, it was just a lot more of a PITA. Once I was doing 3D I quickly started moving everything but the inner loops to Turbo C, because I'm not a total masochist :)
- digitaltrees 5mo agoI don’t know why, but this project has me irrationally excited!
- jjbigs 5mo agoThis is fucking nuts
- OutOfHere 5mo agoAn 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 5mo agoThe first paragraph of the README says this was hand written so I’m not sure why you’re bringing up LLMs
- OutOfHere 5mo agoBecause it's absurd for most people to write too much Assembly by hand.
- verandaguy 5mo agoWhat if the author wants to learn? Is learning just out of style now? I'd be doing the same kind of thing if I had more free time.
- OutOfHere 5mo agoSo go learn, and stop harassing others who are okay with using an LLM for some tasks.
- verandaguy 5mo agoYou're the only person harassing anyone here; someone wanted to show off a handwritten project they did to learn a thing, and you came in with unsolicited LLM crap.
- OutOfHere 5mo agoPay closer attention. Using an LLM is the only way to get it be cross-compatible with Mac and Linux, since the author admitted that it would be too much to do this by hand. What good is code that can't even run? Heck it can't even run on Docker on a Mac.
- rogeliodh 5mo agoAwesome. Any resource recommendations to learn ARM assembly?
- zzz6519003 5mo ago[dead]
- imtomt 5mo agoHonestly, 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 5mo agoEven 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 5mo agoThank you! This is one of the nicest things I've heard in a while.
- nunez 5mo agoWhere's your SKILLS.md? How did your agents make this? jk. Metal as fuck. Love it.
- imtomt 5mo agoAhh 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!
- cylinder714 5mo agoHere's a piece on writing portable ARM64 assembly: https://ariadne.space/2023/04/12/writing-portable-arm-assembly.html https://ariadne.space/2023/04/12/writing-portable-arm-assemb...
- imtomt 5mo agoThanks 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 5mo agoI'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 https://i.ibb.co/hJ6FQtyw/d3d6c9d15765.png Request rate: https://i.ibb.co/Fq80nfJ4/67fcdbdb7491.png 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 5mo agoDid you reply to the wrong submission?
- deleted 5mo ago[deleted]
- tonyedgecombe 5mo agoThey replied to the title.
- iamgopal 5mo agoHow are you merging sqlc and pgx with sqlite ?
- lelandbatey 5mo agoSpecifically 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
- xyst 5mo agoNeed a straight binary port now
- imtomt 5mo agoWhy 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.
- feiz45607 5mo ago[flagged]
- feiz45607 5mo ago[flagged]
- JSR_FDED 5mo agoThis 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 5mo agoArm 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.
- userbinator 5mo agoHell 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.
- t-3 5mo agoArm64 has plenty of instructions (although some convenient instructions listed in the ISA manuals seem to be rarely available in consumer hardware), and more registers is always better. I do find the lack of wide immediates annoying, but otherwise the fixed-width instruction set doesn't bother me at all.
- bananaboy 5mo agoThis is amazing, great work! I love it!
- dddddaviddddd 5mo agoEven 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 5mo agoHonestly 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 5mo agoShould i ask my Claude to benchmark it against nginx or will you ask yours
- mappu 5mo agoSyscalls 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 5mo agoYeah, 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.
- not_a9 5mo agoYou could also do a trick some Windows stuff does - parse syscall indices from said dylib.
- maomaoati985 5mo agoYour determination to make this happen was remarkable — and you truly accomplished it. Congratulations
- Ami985 5mo ago[dead]
- Thanemate 5mo agoI'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 5mo agoWhat 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.
- dwedge 5mo agoArtisanal code has a future. Maybe not a high paid one but maybe we go back to roots. if you enjoy programming and were never focused on output or on pipelines, LLM doesn't offer the same ezperience
- noduerme 5mo agoSometime around when wordpress came out, or at least 2005 or so, I started positioning myself as a bespoke web designer, then app developer. Whereas anyone could get a site done, I turned myself to doing things that hadn't been done before, for which standard solutions wouldn't fit. I turned away 80% of jobs and raised my rate from $25 to $100, then to $300/hr. To me, pricing and only doing bespoke work was a defensive measure against falling into a career hole I didn't want to end up in. But mostly it was just that I didn't want to repeat myself or waste my time doing something that a client could already buy off the shelf. 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.
- arrty88 5mo agoLove this so much.
- rdevilla 5mo agoTen 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.
- i_love_retros 5mo agoIt's not just art though. It's human thinking and problem solving and learning that is dying.
- KaseKun 5mo agoI have a (relatively well informed) view that people who aledge that "if you used an llm you did no thinking or problem solving" have never in fact used an a llm to generate anything particular complex. 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.
- i_love_retros 5mo agoKeep telling yourself that if it makes you feel better.
- wewewedxfgdf 5mo agoIt'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.
- nzhsbdb 5mo agoThe result is unimpressive either way -- it's the journey that is exciting for these kinds of projects
- stbev 5mo agoI 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.
- PacificSpecific 5mo agoPlease post your progress! That sounds cool as hell
- stbev 5mo agoThank you! I will keep working on it and post something here
- qingcharles 5mo agoAs in 3D software renderer? I cut my teeth on those throughout my teens and the start of my professional career, in x86 and C. 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): https://imgur.com/a/Dy5rUku https://imgur.com/a/Dy5rUku
- stbev 5mo agoYes, exactly, a 3D software renderer. But the goal is to do (almost) everything from scratch and by hand. No LLMs, no std library, no compilers. Just a few imported math functions (such as sin and cos). Not the same as bare metal programming but close
- MagicMoonlight 5mo agoWhy would you screw yourself like that when it's already a huge project?
- 5mo ago
- dalleh 5mo agoWith 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 5mo agoHmmmm. 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
- imtomt 5mo agoWoah! I honestly feel more intimidated writing a CGI script in assembly than I was writing a server, lol. CGI support has been on my mind for a couple weeks, but I haven't really dug into it yet. I'd love to see yours if it's hosted anywhere! Could be a great reference when I do.
- dragontamer 5mo agoReally? It's a bit of a nonsense that I did so long ago so it's weird to hear someone interested in it... 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
- imtomt 5mo agoAw, that’s too bad. Sounds like it was a really fun project. 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.
- 5mo ago
- vladsiu 5mo ago[dead]
- ankur-ag 5mo ago[dead]
- shevy-java 5mo agoIf it is written in assembly, why is it for MacOS only?
- DavidPiper 5mo agoAssembly 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-specific
- gsliepen 5mo agoAnd 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.
- AppAttestationz 5mo agoI 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..
- asalahli 5mo agoWrong thread?
- paolatauru 5mo ago[dead]
- tgma 5mo agoIf 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.
- imtomt 5mo agoYeah, 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 exact order.
- sureglymop 5mo agoAgreed. And super cool project. After seeing Matt Godbolts Advent of Compiler Optimisations in December I decided to do AoC in assembly. Was the most fun I had in years even though I didn't finish all days! 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.
- wkjagt 5mo ago> "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 https://www.youtube.com/watch?v=y8PLpDgZc0E
- fragmede 5mo agoPascal stores the length of the string next to the string, but the other thing of note is with the advent of Unicode, strlen is strlen, but often not actually the number you need/want.
- behaviors 5mo agoWell done. Been working on a similar smaller project for RISC-V. This is excellent
- imtomt 5mo agoThat's so cool! I would love to see it if you're sharing it anywhere.
- behaviors 5mo agoIt's a HTML browser for Pi Pico2, CLI, meant to support my in-house project running on a mesh of Pico2's. I really wanted to use RISC-V and it needed a webhook that serves a page on PIO wake. We are at the browser is written about 60%. The server is now already handled ;P I found this awesome project someone posted on HN. When I complete my project the browser will be released alongside. You can very likely reproduce it with less than a handful of prompts. One thing I really do believe, ideas are going to be the next open-source. LLM's can make ideas into things.
- matteohorvath 5mo agoIt'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.
- niftynanometer 5mo agoInsane
- idovmamane 5mo ago[dead]
- openclawclub 5mo ago[dead]
- scuff3d 5mo agoThis 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.
- polotics 5mo agodo you know about rwasa? https://2ton.com.au/rwasa/ https://2ton.com.au/rwasa/ ...
- toshikatsu-oga 5mo agoLove 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.
- dennis_jeeves2 5mo agoGet a better f* meaning to life, will you? 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.
- sp9k 5mo agoYou good bro?
- souro26 5mo agoThis looks genuinely great. Well done.
- camel_gopher 5mo agoThe hero we needed
- maniiijiii 5mo agoIts true
- smy_smy 5mo ago[flagged]
- specwiseai 5mo agoThe comment about LLMs writing this is interesting but I think it misses the point. Someone still had to know what to build and why. The assembly knowledge needed to even prompt an LLM correctly for something like this is not trivial. The craft shifted, it did not disappear.
- jcalvinowens 5mo agoThis is fun, thanks for sharing. I have a much more minimalist one for x86 Linux if you want to see what that looks like: https://github.com/jcalvinowens/asmhttpd https://github.com/jcalvinowens/asmhttpd
- imtomt 5mo agoOh wow! Your project was actually really inspiring to me, thank you for making this. I was really impressed reading through it a while back. Is it alright if I add a link to your repo in my README?
- jcalvinowens 5mo agoHow fun! I'm glad it was interesting, please feel free to link to it :)
- sagar6164 5mo ago[dead]
- sen 5mo agoThis is brilliant, I love it. The absolute best projects ever posted here are the ones made for no other reason than “just because I wanted to”.
- imtomt 5mo agoThank you. My favorite reasons for projects are "just because I wanted to" and "because someone told me I shouldn't", and this one ticks both boxes, haha.
- ontouchstart 5mo agoWhat I love most about your project is the super clean Makefile (https://github.com/imtomt/ymawky/blob/main/Makefile https://github.com/imtomt/ymawky/blob/main/Makefile). It is a great template to jump start an ARM64 assembly project. I made a self documented (all the related links are in the file) single makefile (https://gist.github.com/ontouchstart/d3ad8e4d0adf63532303a900b68a9178 https://gist.github.com/ontouchstart/d3ad8e4d0adf63532303a90...) so that anyone can build ymawky from scratch and dig deeper by tinkering.
- ontouchstart 5mo agoThe reason I wrote that compact makefile is that I am at the beginning of a long journey to study the coding style of ngnk (https://news.ycombinator.com/user?id=ngnk https://news.ycombinator.com/user?id=ngnk). 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.
- ksi23 5mo agoWhat was the hardest part, Range header handling or the slowloris mitigations? Both seem like they'd be a nightmare without higher-level state machines.
- imtomt 5mo agoslowloris mititgations actually weren't too bad, just a couple syscalls to setitimer(), sigaction(), and setsockopt(). Range header parsing was awful, so was content length. I'd say all in all, probably Range headers. Just string parsing in general is pretty awful in assembly.
- ksi23 5mo agoThanks for the insight. Yeah, hand - rolling string parsing in assembly sounds like a special kind of punishment. Great work getting through it.