Live data from Hacker News

AsmBB – a lightweight web forum engine written in assembly language

asmbb.org

21–30 of 131 posts

Re: AsmBB – a lightweight web forum engine written in assembly language

#22
post #14
post #9

Man how do you even connect to a db with assembly code? Are there assembly libraries? In theory I understand it but the monumental amount of effort it would take to write such “simple” things would take so much time

It's less complicated than you might think. You call into SQLite C library functions using C calling conventions. Here's the relevant code: https://asm32.info/fossil/asmbb/file?name=source/sqlite3.asm...

How about for setting up a server and serving http requests / establishing web sockets?

If it’s just a bunch of calling C code then I have to ask which part of this is actually assembly

Re: AsmBB – a lightweight web forum engine written in assembly language

#23
post #14

Earlier quoted context omitted.

It's less complicated than you might think. You call into SQLite C library functions using C calling conventions. Here's the relevant code: https://asm32.info/fossil/asmbb/file?name=source/sqlite3.asm...

How about for setting up a server and serving http requests / establishing web sockets? If it’s just a bunch of calling C code then I have to ask which part of this is actually assembly

To be fair, from that perspective every backend web application in every language is really just "calling C code".

Re: AsmBB – a lightweight web forum engine written in assembly language

#24
post #14

Earlier quoted context omitted.

It's less complicated than you might think. You call into SQLite C library functions using C calling conventions. Here's the relevant code: https://asm32.info/fossil/asmbb/file?name=source/sqlite3.asm...

How about for setting up a server and serving http requests / establishing web sockets? If it’s just a bunch of calling C code then I have to ask which part of this is actually assembly

You can ask the same about e.g. Pascal, Python and Javascript, because all of them just make a bunch of C calls at the end of the day and can’t use NIC ports directly.

Re: AsmBB – a lightweight web forum engine written in assembly language

#25
post #9

Man how do you even connect to a db with assembly code? Are there assembly libraries? In theory I understand it but the monumental amount of effort it would take to write such “simple” things would take so much time

C is generally first compiled into assembly anyways.

When you program in assembly you're basically just doing the job of the compiler, and can call all the same library functions C code can. You just have to follow the calling conventions of the architecture. It's cumbersome and tedious, but nowhere near impossible.

x64 made calling functions more annoying by using registers then spilling over into the stack after exhausting those. x32 was more pleasant by far, since it only used the stack. x64's convention produces faster code though, by keeping stuff in registers.

Re: AsmBB – a lightweight web forum engine written in assembly language

#26
post #19

Reminds me a little of D's official forums, which load faster than you can close your eyes to blink. I love these kind of projects.

Oh yeah it's immediately noticeable. How did they do it? https://forum.dlang.org/

Use a fast language and forget some of the old advice from "12 factor apps," some of which are focused on avoiding common challenges when scaling low-performance platforms.

Re: AsmBB – a lightweight web forum engine written in assembly language

#27

It's not just written in assembly, but it's backed by sqlite. Like many apps, IO is more likely to be the bottleneck than the CPU.

That's often the fallacy people have, assuming that the language is a bottleneck instead of the I/O or database design.

Mind you, I understand it given some of the PHP I've seen. But again, that's not the language per se, but how it's used.

Re: AsmBB – a lightweight web forum engine written in assembly language

#28
post #19

Reminds me a little of D's official forums, which load faster than you can close your eyes to blink. I love these kind of projects.

Oh yeah it's immediately noticeable. How did they do it? https://forum.dlang.org/

D isn’t “big” (as in “reddit big”), and any web-1.0 forum that I remember from 2000s worked like that on old hardware. If you’re curious how a single SQL database can serve so fast, it’s caches and invalidation when a thread CrUDs itself. Old boring tech.

Edit: the tone was a little sharp, edited it out, my apologies

Re: AsmBB – a lightweight web forum engine written in assembly language

#29
Despite being someone who wrote x86 assembly for years on DOS in the 90s before learning C (and even continued in at&t syntax on Linux for some time), I find this to be a silly exercise in time wasting beyond its academic and comedic/entertainment value.
Post reply on HN