victorolinasc

victorolinasc

Phoenix frontend without the HTML stack?

The Elixir community and more specifically the Phoenix community have always been involved with some form of frontend development. Initially through server side rendered HTML/CSS/JS directly in Phoenix, passing through some native integrations like Scenic and recently through LiveView Native project. There are also many geared towards the embedded landscape that I am not familiar with…

The main target for Elixir frontend is usually the traditional web (HTML/CSS/JS, DOM model and so on). The platform is awesome for building web apps with easy to add real time capabilities using websockets/server sent events and so on.

The problem, in my opinion, is that the world of 2D GUI applications is trying harder and harder to move away from DOM and web specific architectures. Nonetheless, I think the Elixir community is going on the opposite direction… I’ve seen José’s talk about performance optimizations for LiveView which are now in the process of optimizing because we know we handle HTML/CSS/JS, recent LiveViewNative posts about transliterating HTML to SwiftUI and some other solutions…

In my humble opinion, HTML/CSS/JS is a horrible paradigm for 2D applications. More modern and functional approaches have been developed. Most of them use some kind of DSL to express view trees and interactions (QML, Jetpack compose, SwiftUI, etc, etc). Our approach in Elixir-land has been to re-use HTML and HTML based approaches (like tag based components) to drive UI even though the language is perfect for DSLs.

Also, most of the modern ones favor immutable data components for the view tree and need to invent some kind of message passing for handling events or interactions and Elixir is perfect for that.

Also again, many toolkits are now using compute runtimes to make it possible to use GPUs seamlessly. Nx is here just for that :slight_smile: . We seem to be heading in an awesome direction here too.

Also the third time, many applications are using a client/server architecture to provide “concurrent users” like Zed, Lapce (both code editors but full 2D GUI applications). Everything is a CRDT in Zed (from its docs) and we have CRDTs in Phoenix Presence since the beginning…

I guess that what I am trying to say is that from an outside perspective we are betting on the web. It seems we either have something special for keeping the HTML model and make it work better as a frontend toolkit or we are not actually agreeing these seem more modern and better at all.

I have a deep respect for everything the community is building on top of the HTML stack and it is absolutely awesome to see it running in things like LiveBook and so on. I feel confident to say we have the best SSR web framework possible. I just think that maybe we are still far away from the full potential of the BEAM/Elixir for a cross platform 2D application solution. Some more steps will be needed here.

What do you people think about it?

P.S.: One excellent post about frontend architectures and how different approaches can be achieved recently is this one from Ralph Levien in the Rust community. It is naturally more geared towards the Rust ecosystem but it is a nice read overall.

Have a nice day you all :slight_smile:

Most Liked

thomas.fortes

thomas.fortes

Is it really though? Yeah, there are the frameworks that you refered to, but they aren’t web focused, qml is mostly used embedded and jetpack compose and swiftui mostly mobile (and backed by two trillion dollar companies that have control over the platforms where they are used), and as such they have a different set of constraints than the web, but for the web all I see are experiments and DSLs that in the end are compiled to html+js+css.

The parts about client server UIs in desktop land in my opinion in the same area, desktop software have a different set of constraints than the web.

Elixir isn’t betting on the web, but I think that the phoenix framework is betting on the web, it is (aside from liveview native and desktop) mainly a web framework and has to work with the constraints of the web, which at the moment are HTML, CSS and Javascript, all the abstractions will have to run as html+js+css and work with the DOM anyway.

So, what I think is that I’m a big fan of the small “magic” of the framework, I don’t think another abstraction would do any good for adoption or even development, quite the opposite, it would create an even bigger barrier for adoption.

What we have on the web is far from perfect, but I don’t think it is something that should be the focus of the community, otherwise it would be even more niche than it already is.

derek-zhou

derek-zhou

I am keeping my eyes on slint, which matches your description (DSL based 2D GUI). It should be possible to use Elixir for the data layer and business logic and Rust for the presentation layer.

derek-zhou

derek-zhou

Please name some. SwiftUI is proprietary and single platform. so is Flutter. Web is not perfect but it is the best we got.

Where Next?

Popular in Discussions Top

lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 13898 124
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39247 209
New
nburkley
AWS re:Invent is on at the moment with some interesting announcements. One new feature in particular is the Lambda Runtime API for AWS La...
New
Ankhers
Just a little information upfront. Generally speaking, if I feel like I need to either break a pipe chain or use an anonymous function in...
New
axelson
Decided against including more info in the title, but the gist is that Plataformatec sponsored projects will continue with the assets bei...
New
mmport80
I have put far too much effort into Dialyzer over the last year or so - and basically - I doubt it’s worth the effort. It’s not as easy ...
New
wmnnd
The Go vs Elixir thread got me thinking: Would it be too hard to implement a simple mechanism for creating Go-style static app binaries f...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
paulanthonywilson
I like Umbrella projects and pretty much always use them for personal Elixir stuff, especially Nerves things. But I don’t think this is ...
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30840 112
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement