GRiSP 2 – Erlang and Elixir on bare metal
kickstarter.com
kickstarter.com
Erlang's remote RPC, high-quality CRDT libraries, and hot-code loading made it an incredible technology for implementing IoT software product features.
[1] https://medium.com/@Bettio/atomvm-how-to-run-elixir-code-on-...
You can check the official docs: http://erlang.org/doc/efficiency_guide/binaryhandling.html
1: https://github.com/electricshaman/picam/blob/master/README.m...
A good trick is that if you have a full frame from the network, keep a pointer to the full frame. Then decode the header as needed on top. This way, since the frame is full, you are guaranteed that no copy will occur for the frame while you are processing it. Also, the redundancy of the header is likely to be small in overhead with this approach.
About 10 years ago, I did some work in Erlang where I was moving around 16 kilobyte blocks of data. I managed 800mbit at that time on that generation of hardware. The hardware on the board notwithstanding, I think Erlang is much better at handling this nowadays.
As for the structural shaing between nodes: it is possible but only for data which is written very rarely and read quite often. In practice, the copying overhead in typical usage scenarios tend to be much cheaper than what people fear. One reason is that after the copy, you obtain cache locality, though also potential increased cache pressure.
If you want harder real-time, it is usually better to have a specialized kernel handling that, locked to a CPU core, and then have the Erlang system orchestrate work as a control backplane for that kernel.
What kind of signal processing? The computational libraries are somewhat rough. Though the Elixir communities are slowly adding more libraries, like Matrex (https://github.com/versilov/matrex). It’s surprisingly easy to write C and Rust extensions.
Direct hardware access isn't really "bare metal" in the same manner as software running in DOS is not bare-metal. direct-hardware access is provided in both.
#phsycialbooks #FTW
Assuming that I'm not a completely incompetent at programming (which admittedly might be a stretch :) ), would you be open to someone making a PR and adding Joxa or LFE tooling?