Rich_Morin

Rich_Morin

FYI - (Rust-based) "Submillisecond LiveView"

Submillisecond LiveView” is written in Rust. I wonder where its approach and behavior differ from that of Elixir-based LiveView (eg, in state maintenance). Anyone have a clue to offer?

-r

Most Liked

bkolobara

bkolobara

I’m one of the authors of submillisecond.

Like @rjk already mentioned, I think the biggest difference is not Rust, but the fact that we target the lunatic vm. The Rust code gets compiled to WebAssembly modules. The modules are then turned into WebAssembly instances and those instances are similar to Erlang processes, we even call them processes. They are lightweight, fast to spawn and completely separate (get their own heap and stack). So you are able to build systems in Rust (or any language that compiles to Wasm) that have similar characteristics to Erlang systems.

The WebAssembly aspect of it also opens a bunch of other possibilities. Things that would be impossible to do in Elixir. For example, WebAssembly can run in the browser. So we are working on moving some parts of the view into the browser. You still write all of the logic in Rust, but rarely need to actually send data to the backend because the code just runs in the browser. We are also thinking of just moving the whole backend into the browser for offline-first apps (SQLite can already run in the browser).

It’s still super early days and we need to solve many difficult technical problems (syncing state between offline apps and backend, splitting code into different .wasm compilation units, …), but we see a lot of potential here and will keep iterating on it. :crossed_fingers:

15
Post #4
rjk

rjk

Yes it’s super early days for this project but nice to see other languages and frameworks be inspired by the Phoenix Liveview ideas! AFAICS this project aims to write rust that runs both in the browser (using WASM) and server but is not just ordinary Rust but using a specific runtime behind it.

I’m following that runtime project behind it for a while now. This framework is not ‘just’ written in Rust but in some “dialect” if you would call it that. The idea is to write it in rust and use WASM as target and then run it inside a specially crafted runtime that behaves in a way like the BEAM VM (also being inspired by it). Every instruction that a process is running on it will have a cost, and it will pre-emptively run all processes evenly just like the BEAM VM and also with massive concurrency as goal. (for a better explanation see: https://lunatic.solutions/ )

The dialect part is explained in a blog post here: Rust without the async (hard) part | Lunatic
It’s “removing” the async/await keywords and handling this inside of the (WASM) runtime.

Eiji

Eiji

Well … without checking this project I would say we have a better community. :smiling_imp:

Ok, now more seriously … Regardless of LiveView implementation there’s still a key differences between languages that simply can’t be skipped … Also the initial commit was pushed 2 months ago, it does not links to any documentation, does not have any releases as well as tags and it still have lots of features missing like components (see created issue).

I think it’s way too early to start a real analyze/comparison of this project.

Where Next?

Popular in Discussions Top

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
PragTob
Hello everyone, I know we had quite some threads (read through lots of them) about background job processing but it remains a hotly deba...
New
mikl
I wanted to capitalize a string, and tried using String.capitalize(). That generally works well, until you try to capitalize a word like...
New
owaisqayum
I have a sample string sentence = "Hello, world ... 123 *** ^%&*())^% %%:>" From this string, I want to only keep the integers, ...
New
Qqwy
Looking at the stacks that existing large companies have used, WhatsApp internally uses Mnesia to store the messages, while Discord uses ...
New
AlexMcConnell
The reason that Rails is as popular as it is is because it’s very easy for relatively inexperienced developers to get a lot of work done....
588 19568 166
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
AstonJ
Can you believe the first professionally published Elixir book was published just 8 years ago? Since then I think we’ve seen more books 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
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

Other popular topics Top

marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
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
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New

We're in Beta

About us Mission Statement