3 ms·
Erlang is written in a ton of quite readable C and assembly. If you like delving into the internals of advanced software, it's well worth a read. Take the HiPe
by smegel 10y ago
Erlang is written in a ton of quite readable C and assembly. If you like delving into the internals of advanced software, it's well worth a read. Take the HiPe compiler for example:
https://github.com/erlang/otp/tree/OTP-19.0/erts/emulator/hipe https://github.com/erlang/otp/tree/OTP-19.0/erts/emulator/hi...
It deals with running native and interpreted program code together, just reading the comments gives you a feel for the kind of low level concepts that go into making such an interpreter. I like this one:
/*
* Native code calls an emulated-mode closure via a stub defined below.
*
* The closure is appended as the last actual parameter, and parameters
* beyond the first few passed in registers are pushed onto the stack in
* left-to-right order.
* Hence, the location of the closure parameter only depends on the number
* of parameters in registers, not the total number of parameters.
*/
- jbandela1 10y agoLooks like it has gotten a lot better than "Now for the tricky bit" days. See https://youtu.be/lKXe3HUG2l4?t=640 https://youtu.be/lKXe3HUG2l4?t=640