4 ms·
Here's why I'm interested. Most modern engines are fighting the fight of how to deal with multiple cores--how to create microtasks that can be scheduled across
by angersock 10y ago
Here's why I'm interested.
Most modern engines are fighting the fight of how to deal with multiple cores--how to create microtasks that can be scheduled across worker cores, how to handle task stealing, how to implement lots of independent actors without bugs, how to do hot-upgrading of code, how to handle networking, and how to do all of this with a user staring at any frame-to-frame inconsistency.
Erlang/OTP and Elixir have those problems decently well solved. It makes sense to cordon off the graphics into just enough C/Rust to get OpenGL up with a scene graph or whatever, and then leave the rest of the game logic in a better language.
The idea of being able to just use thirty years of language research on a pragmatic and simple platform (the Erlang/Elxiir BEAM) is very intriguing.
My next big project in Elixir is probably going to be a proof-of-concept for a physics engine. With that done, everything else is pretty obvious.
If anything can realistically break the death-grip of C/C++ on the industry, this might be it.
- felixgallo 10y agoAs a bona fide erlang head, let me instead suggest that you direct any such efforts at http://www.ponylang.org/ http://www.ponylang.org/ -- in which you can have the actor model, but do low level programming, with high performance, while being as safe as Rust and having (in my personal opinion) better affordances.
- skrebbel 10y agoWhy would you not use Erlang though? Performance?
- angersock 10y agoErlang has a hard cap on how good it'll ever be for raw number crunching. For the moment, it basically will never have good SIMD support--this is because of internal architecture decisions on how the BEAM is implemented. The saving grace that I'm betting on is the scheduler.
- angersock 10y agoAt the risk of sounding brusque, my brief survey of Ponylang at your link doesn't really interest me. I don't really care about type correctness and magic, I don't really need an alternative to Rust, and it still fails to easily solve the "How do I provide strong isolation between my code and the rest of the world?" The fact that the language loudly claims that "Incorrectness is simply not allowed. It's pointless to try to get stuff done if you can't guarantee the result is correct." and then talks about FFI to native C code kinda strikes me as hubris. Erlang/Elixir is more "Hey, fuck it, here's NIFs, but they have clear drawbacks which sometimes are outweighed by benefits" and "Here's ports, which Do The Right Thing if you want to call out to a native application that can explode and not hurt anything else." The other useful bits, networking and whatnot, seem way better developed in the other ecosystem as well.
- felixgallo 10y agoYou're right on all those points. The reason, which I didn't explain enough, that I'd suggest you'd look at pony, is that erlang's scheduler and calculation model are great for routers, but less great when you need to do a bunch of matrix transforms within a 120Hz frame budget. Pony compiles through LLVM and has, e.g., native integer types, so is a little closer to the standard OpenGL user sweet spot, where tons of fast math matters and everything is pretty strongly typed. That said, if you get it working on erlang, so much the better, and good luck whichever way you go, sounds awesome!
- angersock 10y agoAnd thank you for the reference! Like I said, not quite my use case, but I may find a use for it yet. :)
- techdragon 10y agoActor based modelling of physical entities and of "Ai"/NPC behaviour is reason enough I want to explore Erlang/Elixir for a video game engine. I even considered a two binary approach, webGL in an electron app talking to an Erlang/elixir backend "local server" that's distributed with and launched by the electron app. All of that mess was to avoid writing my own physics engine and OpenGL bindings. The Erlang/Elixir ecosystem is woefully under equipped with tools for 3D graphics and/or physics simulation, so I personally welcome anyone's contributions to this area.