6 ms·
Getting started with OpenGL in Elixir
- angersock 10y agoIf anybody needs it, there are at least two 3D libraries for Elixir--graphmath and vector.
- xiaoma 10y agoWhy? Why would one use Elixir for OpenGL?
- Jtsummers 10y ago> I was curious about using OpenGL with Elixir [emphasis added] What other reason do we need? Regarding practical reasons: To stay inside of one language while doing something that would benefit by having a GUI and/or 3d graphics support. Perhaps erlang/elixir aren't the most performant for things like video games, that doesn't mean interesting work can't be done pairing them with OpenGL (or other graphics libraries).
- vvanders 10y agoYeah, it's not a perfect fit but quite a few GUIs these days are built on OpenGL. Also nothing keeping the performance critical stuff being delegated out to a NIF.
- abiox 10y agoperhaps one simply enjoys elixir, or wants to add some opengl features to an existing elixir product, or is simply curious.
- pdpi 10y agoFor what it's worth, there's at least one major 3d project in Erlang: http://www.wings3d.com/ http://www.wings3d.com/
- nilliams 10y agoCool, I used to love Wings 3D (best, free UV mapping capabilities). Never realised it was written in Erlang. I recently subscribed to the excellent Elixir Sips screencast series [0] and there're a bunch of OpenGL episodes there too. [0] http://elixirsips.com/episodes.html http://elixirsips.com/episodes.html
- angersock 10y agoHere'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.
- rdtsc 10y agoIt is easy, it is fun, so why not?