AsmBB – a lightweight web forum engine written in assembly language
asmbb.org
asmbb.org
> 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.
e.g. "AsmBB focuses on security in its design and reduced reliance on dependencies."
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.
That's the difference between a programmer and a real engineer: an engineer doesn't need any help from dependencies to make his code totally insecure.
First time I hear about technicians writing code.
see jack w. reeves's 'code as design' series, beginning with 'what is software design?' from 01992, for a fuller explanation https://www.developerdotstar.com/mag/articles/reeves_design.... https://www.developerdotstar.com/mag/articles/reeves_origina... https://www.developerdotstar.com/mag/articles/reeves_13years..., and the discussion on wiki https://wiki.c2.com/?TheSourceCodeIsTheDesign=
Unless I totally missed the sarcasm.
not only are they almost never subject to the kinds of security problems we commonly associate with low-level languages like assembly or c (for example, buffer overflows and heap corruption) they also commonly need to run in constant time to prevent timing side-channel information leaks, and while that is not trivial to achieve in any language, it's more feasible in assembly than in c. also, they are commonly a performance bottleneck, and they commonly need kinds of bit manipulations that c is typically slow at, which rewards assembly implementations
openssl in particular contains about 85000 lines of assembly language, mostly embedded in perl files. (it uses perl as a sort of alternative macro assembler)
incidentally those 85000 lines of assembly are about 12% of the total openssl codebase
HTTP is fairly trivial as well; if you're afraid of little things like that, you'll never deliver best-in-class software.
Surely you mean CPUs will have bugs executing Chuck Norris' impeccable assembly code.
He deal with security threats at the source, by tracking down the hacker and kicking them in the head.
Not just any kicks, but roundhouse kicks of course.
in this case, though, they're linking with sqlite, so all that is out the window
as far as i know, though it's a lot simpler than asmbb, httpdito doesn't have any security holes: http://canonical.org/~kragen/sw/dev3/server.s http://canonical.org/~kragen/sw/dev3/httpdito-readme
as 10000truths points out in https://news.ycombinator.com/item?id=38985198, in assembly you don't have to deal with undefined behavior, and that helps a lot. occasionally you have behavior that varies by implementations, but there's no nasal demons, and in particular you can add two unknown integers without even hitting implementation-defined behavior. and, in theory, you can never guarantee that a c program won't overflow its stack, and i've had this happen in practice on arduino, where it collided with the heap. and signedness bugs (which are commonly security holes; even qmail had one) are plausibly easier to avoid in assembly than in c, though recent compiler versions help with that
Chuck Norris is a martial artist that had an acting career. He got a second wind of fame when he became a meme… Chuck Norris Facts. https://en.wikipedia.org/wiki/Chuck_Norris_facts
I have been researching, off and on, distributed forums. As forums like the one created here became the "go to" after Usenet fell out of favor I have thought a replacement would have both the distribution/replication features of Usenet and the user experience of phpBB (the grandparent of most forum software).
Making it distributed, and eventually consistent, is an excellent distributed systems challenge. So it is kind of like relaxing to a puzzle. If you, gentle reader, have written something along those lines I'd love to have a look.
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 + MAP_ANONYMOUS initializes it to 0 as expected. Accessing unmapped memory in your address space (including address 0) triggers a SIGSEGV as expected. Your assembler makes much fewer assumptions than your C compiler and doesn't try to be half as clever, so it's more likely to crash and burn on error instead of silently subverting your expectations.
Being a C++ developer requires discipline, and that's why hiring is much more selective and specialized.
In the same way children are expected to respect fire :-P
"This footgun is safer than a footknife!"
In theory I understand it but the monumental amount of effort it would take to write such “simple” things would take so much time
If it’s just a bunch of calling C code then I have to ask which part of this is actually assembly
The C# code you write (and majority of the your code's dependencies) are JIT compiled to native machine code (or more recently there are AOT compilation options).
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.
You can certainly write your own TCP/IP stack with raw sockets and directly interface with the NIC, if you like. But at that point you're both reinventing the wheel and bypassing the entirety of the OS, you might as well just write a forum exokernel.
Most developers don't consider utilizing a library in another language as "cheating". Popular and core Rust, D, C++, Python, nodeJS, etc libraries do this all the time.
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.
Maybe I misunderstand you, but this is completely dependent on compiler, operating system etc, there are multiple calling conventions for x86-32, eg. cdecl, fastcall ...
> Argument words are pushed onto the stack in reverse order (that is, the
> rightmost argument in C call syntax has the highest address), preserving the
> stack’s word alignment. All incoming arguments appear on the stack, resid-
> ing in the stack frame of the caller.
Both links were found @ https://wiki.osdev.org/System_V_ABII don't think that's right. C is compiled into an intermediate representation first. It's true that you can ask GCC etc. to generate assembly output, but it's not the default.
Just because there's an IR within the compiler doesn't mean there's no "assemble" stage. What do you think the "-pipe" flag to gcc is for? It pipes the compiler output into the assembler, rather than using a temporary .s file.
gcc has four main stages going from source to executable: preprocessor->compiler->assembler->linker.
Edit, for your convenience, gcc -save-temps example:
> [user@host /tmp/foo]$ ls
> f.c
> [user@host /tmp/foo]$ cat f.c
> #include <stdio.h>
>
> int main(int argc, char **argv)
> {
> puts("Hello world!");
>
> return 0;
> }
> [user@host /tmp/foo]$ gcc -o f -save-temps f.c
> [user@host /tmp/foo]$ ls -l
> total 48
> -rwxr-xr-x 1 user user 15416 Jan 13 16:50 f
> -rw-r--r-- 1 user user 91 Jan 13 16:49 f.c
> -rw-r--r-- 1 user user 17145 Jan 13 16:50 f.i
> -rw-r--r-- 1 user user 1496 Jan 13 16:50 f.o
> -rw-r--r-- 1 user user 515 Jan 13 16:50 f.s
> [user@host /tmp/foo]$ cat f.s
> .file "f.c"
> .text
> .section .rodata
> .LC0:
> .string "Hello world!"
> .text
> .globl main
> .type main, @function
> main:
> .LFB0:
> .cfi_startproc
> pushq %rbp
> .cfi_def_cfa_offset 16
> .cfi_offset 6, -16
> movq %rsp, %rbp
> .cfi_def_cfa_register 6
> subq $16, %rsp
> movl %edi, -4(%rbp)
> movq %rsi, -16(%rbp)
> leaq .LC0(%rip), %rax
> movq %rax, %rdi
> call puts@PLT
> movl $0, %eax
> leave
> .cfi_def_cfa 7, 8
> ret
> .cfi_endproc
> .LFE0:
> .size main, .-main
> .ident "GCC: (GNU) 13.1.1 20230429"
> .section .note.GNU-stack,"",@progbits
> [user@host /tmp/foo]$ ./f
> Hello world!
> [user@host /tmp/foo]$
>it's so little used that i can't find the abi documentation, but gcc -c -mx32 does seem to generate code that passes arguments in registers, not on the stack, contrary to your assertion
edit: after enough digging, i found https://web.archive.org/web/20130902094821/https://sites.goo... linking to https://web.archive.org/web/20201015005434/https://3263a7b2-... but x32-abi-1.0.pdf seems to be missing from the archive and https://web.archive.org/web/*/https://sites.google.com/site/...* doesn't look at all promising
Splitting hairs perhaps, but the C compiler output is machine code, right? No reason to generate assembly along the way.
> Splitting hairs
> > generally
smh
https://en.wikipedia.org/wiki/Compiler#Three-stage_compiler_...
That’s the one trouble w/ AsmBB that it is specific to some particular architecture.
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.
I wish it would go into greater detail here. I’m unclear what “really native” implies, as opposed to some sort of “kind of native” way?
function formatEmoji(text) {
var emojiRegEx = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g;
return text.replace(emojiRegEx, '<span class="emoji"><span>$1</span></span>');
}
This probably meant to catch U+00A9, U+00AE, U+2000..3300 and U+1F000..1FBFF, which is by itself too broad, but also the regex itself is not a faithful translation. (If anyone is wondering the correct solution, just use emoji-regex [1] or more recent `/\p{RGI_Emoji}/v` pattern [2].)[1] https://unpkg.com/browse/emoji-regex/index.js
[2] https://caniuse.com/mdn-javascript_builtins_regexp_unicodese...
On a side note, showing a list of forum users to someone who isn’t logged in is probably a bad idea. Is it something configurable?
But getting a notification when unregistered guests click into a thread doesn't seem useful to anyone.
"x86 asm" and "on linux" are combined not larger than than "assembly language".
Edit: the tone was a little sharp, edited it out, my apologies
How hard would it be to add ARM support?
We don't have any $7/unikernel offerings out there at all. We do have a desktop app that costs $7.
As for your other comment - one of the really awesome things about unikernels is that you don't have to roll your own infrastructure.
The way these are made is that all the infrastructure management is pushed onto the cloud of choice.
I'd highly encourage you to if you haven't to download https://ops.city and try to deploy something to GCP or AWS or wherever - it's free and would answer a lot of questions/assumptions you might have.
Won't run on nearlyfreespeech.net hosting
I love this as it expresses how I feel about JavaScript :P