salient-lang / salient

http://salient-lang.dev/
MIT License
0 stars 0 forks source link

HTTP Ping Benchmark #14

Closed AjaniBilby closed 4 months ago

AjaniBilby commented 5 months ago

Creating our first basic benchmark test ./benchmark/http-ping/single-threaded.sa. This test starts a tcp server on a single thread and waits for incomming http requests and responds with the same http response every time.

This benchmark will have no error handling at all, and will assume that no errors are thrown by any of the calls to make this primative benchmark viable in the current state of the langauge

AjaniBilby commented 5 months ago

Requires both #13 and #15 to be implemented before this can even be attempted to compile

AjaniBilby commented 4 months ago

It's kinda scuffed, because there is no borrow checking I can't lend an integer, so intead I parse a struct with only an integer as it's attribute, effectively making a scuffed pointer. This only works because currently structs aren't consumed on use.

Also there are no for loops, so using tailcall recusion to solve that, but wasmer doesn't support tail call... So I'm just doing regular recursion.

And yes it all works!