11 ms·
Lunatic brings Erlang's principles to WebAssembly
- Rich_Morin 4y agoThis seems like a very cool idea. The concurrency model in Erlang/Elixir/... eliminates the issues of shared mutable state and the supervision trees catch unexpected data-related problems, etc. FWIW, the Elixir/Phoenix community seems to have settled on LiveView, which performs most of the processing at the server, assisted by some small JS routines which handle updates, etc.
- tomtheelder 4y agoI think the Elixir/Phoenix community is very excited about LiveView, but I wouldn't say settled. I'd guess only a very small fraction of serious Phoenix apps use it, and most new ones are probably still going to go with some sort of SPA, at least for the time being.
- a_bored_husky 4y agoI think its a bit more than a small fraction https://twitter.com/elixirphoenix/status/1504133097075453953 https://twitter.com/elixirphoenix/status/1504133097075453953
- ch4s3 4y agoI happen to know of a big application that handles a surprisingly large sum of money every day that uses it extensively.
- anonymousDan 4y agoDo you know of any projects that seek to run elixir on web assembly in the browser in such a way that it can interact with a standard elixir beam backend?
- buescher 4y agoI interpolated an "a" in that headline on first reading.
- RcouF1uZ4gsC 4y ago> In Erlang, it feels so elegant – you write your code in a linear way, no coloring of functions, no async/await, and it still works in a high performant, I would say, scheduled way with [inaudible]. My idea was “how can I have this experience in Rust?”. I think long term, we will view async, like we view the near/far/huge pointers - something that was required in the past for performance but is now obsolete. With Java’s project Loom, kernel improvements in efficiency of threading, and projects like this, for the vast majority of programmers, using async for concurrency will not be worth it.
- laerus 4y agoAlgebraic effects can also potentially abstract all this away and make the runtime pluggable.
- beanjuiceII 4y agohas haskell made all this pluggable?
- wtetzner 4y agoI don’t believe Haskell has support for algebraic effects. OCaml is getting them though.
- the_duke 4y agoThere are various Haskell effect libraries though. The big difference between effects and monads is that effects compose, while monads always require cumbersome mapping between domains.
- thesz 4y ago"What is language feature in regular programming languages is a library in Haskell" I will continue repeat that. ;) I also wish other languages go the way Haskell goes. There is at least one algebraic effects library in hackage [1]. [1] https://hackage.haskell.org/package/effect-handlers https://hackage.haskell.org/package/effect-handlers
- dang 4y agoRelated: Lunatic is an Erlang-inspired runtime for WebAssembly - https://news.ycombinator.com/item?id=28008737 https://news.ycombinator.com/item?id=28008737 - July 2021 (40 comments) Lunatic – An Erlang-Inspired Runtime for WebAssembly - https://news.ycombinator.com/item?id=26403879 https://news.ycombinator.com/item?id=26403879 - March 2021 (2 comments) Launch HN: Lunatic (YC W21) – An Erlang Inspired WebAssembly Platform - https://news.ycombinator.com/item?id=26367029 https://news.ycombinator.com/item?id=26367029 - March 2021 (39 comments) Show HN: Lunatic – Actor System for Rust/WebAssembly - https://news.ycombinator.com/item?id=25160474 https://news.ycombinator.com/item?id=25160474 - Nov 2020 (47 comments)
- the_duke 4y agoOne under-appreciated aspect of async is that it gives you a nice API for composing operations. Yes, async can be harder to introspect, especially with a debugger, and it introduces function colouring. But in return it gives you a clear type-system level indication that computations are not pure and don't resolve immediately. You also get simple tools to combine, map/modify, join and potentially cancel individual asynchronous tasks. You can in theory get a similar API with threads and/or channels, but I've never seen anything that was anywhere as convenient as async.
- moonchrome 4y ago>But in return it gives you a clear type-system level indication that computations are not pure and don't resolve immediately. Is that actually useful ? You can have "BlockingLongCall()" without async and it could block your thread from progressing for minutes - or you could have "await FunctionThatResumesImmediatelyOnTheCaller()" and it doesn't even context switch. > You can in theory get a similar API with threads and/or channels, but I've never seen anything that was anywhere as convenient as async. I mean you can use the exact same interfaces in .NET and threat tasks as Threads with a custom scheduler implementation (that fires up a thread for each Task you start). And Tasks in .NET implement blocking operations as well as async ones.
- piaste 4y ago> Is that actually useful ? You can have "BlockingLongCall()" without async and it could block your thread from progressing for minutes - or you could have "await FunctionThatResumesImmediatelyOnTheCaller()" and it doesn't even context switch. Very much so. Async is - I would guess 95% of the time - a proxy for IO operations. Error handling is different: a pure function can and should be bug-free, while an IO function can always crash due to external factors. Performance tuning is different: a slow pure function needs optimization, parallelization, and worst case a faster CPU, while a slow async function usually needs you to dive into the plumbing part of your code to see if you're using an API wrong or something like that.
- 4y ago
- alexklarjr 4y agoMy first thought: Oh no, some Erlang lunatic trying to make webassembly even more bad. After reading about newly invented bicycle: What a relief, WebAssembly itself remain untouched by esoteric languages lunatics.
- kzemek 4y agoI don’t think calling Erlang esoteric is fair. Niche, sure, but it powers multiple big services and well known enterprises
- 2wrist 4y agoNothing clever to say but I love the title.. :-)
- MeteorMarc 4y agoIs the title irony or just plain ambiguous?