[<<][softarch][>>][..]
Thu Apr 12 09:38:42 EDT 2018

Erlang + C

Some sweet spot:

1. Run code in external processes.
2. Use {packet,4}
3. Encode commands as an array of uint32_t with inlined binary
4. Log errors as a stream of arrays of uint32_t
5. Encode larger data structures as mmap() files
6. Use native integer endianness inside messages

In general, make it such that the C code doesn't need to do any memory
allocation, and that it can find its input and output memory in the
form of simple arrays.  Let it log errors to the output stream
terminated by an empty packet.

Do all the preparation of the protocol messages and data structures in
Erlang.

It is surprising how much this can do, letting both languages do what
they are good at:

- C: loops over memory reads and writes

- Erlang: nested data structure manipulation, protocols, providing a
  general framework to implement tests.  I.e. all "bookkeeping".




[Reply][About]
[<<][softarch][>>][..]