Live data from Hacker News

Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

github.com

11–20 of 27 posts

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#12
> written entirely by-hand in ARM64 assembly as a fun project. It's probably got a lot of vulnerabilities I'm unaware of

Impressive, but that second part worries me. I hope one day AI security scans upon commit (or integrated in the IDE) will alleviate that risk.

What's the current security gold standard for web servers? Hiawatha? https://hiawatha.leisink.net/

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#13

> written entirely by-hand in ARM64 assembly as a fun project. It's probably got a lot of vulnerabilities I'm unaware of Impressive, but that second part worries me. I hope one day AI security scans upon commit (or integrated in the IDE) will alleviate that risk. What's the current security gold standard for web servers? Hiawatha? https://hiawatha.leisink.net/

Hiawatha is written in C, and so despite its security posture, it probably contains vulnerabilities.

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#14
post #10

arm64 is an IP-locked ISA, namely it is not worth assembly writting, stick to plain and simple C. RISC-V is. I am self-hosting many of my internet thingies. I plan to move to RISC-V only hardware and to rewrite my internet software directly in mono-threaded paranoid RISC-V assembly.

> arm64 is an IP-locked ISA, namely it is not worth assembly writting

Why is that a problem? Google search returns 3K page arm64 ISA manual. What else do you need to write asm?

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#15
post #3

Cool. I particularly like the O'Reilly book cover that never was. Although I fear you may have misunderstood what wasm is... Question/critique. Isn't getting the mime type by file extension a bit windowsy? Would it not be easier to read the magic number when you're at the assembly level?

You could argue well, if you have to open the file to read it anyway may as well look for magic numbers.

That doesn't work well with text documents which won't have any kind of magic number. So now you're doing some heuristics to determine is this text/plain, text/html, text/svg? You're pretty much just guessing at that point.

A good number of file formats out there are just Zip files with a particular structure. JAR files, docx - so relying on magic numbers doesn't really work for those, either.

Also to service a HEAD request you'd have to open the file and read a few bytes that you just discard.

If you just do it by extensions you don't need to read files at all or perform heuristics, and no ambiguity for what mimetypes to use for text documents, zip-based formats, etc.

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#16
post #14
post #10

arm64 is an IP-locked ISA, namely it is not worth assembly writting, stick to plain and simple C. RISC-V is. I am self-hosting many of my internet thingies. I plan to move to RISC-V only hardware and to rewrite my internet software directly in mono-threaded paranoid RISC-V assembly.

> arm64 is an IP-locked ISA, namely it is not worth assembly writting Why is that a problem? Google search returns 3K page arm64 ISA manual. What else do you need to write asm?

Nothing else, I think what the're more concerned with is how open an architecture is.

I think with RISC-V if you wanted to design your own chips and stuff you can just do it, whereas ARM doesn't let you do that.

I'm not about to build my own chips so it doesn't matter all that much to me but I understand where the person is coming from. They'd rather write assembly for the more open architecture.

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#17
post #9

"raw syscalls only: no libc wrappers" insane! i wonder how many times you have spent to learn about them!

Like one time? It is like any other API. You look it up, study the parameters (in this case you need to look up in which register is what argument expected) and off it goes.

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#18
post #7

I love it :-) Back in the distant past I wrote some really big ARM 32 assembly projects. 64 bit ARM is really very similar! I had a look through the code. Some ENTRY/EXIT macros to help with the drudgery of save restore registers & stack frame would probably help. Also some register renaming would help readability (eg if a register points to incoming data throughout a subroutine rename it pdata). I salute your effort…

RISC OS had some amazing apps written ARM26/32 -- my teenage mind was boggled

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#19
post #7

I love it :-) Back in the distant past I wrote some really big ARM 32 assembly projects. 64 bit ARM is really very similar! I had a look through the code. Some ENTRY/EXIT macros to help with the drudgery of save restore registers & stack frame would probably help. Also some register renaming would help readability (eg if a register points to incoming data throughout a subroutine rename it pdata). I salute your effort…

Thank you! Definitely, some macros would probably be super helpful. Register renaming, too, I'm sure. When I started this project I didn't even know about register renaming lol, and at this point it's so big I'd have to dig pretty deep to find 'em all. Definitely worth doing, though, I'm sure.

Re: Show HN: A pure ARM64 Assembly web server, now on Linux with CGI for no reason

#20

Is an assembly webserver more performant than webservers written in other languages? Are there any hard limits on how much you can squeeze when using a particular framework?

The language matters much less than the architecture of the web server. A server written in assembly using a fork-on-request model like ymawky is going to be much slower than a server written in C using an async event loop like nginx, because forking is very inefficient at scale. Plus a big bottleneck is the networking syscalls, rather than the code itself, so two servers with the same model written in Assembly and C would likely be roughly equal.
Post reply on HN