8 ms·
GRiSP 2 – Erlang and Elixir on bare metal
- opwieurposiu 8y agoI'm not sure this counts as "bare metal" since it runs in a VM. Though doing it this way is probably cheaper then using an FPGA.
- dnautics 8y agoI'm not 100% sure but I think it's not running on a VM in the virtualization sense; by VM they probably mean BEAM, which is a VM in the same sense that JVM or python are VMs.
- wiml 8y agoI was hoping they'd actually made a bare-metal BEAM implementation like the Lisp and Forth hardware that people have made in the past. This device looks like it's Erlang-on-BEAM-on-RTEMS, which is undoubtedly a more practical and useful thing, but less intriguing.
- peerst 8y agoIts not really „on RTEMS“, its more side by side. RTEMS is not a layer between the BEAM and te hardware its just helping by providing threads, TCP stack and file access. From a Erlang NIF or port driver (thats what we use to access the outside world in Erlang and Elxir) you have direct access to hardware registers and e.g. CPU interrupts.
- deleted 8y ago[deleted]
- TickleSteve 8y agoIf RTEMS is controlling the execution of your code, your running on or in RTEMS. 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.
- e_proxus 8y agoRTEMS isn't "controlling" the execution of the code, it just supplies implementation for OS-specific utilities (effectively the POSIX API). The BEAM VM code is compiled to machine code and runs directly on the CPU. As peerst explained, if you write your own C code in an Erlang port driver for example, you don't have to use RTEMS at all.
- anonymousDan 8y agoIs there the ability to run multiple OS processes or is the BEAM VM the only thing running after boot?
- e_proxus 8y agoYou can only run one process in RTEMS (hence the name The Real-Time Executive for Multiprocessor Systems), however you can simulate other processes via threads. This is how we run the network stack and Wi-Fi configuration tools among other things.
- dnautics 8y agoI've always thought that erlang has a much more natural mapping onto hardware (especially multicore hardware) than lisp.
- peerst 8y agoYes we boot the BEAM on the hardware.
- deleted 8y ago[deleted]
- andrewflnr 8y agoThe distinction between an OS and a language VM is blurry. When the language VM has such robust support for concurrency and IPC, the distinction is, in terms of functionality if not name, pretty much obliterated.
- BubRoss 8y agoIt makes me wonder if anyone has made VMs using the virtualization hardware in modern computers. Nested page tables seem exceptionally useful just as a jumping off point. Maybe the fact that they would still have to use the native instruction set is the limiting factor.
- deleted 8y ago[deleted]
- Ixiaus 8y agoThis is neat, I would have loved to see this a few years ago when I was working on a touchpad dimmer that I used Erlang on (the hardware was originally designed to run Linux so it was easy to put Erlang on there but having a lower-cost solution by not requiring Linux would've been great). Erlang's remote RPC, high-quality CRDT libraries, and hot-code loading made it an incredible technology for implementing IoT software product features.
- elcritch 8y agoThis is great! I haven't tried the boards (yet) but it's difficult to find good industrial ready boards out there. Combine that with the difficulty of handling precise & consistent timing below 1 ms in Linux then these boards are a real gem!
- bloaf 8y agoI'm mildly interested in industrial-ready boards myself, but my industrial-ready means sitting outside in a hot and high-vibration environment doing signal processing. Everything I've heard about Erlang says it would be great at the networking part, but has no- or lousy- libraries for most number crunching applications.
- elcritch 8y agoYou can make even an RPi survive harsher conditions with proper housing. Though it’s easier to work with the RPi compute module for that. 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 https://github.com/versilov/matrex). It’s surprisingly easy to write C and Rust extensions.
- e_proxus 8y agoYou can include other C libraries (and whatever else you can manage to interface towards via Erlang's C driver interface) using NIFs (native implemented functions) and Erlang port drivers. This means it's entirely possible to use Erlang for the networking and coordination part and special code for the signal processing.
- nikofeyn 8y agonational instruments makes the SoM, single-board RIO, and myRIO products. each has an fpga that can be programmed with labview and/or xilinx tools and a cpu running real-time linux that can be programmed with labview or any other toolchain you want to install on the linux portion. comes ready to interact with hardware of course.
- amelius 8y ago
- bobwaycott 8y agoThis is really cool. You can find out more about the project at https://grisp.org https://grisp.org
- tombert 8y agoI wonder if this will support Joxa or Lisp-Flavored-Erlang. Those are pretty much all I use on the Erlang VM nowadays, and I would love to get more into embedded stuff.
- e_proxus 8y agoBecause it is the full Erlang BEAM VM it can run any byte code compiled for it, including Joxa or LFE. However, we only have extra helper tooling for Erlang and Elixir at the moment. You can create a release manually and include any dependencies you want though.
- tombert 8y agoOh!! That's super cool, I think I will contribute then. 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?
- deleted 8y ago[deleted]
- aimatt 8y agoTime to switch to golang. Sorry fellas.
- nikofeyn 8y agohow does this compare to nerves?
- thenewwazoo 8y agoNerves is Linux with an Erlang init(1), built with buildroot, and using sysfs for peripheral I/O. This is BEAM on an RTOS, which makes it effectively bare-metal.
- DoingIsLearning 8y agoWell to be technical an RTOS is not effectively baremetal. But I agree that it is extremely 'close to the metal'.
- ElijahLynn 8y agoLove the bookshelf in the background of Peer Stritzinger's video feed. FreeBSD, UNIX, and a huge row of O'Reilly books on the bottom shelf! I think O'Reilly are some of the best, most thoroughly reviewed technical books out there, I always choose O'Reilly if the topic exists as they seem to vet their authors quite well and make sure they have competent subject matter experts actually write and review the books! #phsycialbooks #FTW