AtomVM
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Alternative Title |
| |
Title of Series | ||
Number of Parts | 490 | |
Author | ||
License | CC Attribution 2.0 Belgium: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/47519 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
00:00
Functional programmingAuthorization
00:09
Erlang distributionTerm (mathematics)Pattern languageScheduling (computing)Concurrency (computer science)CodeImplementationLevel (video gaming)Cartesian coordinate systemFunctional programmingErlang distributionVirtual machineBitPhysical systemServer (computing)Perturbation theoryProcess (computing)Term (mathematics)Pattern languageMicrocontrollerProgramming languageScheduling (computing)Thread (computing)Real-time operating systemSoftwareCodeBytecodeSystem callBookmark (World Wide Web)Software bugUniform resource locatorWritingLink (knot theory)Speech synthesisTable (information)Operating systemConcurrency (computer science)Arithmetic progressionGame controllerInsertion lossComputer animation
03:01
ImplementationErlang distributionMicrocontrollerWritingPortable communications deviceProgramming languageGame controllerProgramming languageLatent heatVirtual machineImplementationBitReal-time operating systemMicrocontrollerCodeComputer animation
04:05
Computing platformCodeComputer hardwareAbstractionMemory managementWritingMathematicsMemory managementSpeicherbereinigungComputer hardwareRight angleSoftware testingProjective planeSoftware developerVirtual machineCodeComputer simulationTerm (mathematics)Process (computing)Programming languageBinary codeMultiplication signCausalityDivision (mathematics)Insertion lossGame controllerErlang distributionAbstractionCommunications protocolPattern languageMicrocontrollerComputer animation
05:22
Programming languageConcurrency (computer science)Scheduling (computing)Binary codeCommunications protocolPattern matchingOperations researchComputer networkErlang distributionRouter (computing)Sanitary sewerCodeLine (geometry)SoftwarePower (physics)Concurrency (computer science)Level (video gaming)Operating systemWeb 2.0Server (computing)Game controllerConnected spaceCommunications protocolOperator (mathematics)Pattern matchingProgramming languageScheduling (computing)MicrocontrollerCausalitySystem callWeb pageWireless LANMatching (graph theory)Boss CorporationPoint (geometry)Pattern languageVirtual machineErlang distribution
07:08
BuildingComponent-based software engineeringService (economics)Software testingCompilation albumSoftware developerGame controllerCompilerComputer hardwareWeb 2.0Flash memoryErlang distributionCodeMicrocontrollerModule (mathematics)
07:55
MultiplicationCore dumpChainComputer hardwareCompilerErlang distributionCodeCore dumpComputer architectureNear-ringTask (computing)Process (computing)Reverse engineeringGame controllerPerturbation theoryDifferent (Kate Ryan album)Software developerErlang distributionCodeCartesian coordinate systemMicrocontrollerWhiteboardBefehlsprozessorComputer animation
09:03
FacebookOpen sourcePoint cloud
Transcript: English(auto-generated)
00:05
Hello, everyone. I'm Davide Bettio. I'm the main author of AtomVM. And yeah, so before starting talking about AtomVM, we are going to talk about Erlang and Elixir.
00:20
So Erlang and Elixir are functional languages that have immutable values and they are called terms. And those languages are usually compiled. But you can also have a wrap, but usually you compile them and you run the bytecode on the Beam Erlang virtual machine.
00:42
So Erlang and Elixir have a lot of really interesting features. Like, one of my favorites is the pattern matching feature that can be done on function heads, but can be done also at bit level. And later I will talk about it. And the virtual machine has a scheduler inside.
01:03
And the scheduler allows to spawn a lot of processes, even thousands of processes on the same machine, but it doesn't use operating system threads. So it allows everyone to write highly concurrent applications without exhausting
01:21
operating system resources, thanks to the scheduler at the virtual machine level. And also the virtual machine is designed to be soft real time and this is a really important feature in microcontrollers. And the language has been designed by Ericsson that was working on phone switches.
01:46
So the whole language and virtual machine is designed to deal with failures because everything can eventually fail. So the main idea is that there are supervisors and the supervisors take care of handling failures in a graceful way.
02:04
Also, Erlang and Elixir have live debugging features, so you can launch an application on a remote server and you cannot attach to it. You can call functions on a running system and you can inspect everything.
02:21
And this is really important and interesting because let's think about XMPP server. You can inspect some kind of failure in the server without disconnecting all the users. And also Erlang and Elixir have hot code reload features, so you can upgrade a running software without stopping what's happening.
02:47
I mean, you can upgrade the phone switch that runs Erlang and Elixir and every phone call that is currently in progress, it's not stopped. And so what is AtomVM? AtomVM is an Erlang VM in virtual machine implementation that runs on microcontrollers.
03:11
We already support SP32 and STM32, and it is quite easy to port it to new microcontrollers because the code is meant to be as simple as possible.
03:27
And it is written nearly in NCC. And also, it's not tied to any specific free RTOS or any other RTOS feature.
03:42
And as I mentioned before, it is a virtual machine, so it is able to run any language that runs on the Beam virtual machine. So we support Erlang, Elixir, LFX, which is a Lisp-like language, and eventually any other language can be executed on the microcontrollers.
04:05
And so one of the interesting... Erlang and Elixir have a lot of interesting features that are really cool for IoT devices. And my favorite feature is that it allows developers to write testable code.
04:21
So the same code can be written on a PC, it can be tested on a PC, and the project might be transferred to the microcontroller without any additional change. This allows to write and test the code really a lot. Also, the Atom VM virtual machine provides some simulators and hardware abstractions that allow developers to
04:45
work and do a lot of debugging on the PC, rather than on the real hardware. And this makes development a really fast process. And it does other interesting features, like all the stack trace are human readable, because as I said
05:02
before, Erlang is built on the terms concept, and every term can be serialized without any additional code. And the language also has a... well, the virtual machine has a garbage collector, and this allows to write code without worrying about memory management.
05:22
And so one of the interesting features are binary protocols handling, thanks to pattern matching, that makes possible to handle a new protocol with really few lines of code. And also, as I said before, the language supports highly concurrent systems that are really important
05:44
also on microcontrollers, because maybe you want to handle GPIOs while you are performing network operations. And also, this empowers users to write asynchronous code in a really easy way. And as I said before, the scheduler is at a virtual machine level, so there is no dependency on the operating system under NERT.
06:06
And so the code for blinking a LED is quite simple, so it's really, really easy for a new user to start writing Elixir code and to deploy it on a microcontroller.
06:22
And also, more advanced stuff can be done. So here is an example that I show how to connect using Erlang to a wireless access point, so they are just a few lines of code and pretty easy. And we can do also more advanced stuff, like running a web server on the microcontroller.
06:46
This is all the code is required. Well, we require also the network connection code, but all the page handling happens here. And again, pattern matching helps us to write all the different pages handling.
07:04
And the only complex thing is building and flashing it to the microcontroller. Right now, the main dependency is the Elixir or the Erlang compiler that is not patched. We are running with standard compilers and tools. We are not shipping any customized compiler.
07:26
And also, the other main dependency is the hardware toolchain, but we are thinking to remove it, because we want to allow developers to deploy code to their microcontrollers using web UI when possible.
07:42
And, well, we have an additional tool here that is PacBeam that allows to pack together all the modules so they can be easily flashed on the flash. So, talking about planned features, we are working on no hardware toolchain.
08:01
So, in the near future, it will be possible to just deploy the application. And we are also working on multi-core support, so all the processes can be spawned on the different cores, because nowadays a lot of microcontrollers have more than one core. And we are also working on distributed Erlang that allow to have on the same board different cores,
08:24
different CPUs that might have different architectures that they can run some Erlang or Elixir tasks that they can communicate like developers already can do with distributed Erlang.
08:41
And one of the features that we are working on are also live updates and hot code swap as well, so developers will be able to refresh the code on the running microcontroller without restarting it. That's all.