by z3t4 · 7y ago · 0 comments
Could you please elaborate on that?
There are wrappers for libevent which I've used for the network side of long running server side programs in ATS in this manner.
With regards to "Does it compile to JS", the answer is yes. There are backends for different languages, JS being one of them. There's also PHP and Erlang backends IIRC.
It's misleading. ATS is basically a C frontend. If you looked at the ATS implementations in the benchmarks game, it was basically C code. The C implementations usually beat the C++ implementations in the benchmarks game.
That's probably why it got removed.
The story that icc generates faster code has been a myth for a long time.
Or is there another compiler that you have in mind?
Many HPC centers happen to believe on the icc myth.
Although my point was not to mix languages with implementations.
I’ve no idea if it has a “native” network library. I doubt it has many other libraries but one can call C functions so one can use any library if one wants.
When you're writing provably-correct "error kernels"[1] for your software, you probably want as little interaction with the OS to happen inside the kernel as possible. Write the rest of your program in a glue language, then hand off to the proven-correct error kernel for the hot loop. Probably over stdio, or transactional SHM IPC, or any other mechanism like that that has as little failure-surface as you can get away with.
[1] https://medium.com/@jlouis666/error-kernels-9ad991200abd
At least this breaks the deadlock and in the future those libraries might be replaced with ATS alternatives.
It's pretty easy to use C code for libraries.
I haven't use the ATS -> JS compiler myself but I know it exists. Though given that ATS was designed for kernel programming, I'm not sure you'd want to do that.
> I would like to see some more real life examples
There are some very nice examples, though they tend to be lower-level so things like type-safe channels.