TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Lumen: An alternative BEAM implementation, designed for WebAssembly

218 点作者 seeekr超过 5 年前

9 条评论

mrdoops超过 5 年前
My favorite part about the presentation was the correlations between the DOM tree and a supervision tree. If you&#x27;ve looked into the Scenic project (<a href="https:&#x2F;&#x2F;github.com&#x2F;boydm&#x2F;scenic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;boydm&#x2F;scenic</a>) you know how this Process &amp; Supervision model shows real promise for client-side UI concurrency. As your states are changing you don&#x27;t want one bad state to crash and cascade elsewhere - supervision trees lets you contain and recover from failures gracefully.<p>I&#x27;ll be honest I didn&#x27;t think it would be possible to implement something like the BEAM&#x27;s preemptive scheduler in WebAssembly until I saw the presentation. Turns out it&#x27;s very doable with continuations. The timing should be right in the next couple years as both Lumen and some of the bigger components of WebAssembly maturity kick into gear. Similar high level language&#x2F;runtime -&gt; WebAssembly projects like Blazor(C#) are also pending features like more native control over the DOM without going through JS interfaces (see here: <a href="https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;interface-types&#x2F;blob&#x2F;master&#x2F;proposals&#x2F;interface-types&#x2F;Explainer.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;WebAssembly&#x2F;interface-types&#x2F;blob&#x2F;master&#x2F;p...</a> for more technical details).<p>Even if client-side UI frameworks don&#x27;t pan out for Lumen, I can see Lumen being valuable for edge-computation especially where concurrency and fault-tolerance are important.
评论 #20852787 未加载
tiborsaas超过 5 年前
This is the gist of it:<p>&quot;The primary motivator for Lumen&#x27;s development was the ability to compile Elixir applications that could target WebAssembly, enabling use of Elixir as a language for frontend development.&quot;<p>I had to dig to lean what BEAM is :)<p>&quot;Bogumil Hausman next machine was called BEAM (Bogdan’s Erlang Abstract Machine). It was a hybrid machine that could execute both native code and threaded code with an interpreter. That allowed customers to compile their time-critial modules to native code and all other modules to threaded BEAM code. The threaded BEAM in itself was faster than JAM code.&quot;<p><a href="http:&#x2F;&#x2F;blog.erlang.org&#x2F;beam-compiler-history&#x2F;" rel="nofollow">http:&#x2F;&#x2F;blog.erlang.org&#x2F;beam-compiler-history&#x2F;</a><p>I now feel a little less bad that I couldn&#x27;t figure out the acronym :)
评论 #20852162 未加载
评论 #20854572 未加载
pron超过 5 年前
While WASM makes for a convenient compilation target for languages like C&#x2F;C++&#x2F;Rust&#x2F;Zig, isn&#x27;t JS a better target for languages that can benefit from a JIT and&#x2F;or a GC? You&#x27;d get better performance for less effort and a smaller deliverable. Why compile to WASM when JS seems, at least to me, an obviously superior target? What great advantage does WASM have that it makes it worthwhile to lose on three important fronts?
评论 #20851939 未加载
评论 #20852781 未加载
评论 #20853171 未加载
评论 #20852571 未加载
评论 #20852829 未加载
bcardarella超过 5 年前
Hi I&#x27;m Brian, one of the member of the Lumen team. I&#x27;ll try to address some of the questions I&#x27;ve seen in this thread:<p>1. Why?<p>We&#x27;ve seen every growing complexity in building, maintaining, extending, and debugging client side applications. There are several reasons why this is but in our opinion how JS handles concurrency (the Event Loop) is a primary factor. Erlang&#x27;s concurrency model is superior (also our opinion) in how a developer reasons about concurrency. We want to bring this power to building client side web apps.<p>2. I&#x27;m afraid of [it] being over-engineered, and hard to contribute to.<p>Lumen itself is just the beginning of what we hope is an eco system of tooling and potential framework pieces for building web applications. When building Elixir or Erlang applications developers are not expected to be contributing back to the BEAM or to even understand how it works. Lumen will be in a similar position. When we finally get to `mix install lumen` you will likely only be including Lumen as a dependency in your apps. Higher level functionality will emerge that use Lumen to compile to WASM. However, we highly encourage people with experience in Rust, compiler design, runtime design, Erlang&#x2F;BEAM, or just general curiosity to get involved in developing Lumen :)<p>3. even Chris McCord said that in all his years of consulting, he&#x27;s only gotten a handful of requests for these types of apps<p>Chris works here at DockYard, and this is because we don&#x27;t put Chris on our PWA&#x2F;SPA projects. While there is an obvious demand for LiveView to relieve people from needing a client side framework there are most definitely many clients and plenty of projects where client side apps make sense.<p>4.an alternative BEAM implementation that behaves like a regular VM rather than BEAM?<p>Not entirely, although some concessions need to be made when working within the security model of the web. I would very much like it is the browser vendors would give up the argument that Web Workers fulfill the threading requirement of WASM as I personally feel that is disingenuous. I&#x27;m hoping that as Lumen develops and (hopefully) picks up steam&#x2F;influence we can start to see some of these features land for real.<p>5. Due to size issues I probably wouldn&#x27;t want to ship the entire BEAM to my users<p>Correct, and we aren&#x27;t advocating for this. Lumen is currently in a very early stage of development and we haven&#x27;t even implemented any compilation optimizations like dead code elimination. There are many other WASM specific optimizations that could cut the footprint size by 50% and this is before we even gzip, which WASM is designed to respond well to despite being a binary.<p>I&#x27;ll keep a running list of responses in this thread if more questions come up.
评论 #20852688 未加载
评论 #20852603 未加载
评论 #20852596 未加载
评论 #20852661 未加载
评论 #20852872 未加载
lxrbst超过 5 年前
Cool idea, cool technology, cool project.<p>I really just don&#x27;t get the &quot;why&quot;, even after watching the ElixirConf presentation [1] about it. Like what is the use-case for this, specifically?<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=uMgTIlgYB-U" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=uMgTIlgYB-U</a>
评论 #20851636 未加载
评论 #20852408 未加载
评论 #20852617 未加载
juhatl超过 5 年前
I watched the ElixirConf 2019 keynote [1] as soon as it came up. While I was left excited about Lumen in general, I wasn&#x27;t entirely sure what kinds of things Lumen would be most useful for.<p>Being able to ship a single binary (like with Go or Rust) sounds handy, but shipping a tarball hasn&#x27;t been that much of a challenge either. Being able to run BEAM code in the browser also sounds handy, but due to size issues I probably wouldn&#x27;t want to ship the entire BEAM to my users either, right?<p>Can someone with a more thorough understanding of Lumen share some thoughts on this?<p>[1] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=uMgTIlgYB-U" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=uMgTIlgYB-U</a>
评论 #20850925 未加载
评论 #20852804 未加载
namelosw超过 5 年前
Interesting project.<p>Although it&#x27;s viable to transpile Erlang or Elixir to JavaScript, without the BEAM runtime everything seems pointless.<p>However if an BEAM is viable we could do interesting things like React fiber equivalent could just be processes.
moomin超过 5 年前
So, an alternative BEAM implementation that behaves like a regular VM rather than BEAM? Not saying it’s useless, but it’s sure idiosyncratic.
artfulhippo超过 5 年前
This is some of the best news this summer!<p>Anyone that wants to reduce the influence that Google and Facebook have on the Web should look into the Erlang&#x2F;Elixir ecosystem.
评论 #20855050 未加载