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
. 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 ![]()
Most Liked
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
Please name some. SwiftUI is proprietary and single platform. so is Flutter. Web is not perfect but it is the best we got.







