I’m completely new to Elixir and don’t know Ruby, either.
Is anyone writing GUI applications in Elixir? I don’t know the language and the easiest way for me to learn (not to mention the way I’d primarily be using any language right now) is for desktop applications with a GUI front end - ideally something that will work on both Mac and Linux. What are my choices and how well supported/ integrated are they? In case it matters, I’m specifically interested in writing a distributed business application connecting multiple machines over the internet. From that standpoint, Elixir seems like it might be a good fit. But I need to have a GUI interface and not just in a browser.
I tried to research this question first with a web search and then with a search on this site; I haven’t found any good answers so far.
If you have web development experience, I would recommend Electron. It’s fairly easy to build and distribute a desktop application if you already have experience with web technologies. I wrote an app using Elm and distributed it as an Electron app.
elixir and a server and elm as a frontend is pretty popular right now. I’ve actually started working on something built that way (though I’m not sure if I’m going to use electron, or just the browser).
Wow. I recently been using Atom a bit and have been impressed by it. I never bothered to wonder how they were handling their gui. I guess this is it! A lot of stuff to digest but if Atom is basically using electron (I understand it was formerly called “atom shell”) for its gui then it ought to be good enough! At least I will presume so for now.
I’m intrigued that Elm – another language which I’ve read a bit about but not yet learned – and Elixir are being used together… Does this qualify as a real symbiosis? Are the communities cooperating? I previously would have classified Elm and Elixir as “competitors” in somewhat the same space. I had read something about a project to bring Elm to the server.
Any links or comments on any of these things would be appreciated.
Thanks. It will have a centralized store, of sorts, but not really client-server. The nodes are supposed to maintain their own limited data and keep operating in case of any outage and, later, synchronize. The purpose is to tie together a number of loosely coupled businesses.
No they are not competitors at all - Elm is front end and Elixir is backend. Elm is a HTML/CSS/JS transpilier, I can’t see why they would want it on the server as well, and even if they did, it would be JS - nobody in their right mind would want JS on the server
Yes. I guess I saw that - didn’t read it. Thanks for locating the comment. I figured Elm was at least originally written in Haskell (don’t really know, but figured). So it doesn’t have to stay with HTML/CSS/JS manipulation, right? It’s getting kind of crazy out there. You should see the kind of stuff they’re planning with red-lang. Although not a purely functional language, imo red will upset a few applecarts…to put it mildly.
For GUIs in Elixir you can still use Erlangs wx-module. For this to work, of course, it is necessary that your Erlang release is compiled with wx included.
But for the client side I’d prefer a more lightweight solution that does not pull in a full gigabyte as runtime dependency…
But if you really want to use the same language in the complete applications stack, I heard about a language called haxe which promisses exactly that, but I never tried more than a hello-world, because I#ve no project which could make use of it.
if this is your goal, Elixir is not at all well suited to learn by creating GUIs. All the answers you got above are about actually creating the GUI itself in another language (Elm, JS/HTML/CSS with Electron, Java) not in Elixir. All the above answers are good, but if your stated goal is to learn Elixir by doing GUI programming (non-web), you won’t find much/anything to support that in Elixir itself.
ElixirConf 2017 included a talk about building a UI “natively” in Elixir that is quite exciting to me! (It uses a port to talk to OpenGL via a small C wrapper). I’m looking forward to the code being released so I can play around with it.
Here’s the link to the forum post discussing the talk that @boydm gave at ElixirConf:
I write mostly GUI business apps, and also need a lot of reporting. The Little Elixir & OTP Guidebook states in the intro that Elixir that Elixir & GUI don’t mix, but several presentations at the Elixir Conf, including the Toyota Way seems to indicate that large companies have embraced Elixir for business apps. Am I barking up the wrong tree here?
A corollary question is whether any of you are using reporting tools, and whether you are writing your ORM in Ecto, if I understand that correctly, or in stored procedures. It seems to me that in order for a reporting tool to interact with the data it would have to be outside of Ecto.
There’s a kind of chicken and egg problem here. IMHO, the BEAM would be a pretty awesome GUI app environment, but it doesn’t have a robust interface to the client windowing API. There is the wx interface, but the problem with putting any GUI library in as a NIF is that it can crash the BEAM.
Creating a Port interface to OpenGL is also pretty intriguing. However, I think for Native UI Desktop Apps, Elixir is going to be an uphill battle. There will likely be places where this battle is worthwhile, but I think for most applications the time to delivery penalty will be too great until more of the spadework in library interfaces is available.
What might make more sense is to drive an Elixir app via a GUI wrapper if your underlying problem maps well to what the BEAM does well. (i.e. if your basic problem is “embarrassingly parallel” and I/O limited ) What would scream “Elixir Desktop App” to me is a problem that using the increasing number of cores available on high end desktops would help.
While Elixir will never likely be the fastest on 1 or two cores, once you’ve solved your problem in Elixir it becomes much easier to throw 24 or (128) cores at it and see reasonable speed ups. Right now those kinds of machines are mostly servers, but that level of concurrency will eventually make it’s way into desktop computing.
Kind of late to the party here, but for anyone still interested in this, I’m currently building a phoenix app that I plan to distribute on desktops using webview, seems to be the most simple and straightforward approach.