Fl4m3Ph03n1x
Background
I have a little pet project that does some requests to an external site. The logic is pretty much figured out and now I want to do a Desktop app with it.
This desktop app has 2 requirements:
- it needs to be in an executable file that one can run by double clicking.
- it has to work for Linux and Windows.
Options
So, I have made a small research and found 2 main options:
- Make a webapp using PhoenixLiveView and turn it into a desktop app using webengine_kioks. A blog post describing this can be found here (Puddle Of Code - How to Create Desktop Application with Elixir).
- Using Scenic to make a desktop app
The first option looks rather gimmicky. Communication between Phoenix and my app would be done in HTTP and I would have to add some workarounds to make it feel like a desktop app. I would also have to link the Qt library to the release for Linux and Windows.
The second option looks rather promising, but I am not sure on how to use it with mix release, nor how it would work with Windows.
Questions
With this in mind, I have some questions:
- Is there a default way to make desktop apps in Elixir? (If so, what is it?)
- Which of the two options I studied would be the best way to go?
- Is it possible to create an executable that launches the app when I double click it?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hauleth
Scenic do not work well with window resizing due to the nature of their approach to positioning the widgets. This makes it hard to work in non-embedded/non-kiosk solutions where the screen resolution and window size may vary.
Well, OTP ships with WxWidgets integration that is used by built-in projects (Observer) and few external ones (Wings 3D).
Depends on what you mean by “double click”. You can package it for Linux to be installed via system package manager (DPKG/RPM) and on Windows you can create installer with Inno Setup or other tool like that. Then you will provide user with shortcut that will give them “click-to-run” experience by hiding whole complexity. It will also provide you with a way to have nice icon for your application.
Fl4m3Ph03n1x
Isn’t this the same solution Scenic uses behind? Wouldn’t I have the same issue?
So, if I understand, Scenic may have troubles with resizing.
But besides doing my front end in Erlang and using the base WxWidgets library directly, is there an Elixir alternative out there?
NobbZ
Scenic doesn’t have any troubles with resize, as far as I remember it simply doesn’t allow for it.
It expects a fixed size on window/screen creation and sticks to that until destruction of the “window”.
WXWidgets though is a windowing framework on top of the wx framework which works well on Linux if installed in the correct version, but I never even dared to try it on windows.
To be honest, the simplest way is to have a wrapper that ensures the phoenix server beeing started and then opens a browser in “app mode”.
Remember though, you still need to build for Windows and Linux separately, due to the well known “same platform” constraint.
Fl4m3Ph03n1x
Do you know of any libraries or examples that already do this?
You mean, to use
mix releaseon a Windows machine and on a Linux one, right?kokolegorille
Sorry to ask, but what is the advantage of using Elixir versus something like Electron?
Even if I dislike JS and much prefer Elixir, I would choose JS to build a cross compatible application, that looks like a desktop application.
Fl4m3Ph03n1x
Having a self-healing app. Plus the fact that I already have the logic in Elixir and I don;t want to remake it in JS xD
kokolegorille
Ok, that’s fair
crova
Electron also has a reputation for being a memory hogger, I’m not sure if it is still the case.
kokolegorille
That does remember me an old topic…
But I see some advantages, cross compatibility, browser window management, simplicity.
LostKobrakai
So the big difference between e.g. the web and native UI (desktop or mobile) is the factor “browser”.
Small headsup: The following I’m not very knowledgeable in and might not be 100% correct and/or simplified.
For rendering thing to your display you need some OS specific code to send pixels to the graphics card and whatever else is involved in rendering. The second part is a rendering engine. That one takes the code programmers produce and runs it turning it to a bunch of pixel color values x amount of times per seconds.
Browsers being installed on any system do have those parts taken care of and programmers can just ship the “runtime” (html).
Without the browser you need something to talk to the various (or shared) graphics libraries of the target OSs. Things like open_gl (cross platform), metal (mac), vulcan (linux), directx (win). Then you need something, which can take in code and translate to whatever those graphics libraries need. Those are tools like qt, wxwidgets, scenic, flutter, gtk or “browsers” (installed manually or with like an electron app) which can work cross platform, or things like .NET UI libs for windows, swift UI for macs / idevices or whatever linux uses (gtk?).
And that’s only talking about the part of being able to “program ui” and being able to display graphics.
The next part to consider is UI libraries. Just like html has preexisting elements (e.g. form elements, …) the same is true for for UI in desktop apps, but with even more prebuild components, which are often also “higher level”. Each OS comes with one of those, which runs the “OS” itself and is therefore inplemented only in the OS specific tools. The cross platform ones have to implement their own either by creating a “custom” look&feel or trying to mimic native UI per platform or a mixture of both. This also means they’ll unlikely ever be perfect replications of the native UI.
When you’ve chosen for the above then you’ll additionally need to care to run whatever elixir code there is left for you to run cross platform.