4 ms·
I don't think it's cycles, more like newcomers rediscovering the future. I've learned Elixir in 2016 after a lull in my interest in programming languages, and
by sph 1y ago
I don't think it's cycles, more like newcomers rediscovering the future.
I've learned Elixir in 2016 after a lull in my interest in programming languages, and 9 years later it's still my favourite environment by a country mile. It's not the language per se, but the BEAM, the actor model, the immutability — just makes sense, and doing things the C/Rust/Javascript/Python way is like building bridges out of cardboard.
For example, I've stepped into the world of game dev and Godot, which is fantastic and uses a regular object-oriented model. After trying to build a non-trivial desktop app with it, my thoughts are consumed by the fact that mutable state and object orientation is the silliest idea, and I'm speaking as someone that really got into Smalltalk and message-passing objects.
I don't even need actors and OTP, I just want some immutable data structures and functions operating on them. Erlang/Elixir are fantastic to build servers, but there is a sore lack of something closer to the metal within 80% the speed of a native language. I would build an entire operating system out of it. Why has no one put microkernels and Erlang into a blender? I know there's QNX, but it's still UNIX, not Erlang.
- mycall 1y agoWhat about OCAML, does that fill your needs?
- sph 1y agoIt’s perennially in my list of languages to check out. It felt harder when I looked into it 15 years ago. Now that functional programming is second-nature, it should be much easier. Thanks for the reminder.
- ccortes 1y agoI really want to get into ocaml but the syntax is sooo ugly I feel like you need a great IDE set up to be able to be productive with it.
- codr7 1y agoMight want to check out ReasonML.
- svieira 1y agoYou may be one of today's lucky 10K. https://github.com/cloudozer/ling https://github.com/cloudozer/ling Erlang on Xen. But also one of today's unlucky 10K as it hasn't been updated for 10 years.
- jacquesm 1y ago> Why has no one put microkernels and Erlang into a blender? I know there's QNX, but it's still UNIX, not Erlang. That's a very good question. There are some even lesser known dialects out there that do this but you are going to find it hard to get to the same level of feature completeness that Erlang offers out of the box. QNX and Erlang embody quite a few of the same principles, but QNX really tried hard to do this at the OS process level in a way that destroyed a lot of the advantages that doing the same under Erlang would have. I think the main obstacle is the fact that the CPU does not support reductions natively. Maybe you could take it a step further and design an FPGA CPU that implements the core features of Erlang at the hardware level? That would be an absolutely awesome project. Usually when you can think of it someone has already done it so a bit of googling would be a good way to start with that.
- shanemhansen 1y agoYou nerd sniped me a little and I'll admit I'm not 100% sure what a reduction is but I've understood it to be a measurement of work for scheduling purposes. A bit of googling indicates that actually you can use performance monitoring instur to generate an interrupt every n instructions. https://community.intel.com/t5/Software-Tuning-Performance/How-to-generate-the-Performance-monitoring-interrupt-after-every/m-p/1077128 https://community.intel.com/t5/Software-Tuning-Performance/H... Which is part of the solution. Presumably the remainder of the solution is then deciding what to schedule next in a way that matches erlang. Disclaimer: this is based off some googling that makes it seem like hardware support the desired feature exists, not any actual working code.
- jacquesm 1y agoOh that's a really neat find. I'm not sure how 'instructions' map to 'reductions' in the sense that if you stop when a reduction is completed the system is in a fairly well defined state so you can switch context quickly, but when you stop in mid reduction you may have to save a lot more state. The neat thing about the BEAM is that it is effectively a perfect match for Erlang and any tricks like that will almost certainly come with some kind of price tag attached. An interrupt is super expensive compared to a BEAM context switch to another thread of execution, you don't see the kernel at all, it is the perfect balance between cooperative and preemptive multitasking. You can pretend it is the second but under the hood it is the first, the end result is lightning fast context switches. But: great find, I wasn't aware of this at all and it is definitely an intriguing possibility.
- dzonga 1y ago> want some immutable data structures and functions operating on them. Clojure has that for you. plus its jvm which means for your desktop use cases it works. hell with graalvm can be ported to native.
- jacquesm 1y agoI used to think that Clojure was going to be the first FP language that was going to go mainstream but it seems to have fizzled. What went wrong?
- skydhash 1y agoFP language is very hard on novice programmers. You can write thousands of lines of bad javascript/java/python code, but you won’t write ten in FP without the whole thing blowing up. And then there’s the whole evaluation instead of instructions. With FP, you’re always thinking recursively. With imperative, you can coast on a line by line understanding.
- sodapopcan 1y agoIn my experience it's still very possible to write many, many lines lines or utterly shit FP code, but I know what you're saying.
- dzonga 1y agoyeah - without an easy ramp up for beginners most languages / frameworks die. I wish most language / framework designers knew that part. again - another point why not hiring junior developers cz A.I or outsourcing those will cause catastrophic effects in the future.
- gf000 1y ago> What went wrong? Well, we have FP at home. It just got ingrained into pretty much every mainstream language, and most [1] of the wins can be had even when it's applied to certain parts of the code base only. Like, Java has immutable data classes (records), ADTs with pattern matching, etc. As much as I like Clojure, I just don't think Lisps can ever become too mainstream, their readability simply repels too many people (and even though I am okay with reading it, I do think it's less readable than an equivalent Java-style code would be). [1]: I would even argue that a properly mixed pure and (locally) side-effecting code is the happy ground, as they strengthen each other
- lomase 1y agoLets count the number of comercial sucesful released games that don't use mutability or object orientation.... I can't find any.
- simoncion 1y ago> Lets count the number of comercial sucesful released games that don't use mutability or object orientation.... 1) I suspect game engines that Carmack designed towards the end of his career are built in a largely-functional style. He's on record [0] as thinking that writing code in a functional style is generally a good thing to do. 2) Running on the BEAM doesn't mean that you give up mutability. In my experience with Erlang, functions that return updated state are very, very, very common. Similarly, functions that mutate state external to the function [1] are also common... it's rare that a program that has no visible effect on the outside world is useful. It's generally quite a lot easier to understand what your program does when most or nearly all of its functions take input and return output without mutating external state as a side effect. [0] There's some Twitter thread of his that I CBA to find saying -in effect- "Writing in a functional style makes your code much easier to understand. Obviously, if you're writing a video game, you have to pass around pointers for efficiency reasons, but that doesn't preclude writing most of your code in a functional style." [1] Such as in an ETS table, a external database, with a network call to a remote system, or even writing data to disk.
- lomase 1y agoHow many games in Erlang have been released?
- simoncion 1y agoOddly enough, you can write in a functional style in most any programming language. It's true! And (as a fun fact) did you know that Crash Bandicoot, Jax and Daxter, and many other Naughty Dog games were written in Lisp? I expect that more video games sold at retail back in the day were -whether entirely or just in part- written with weird languages and runtimes than we would expect. But, to answer your question: I don't pay much attention to who's doing what in video games, so I don't know for sure. Folks often talk about using Erlang for video game servers, but not so often about video game frontends. I do know that Erlang's said to be a pretty bad fit for -say- 3D video games that require high raw performance. Sections 1.3 and 1.4 of the Erlang FAQ [0][1] provide a decent idea of the sort of things for which it is and is not a good fit. Particularly relevant would be these excerpts: What sort of applications is Erlang particularly suitable for? Distributed, reliable, soft real-time concurrent systems. ... What sort of problems is Erlang not particularly suitable for? ... The most common class of 'less suitable' problems is characterised by performance being a prime requirement *and* constant-factors having a large effect on performance. Typical examples are image processing, signal processing, sorting large volumes of data and low-level protocol termination. ... Most (all?) large systems developed using Erlang make heavy use of C for low-level code, leaving Erlang to manage the parts which tend to be complex in other languages, like controlling systems spread across several machines and implementing complex protocol logic. But you should really read those sections of the FAQ for yourself (while remembering that they were written like twenty years ago). Also relevant is this excerpt from Learn You Some Erlang's introduction chapter in the "Don't drink too much Kool-Aid" section, written in ~2010: [2] Erlang is no silver bullet and will be particularly bad at things like image and signal processing, operating system device drivers, etc. and will shine at things like large software for server use (i.e.: queues, map-reduce), doing some lifting coupled with other languages, higher-level protocol implementation, etc. Areas in the middle will depend on you. You should not necessarily wall yourself in server software with Erlang: there have been cases of people doing unexpected and surprising things. One example is IANO, a robot created by the UNICT team, which uses Erlang for its artificial intelligence and won the silver medal at the 2009 eurobot competition. Another example is Wings 3D, an open source 3D modeler (but not a renderer) written in Erlang and thus cross-platform. Having said that, I play a lot of video games. Based on what I've seen, I expect that most indie video games these days could easily eat the constant factor introduced by using Erlang for coordination. Having said that, with the existence of Unity and Unreal Engine, along with the documentation and assets built for both, why would you? [0] <https://www.erlang.org/faq/introduction#idm27 https://www.erlang.org/faq/introduction#idm27> [1] Those FAQ sections have remained largely unchanged for something like twenty years. Computers have gotten much faster (and the Erlang VM and compiler have gotten much better) over that time, making the "constant factors" introduced by Erlang smaller than they once were. [2] <https://learnyousomeerlang.com/introduction#kool-aid https://learnyousomeerlang.com/introduction#kool-aid>
- pron 1y ago> more like newcomers rediscovering the future. I have nothing but admiration for Erlang, and it is, without a doubt, one of the most inspired languages I've encountered in my career. But when I was at university in the late-ish nineties, they taught us Haskell as "the language of the future." So I guess some languages are forever languages of the future, but they still inspire ideas that shape the actual future. For example, Erlang monitors were one inspiration for our design of Java's structured concurrency construct [1]. If you're interested in another "language of the future" that bears some superficial resemblance to Erlang, I'd invite you to take a look at Esterel (https://en.wikipedia.org/wiki/Esterel https://en.wikipedia.org/wiki/Esterel), another language we were taught at university. [1]: https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html https://docs.oracle.com/en/java/javase/25/docs/api/java.base...
- cultofmetatron 1y ago> but there is a sore lack of something closer to the metal within 80% the speed of a native language. As someone who built an entire startup in elixir, its a good time to bring up that elixir has an excellent interop with rust via rustlr.
- rramadass 1y ago> Why has no one put microkernels and Erlang into a blender? Peer Stritzinger (https://stritzinger.com/ https://stritzinger.com/) the guy behind the GRiSP project (https://www.grisp.org/ https://www.grisp.org/) has integrated Erlang + RTEMS (https://www.rtems.org/ https://www.rtems.org/) for the embedded GRiSP Nano HW (https://www.grisp.org/hardware#grisp-nano-details-section https://www.grisp.org/hardware#grisp-nano-details-section and https://www.grisp.org/blog/posts/2025-06-11-grisp-nano-codebeam-sto https://www.grisp.org/blog/posts/2025-06-11-grisp-nano-codeb...) His HN account with some technical comments - https://news.ycombinator.com/threads?id=peerst https://news.ycombinator.com/threads?id=peerst
- rramadass 1y agoAddendum to above: I just remembered Kry10 OS which runs Erlang/Elixir on seL4 microkernel - https://www.kry10.com/ https://www.kry10.com/ Checkout the technical overview paper at https://www.kry10.com/get-started https://www.kry10.com/get-started Some excellent videos linked to from https://elixirforum.com/t/kry10-a-robust-and-secure-os-for-the-iot-based-on-sel4-and-the-elixir-stack/54003 https://elixirforum.com/t/kry10-a-robust-and-secure-os-for-t... Kry10 Secure Platform - https://www.youtube.com/watch?v=YG5BaoB24eA https://www.youtube.com/watch?v=YG5BaoB24eA The Kry10 Operating System: Security and the BEAM - https://www.youtube.com/watch?v=0ncI0I5uxJ4 https://www.youtube.com/watch?v=0ncI0I5uxJ4 seL4 and BEAM, a match made in Erlang - https://www.youtube.com/watch?v=owmvgUwBlJ0 https://www.youtube.com/watch?v=owmvgUwBlJ0