6 ms·
AtomVM, the Erlang virtual machine for IoT devices
- amelius 1y agoConsidering that Erlang originated in the telecom world, I find it a bit odd that mobile development options are lacking. Anything to be expected in that space?
- signa11 1y ago> … bit odd that mobile development options are lacking what do you mean by that? can you please elaborate ? thanks !
- amelius 1y agoI mean tools to run Erlang apps on iOS and Android, for example.
- dlahoda 1y agogui is single(immediate mode) or two(graph based) threaded. with some async going to backend or some app defined compute bounded. there is no need for actors nor green threads. no need for erlang nor go. languages were not designed for gui(unlike js or csharp), will need a lot of boilerplate for trivial patterns.
- signa11 1y agoi see ok. well, erlang is more suited to program gateway nodes in the core of 3g/4g networks. these nodes handle tasks such as handling mobility (managing handovers as cell phones moves from one location to another etc), data transfer f.e providing ip addresses to your phones etc etc. as you can imagine, this sort of gear lives deep within service providers network, and each entity handles hundreds of thousands of sessions f.e serving an entire state etc etc. and these nodes cannot go down taking services/sessions with them.
- lawik 1y agoIt has been done. https://github.com/elixir-desktop/desktop https://github.com/elixir-desktop/desktop And a different variant driven by the server typically: https://github.com/liveview-native/live_view_native https://github.com/liveview-native/live_view_native Not to say it is particularly ideal. But it exists.
- cess11 1y agoErlang (and Elixir and so on) run fine under Termux. Just slap on Phoenix or something and have your GUI in the phone browser if that's your thing. People that have succumbed to Apple tell me they have facilities at least as good as Termux so you can probably do something similar there.
- ramchip 1y agoThe massive concurrency and fault isolation properties are very nice for telephony switches (and web servers etc.) but not usually super relevant for phone apps.
- AlphaWeaver 1y agoErlang's use in the telecom sphere has primarily been focused on switching, routing, and real time voice processing on the backend. Beyond just handling cellular traffic, many internet switches are written in Erlang too. It's only recently that Erlang has been used for more of the type of code that could run on the frontend. (The niceness of writing Elixir is a big part of that too.) The primary blocker to running Erlang on mobile has been the lack of portability of the BEAM VM itself, which is why this project is so exciting!
- johnnyjeans 1y agoThe compiler and the binaries it produces run fine on Android and Linux phones.
- patmorgan23 1y agoWhy would a programing language built around accepting and dealing with millions of connections, and used in base stations, routing, and switching be useful for a mobile device?
- amelius 1y agoUniformity of language between back and front-end, and communication layers?
- bastawhiz 1y agoBecause the apps on my phone need to be written in the same language as the network devices my carrier runs? What?
- amelius 1y agoThat's taking it to its extreme (unnecessary as your carrier is a different company), but consider building an application like Telegram or WhatsApp, then it would certainly be nice to use one language for everything, from front-end, back-end to distributed computing stuff.
- victorbjorklund 1y agoWhy? For a small one person team? Sure it would be nice to write everything in one language in one repo. For a large company with lots of developers? Makes less sense. Better use the best tools for the tasks.
- bastawhiz 1y agoWhy though? Why would you want your UI code in Python, as an example? Python has nothing in its standard library to help make websites. Tools like PyScript might give you the DOM, but suddenly you'll be using shims for all the other stuff you need, like resize handlers or fetch() or Intl.NumberFormat or anything else you care about. Web apps are JavaScript. Android apps run on a JVM. iOS apps are whatever can compile to native code and use Apple's APIs. When you avoid the runtime of the language that you're expected to build for on a platform, you'll inevitably spent most of your time working just to get a handful of features that you need from the runtime into the language you're choosing to use.
- mrbluecoat 1y agoReally incredible to see the proliferation of micro-VM tools lately. Here's one from just yesterday: https://news.ycombinator.com/item?id=44135977 https://news.ycombinator.com/item?id=44135977
- lawik 1y agoThis one has been around for a good chunk of years. Recent bonus activity as it is seeing more exploration by the Elixir community right now as a wasm target.
- cyberpunk 1y agoDoes this target smaller devices than nerves? Or just an alternative?
- nesarkvechnep 1y agoSmaller devices.
- cyberpunk 1y agoThere's also https://www.grisp.org https://www.grisp.org which looks quite similar if a bit more mature
- lawik 1y agoGRiSP serms to typically hit inbetween Nerves and AtomVM. Grisp have explored some really constrained hardware compared to the typical Nerves device. AtomVM is to my knowledge a lot of steps further down since they run a much lighter VM than the BEAM. It is also much less proven though. Nerves, Grisp and AtomVM all do some of the same things. They make some different trade-offs. Heck, Kry10 (proprietary but targets critical infra) even sort of approaches the same thing. Running Erlang/Elixir for resilient embedded systems. I am on the Nerves team so you can guess my preference. But all are cool. And we all talk to each other. AtomVM is the most obvious complement to Nerves since they target different device classes.
- lsllc 1y agoThis is really incredible, the esp32 examples are really straightforward compared to the C versions of the same. The Erlang actor model makes this much easier! ... if they can nail the OTA updates and hot-loading of code!
- winford 1y agoWe have most of the groundwork done for OTA updates. We should have some APIs together in the near future. Hot-loading will be more work, but that should be possible after OTA is ready.
- throwaway81523 1y agoAny chance of a port to the Raspberry Pi Pico 2? It has 520K of ram iirc. The original Pico had half that.
- revskill 1y agoWhy did people reinvent the wheel with JVM while there's already Erlang VM ? Java did poisionate so much generations of people.
- uasi 1y agoJVM predates BEAM.
- pjmlp 1y agoBytecode based runtimes and compiler toolchains predate both, and Erlang came to life in 1986, a couple of years until Oak.
- cess11 1y agoJava is ten years younger than Erlang. When Java was marketed into the new hot thing in 1996-1997 Erlang was widely used within Ericsson, and in 1997-1998 someone in Ericsson had swallowed the Sun bait and forced the start of a transition to Java. Joe Armstrong and others went to management and convinced them that since Erlang was now useless it should be released as free software, and it surprisingly was. Which meant that some of them promptly resigned from their jobs and started a company doing freedom Erlang. It took until 2005 or so for Ericsson to confess that they had made a mistake in trying to Java all the things and got around to using Erlang again.
- lioeters 1y ago> it took until 2005 or so for Ericsson to confess that they had made a mistake Impressive that someone was able to make that call and accept the situation, after investing half a decade moving to Java. Also says something about the staying power of Erlang and its paradigm, that the company was able to re-adopt it again.
- cess11 1y agoWell, the IT bubble had burst and Sun was basically two thirds down the sewer at the time. Re-adopting something you had built and proven in the early days of cell phones probably looked like very reasonable risk management. They kept using Java for some things, of course.
- doawoo 1y agoAtomVM is super fun to prototype MCU projects with. It’s what I tend to reach for over micropython etc. For beefier machines that have SoCs it’s Nerves usually. And recently a project called Popcorn uses the AtomVM to run BEAM VM code in the browser! Super neat seeing more places to deploy Elixir and Erlang :)
- svapnil 1y agoWhat's a usecase for this that actually makes sense? Why does Erlang need to run on IoT devices? The main usecases of Erlang I know of are suitable for beefy machines. Source: former Erlang engineer
- johnnyjeans 1y agoWhy not? Erlang encourages the same kind of really flexible actor-driven architecture that Smalltalk did. It's a nice programming paradigm that's more general than you think, and the hornclause syntax is really, really nice. Very pleasant to use like this.
- sph 1y agoSmalltalk had nothing to do with actors. It was largely a single core system.
- ninetyninenine 1y agoI don’t know about small talk but a single core system is orthogonal to a highly concurrent system which actors represent.
- sph 1y agoDoesn’t change the fact that Smalltalk wasn’t actor-based nor highly concurrent, which is what we are talking about here. https://news.ycombinator.com/item?id=18333234 https://news.ycombinator.com/item?id=18333234
- johnnyjeans 1y agoNumber of cores on a system has nothing to do with it. If you sat down and wrote a few thousand lines of code in both of these languages, the natural architecture presents itself the same way. Erlang has "nothing to do with" actors either. But this language is de facto the standard way to refer to this kind of message-centric architecture. The largest influencers of the actor model are simula and smalltalk. Denying the relationship is beyond absurdity.
- thruflo 1y agoThis is the VM behind Popcorn https://github.com/software-mansion/popcorn https://github.com/software-mansion/popcorn, a project aiming to run OTP and Elixir in WASM: > Popcorn is a library that allows you to run client-side Elixir in browsers, with Javascript interoperability Recent ElixirConf keynote introducing it: https://youtu.be/ep--rQO1FRI https://youtu.be/ep--rQO1FRI
- curtisszmania 1y ago[dead]