Live data from Hacker News

AsmBB – a lightweight web forum engine written in assembly language

asmbb.org

51–60 of 131 posts

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

#51
post #37

This is super cool, though I very much doubt the following statement: > AsmBB is very secure web application, because of the internal design and the reduced dependencies. There's a lot of value in using well tested dependencies, and even Chuck Norris will have bugs writing complex software in assembly. Especially when doing string manipulation which this project should be doing a lot of.

I disagree; dependencies are more of a liability than anything else.

I can see this maybe being true in a high level language (depending on the dependency), though it's definitely not the case with assembly.

OpenSSL, for example, was hit with quite a few serious bugs over the years, and I'd still choose using it than my own SSL implementation. Especially in assembly.

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

#53

Earlier quoted context omitted.

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".

That's overly simplistic and untrue. If you write a C# / .Net program you're not "just calling C code", you're not calling C at all.

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

#54
post #37

This is super cool, though I very much doubt the following statement: > AsmBB is very secure web application, because of the internal design and the reduced dependencies. There's a lot of value in using well tested dependencies, and even Chuck Norris will have bugs writing complex software in assembly. Especially when doing string manipulation which this project should be doing a lot of.

> even Chuck Norris will have bugs writing complex software in assembly.

Surely you mean CPUs will have bugs executing Chuck Norris' impeccable assembly code.

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

#55

Earlier quoted context omitted.

> Of course assembly language has zero memory safety or other guarantees which probabilistically increases risk. I can't say if I think they balance out one way or the other. I would posit that assembly + Linux kernel ABI is safer than the traditional C/C++ stack because they are not littered with nearly as much "undefined behavior". Signed arithmetic overflows and underflows as expected. Memory allocation with mmap…

This isn't a problem in practice because C++ developers are expected to know the rules of their language and respect them.

I think you meant "in theory" instead of "in practice" :)

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

#57
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 do this in assembler you write raw syscalls to bind to open the TCP stream and then accept to handle incoming connections, possibly with fork or clone3 to spawn a process/thread to handle the new connection. None of that requires C programming. HTTP is "just" some text parsing on top of read/write calls to the file descriptor returned by accept. Web sockets are "just" some connection logic on top of HTTP.

A basic implementation of that is totally possible in assembly with no calls to c libraries. Would even be a great project for people to learn some systems programming. Keep in mind, all of these protocols (except maybe web sockets) were designed when programming in assembler was common. There's probably some HTTP implementation in the wild doing the same thing.

That said there's a lot of reasons you probably don't want to do that, HTTP can be subtle and you probably don't want to be doing raw clone3 calls to spawn threads, if you want to be doing thread or process per connection in the first place.

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

#58
post #55

Earlier quoted context omitted.

This isn't a problem in practice because C++ developers are expected to know the rules of their language and respect them.

I think you meant "in theory" instead of "in practice" :)

I think it was meant sarcastically

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

#60
post #37

This is super cool, though I very much doubt the following statement: > AsmBB is very secure web application, because of the internal design and the reduced dependencies. There's a lot of value in using well tested dependencies, and even Chuck Norris will have bugs writing complex software in assembly. Especially when doing string manipulation which this project should be doing a lot of.

When Chuck Norris writes complex software in assembly, bugs apologize to Chuck for letting themselves getting carried away, fix their erratic behavior, and promise to never let that happen again.
Post reply on HN