A tiny Erlang VM for microcontrollers
On Fri, Jul 21, 2017 at 5:22 PM, Fred Dushin wrote:
> ... how hard it would [it] be to port a very small subset of
> Erlang to FreeRTOS, so that it could be run on cheap
> micro-controllers like the ... ESP32
You’d need to totally redesign the instruction set … and make a tiny emulator and throw away all the BIFS (in C) - when you’d done this it would no longer be Erlang.
$2.50 Ali Express
w/5v micro-USB/UART adapter
spawn
, spawn_link
, !
, receive
gen_tcp
, gen_udp
Memory (i.e., RAM)!
mmap
tricks(Try scanning it!)
#{
esp32_free_heap_size => 242188,
procs => [
#{ heap_size => 16,
memory => 472,
message_queue_len => 0,
proc => <0.2.0>,
stack_size => 5},
#{ heap_size => 21,
memory => 556,
message_queue_len => 0,
proc => <0.1.0>,
stack_size => 14}
]}
%% rebar.config
{plugins, [
{atomvm_rebar3_plugin, "0.2.0"}
]}.
shell$ rebar3 esp32_flash --port /dev/tty.usbserial-01