3 ms·
I plan on writing a blog post soon to explain it better. The quick summary is that it uses WASI to execute a C program not entirely unlike oldschool CGI, but no
by grose 4y ago
I plan on writing a blog post soon to explain it better. The quick summary is that it uses WASI to execute a C program not entirely unlike oldschool CGI, but now it's inside of a WebAssembly runtime instead of an OS process. It uses command line arguments to send the query and standard output to grab the results. This may become fancier in the future.
You can see the relevant code here: https://github.com/guregu/trealla-go/blob/333645147df083dd26f72518cc9903b1ce9c1721/trealla.go#L119 https://github.com/guregu/trealla-go/blob/333645147df083dd26... that builds up the command line arguments for tpl (the Trealla binary, shoved into the repo as tpl.wasm). The rest of the package is mostly shuffling data around.