News for hackers. Stuff that matters.
Re:Lumen – Elixir and Erlang in the Browser by hopia on Friday January 24, 2020 @10:27AM (#22139034)
Am I understanding this right that it's actually implementing the actor model just like Erlang? It seems to have processes and you can send them messages.

The threads seem really lightweight, but how would some typical frontend benefit from this?

Re:Lumen – Elixir and Erlang in the Browser by bcardarella on Friday January 24, 2020 @10:31AM (#22139077)
> how would some typical frontend benefit from this

At ElixirConf I built a simple supervisor DOM tree model. When we are ready to implement it for real we're going to experiment with mapping the DOM to a supervisor. Each node being an element. This way events and rendering take place in each node in the supervisor tree. Rendering would be diff based and merged its way back up. Events would be captured as messages in the idiomatic Erlang/Elixir way.

This is all guess work right now and we don't yet know what will be practical vs what sounds good in theory.

However, we are dedicated to the idea that the programming model of the BEAM is one that complex client-side applications will benefit from over what JavaScript current offers.

Re:Lumen – Elixir and Erlang in the Browser by lawik on Friday January 24, 2020 @10:59AM (#22139334)
That sounds pretty close to what Scenic does for OpenGL-rendered UI.

Scenic has some interesting properties in that if a specific component has a code problem and fails/crashes, the supervision tree will bring it back to life. I'm curious to see what similar things one could do with Lumen for the web.

Components are already a very popular level of abstraction with Vue and React, probably others. So maybe there are useful things to bring from Scenic.

Re:Lumen – Elixir and Erlang in the Browser by bcardarella on Friday January 24, 2020 @11:09AM (#22139451)
Scenic is one area that I've looked to for inspiration on what a GUI can be like in Elixir
Re:Lumen – Elixir and Erlang in the Browser by hopia on Friday January 24, 2020 @10:42AM (#22139173)
Oh wow sounds like a pretty fundamental overhaul of the current DOM model. Then again, various virtual DOM diff implementations have shown they can improve working with the DOM a lot.
Re:Lumen – Elixir and Erlang in the Browser by hsavit1 on Friday January 24, 2020 @10:53AM (#22139278)
Yeah, the undertaking would be quite extraordinary if they could get it working. Something tells me that this is going to take a few years to develop (preemptively giving a "bravo" if it could be done sooner ;) )
Re:Lumen – Elixir and Erlang in the Browser by mstade on Friday January 24, 2020 @10:33AM (#22139094)
This sounds like an interesting experiment, do you have a repo or anything one could follow?
Re:Lumen – Elixir and Erlang in the Browser by bcardarella on Friday January 24, 2020 @10:36AM (#22139121)
https://github.com/lumen/db_mon_demo

There is a db_mon-esque implementation within the source and ultimately this is where the demo will live but for now (and the purposes of that demo at ElixirConf) I went in a different direction

Re:Lumen – Elixir and Erlang in the Browser by regulation_d on Friday January 24, 2020 @12:45PM (#22140598)
For me, the main benefit would be the ability to use a concurrency model other than the event loop.

In Elixir, I can reason about the code being run in one process as though it were synchronous, because it kind of is. But I can do that without blocking anything else, which is also pretty important.

Re:Lumen – Elixir and Erlang in the Browser by lawik on Friday January 24, 2020 @10:53AM (#22139283)
It will run Erlang and Elixir. So anything you like or dislike about working with those languages should carry over. I find them delightful, mostly have experience with Elixir.

Asynchronous and event-driven code is already a fact in the browser so working with an ecosystem that is designed for that may prove a better experience.

I'm hopeful. Also, concurrency, staying of the render thread if possible. There's lots of fun to be had there.

Re:Lumen – Elixir and Erlang in the Browser by hopia on Friday January 24, 2020 @11:53AM (#22140000)
Supervisors, Genservers etc. are OTP patterns, not specifically Erlang or Elixir language features.

Lumen seems to implement OTP patterns so that's why those things work on it.

Re:Lumen – Elixir and Erlang in the Browser by lawik on Friday January 24, 2020 @12:21PM (#22140323)
Yeah, I'm aware of the distinction. But I honestly haven't settled on how to refer to it all as a whole. Do you have a preference?
Re:Lumen – Elixir and Erlang in the Browser by hopia on Friday January 24, 2020 @12:59PM (#22140752)
I didn't mean to nitpick about the definitions, I just wanted to say Erlang/Elixir would both be well usable as languages even without the OTP abstractions and tooling.
Re:Lumen – Elixir and Erlang in the Browser by lawik on Friday January 24, 2020 @01:05PM (#22140817)
That's a fair point :)