10 ms·
Lunatic is an Erlang-inspired runtime for WebAssembly
- canadianfella 4y ago
- kotxig 4y agoI wish they had called it something else. I hate to be that guy but you know, it's not that hard to be maybe just a little bit more thoughtful. https://www.bbc.com/news/magazine-17997413 https://www.bbc.com/news/magazine-17997413
- Quarrelsome 4y agoIs it still that offensive? The linked article discusses a peak of the term around reform of 19th century "lunatic asylums" where the phrase was in common use and had dark connotations but aren't all those people dead now? Is the term still somehow problematic and if it is, doesn't that imply that words like "insane" have the same problem?
- kotxig 4y agoI mean, I had to think about it. Whether it's hugely offensive or not isn't necessarily the right question here. With the whole English language to pick from there are probably better choices that are less ambiguous.
- Quarrelsome 4y agoI personally worry somewhat about social-censure. Here's [1] a talk that asks (among other things) if Salman Rushdie's Satanic Verses would be published or even written today and I think that concern relates a little to our conversation. While its quite easy to see the argument for self/social censure (as usually someone is personally motivated to make it), I worry that the argument against it is much harder to see and has less organic advocates. [1] https://www.bbc.co.uk/iplayer/episode/p0dhrlhm/the-reith-lectures-2022-the-four-freedoms-1-chimamanda-ngozi-adichie-freedom-of-speech https://www.bbc.co.uk/iplayer/episode/p0dhrlhm/the-reith-lec...
- dmitriid 4y ago> Whether it's hugely offensive or not isn't necessarily the right question here. It is the right question. If a term once considered offensive no longer is one, and there's no one who gets offended by it, is it still offensive? > With the whole English language to pick from there are probably better choices that are less ambiguous. Given infinite time and finite language, every term will become offensive. What then? Especially considering the euphemism treadmill https://en.wikipedia.org/wiki/Euphemism#Lifespan https://en.wikipedia.org/wiki/Euphemism#Lifespan
- toqy 4y agoLuckily most projects won't be around for infinite time
- pessimizer 4y agoAs far as I can tell, it's not offensive, and was never offensive. What can be offensive is using it as a term to refer to the mentally ill, especially in law - and it's really more antiquated than offensive even there. We have more specific and thoughtful terminology for varieties of mental illnesses now, that have nothing to do with the moon. So if you have a law on the books governing how to treat lunatics, or how lunatics should be treated, it's a dumb old law because there's no official test for lunatic. It would be just as stupid if you had laws about the "wacky" or the "nuts." The overwrought nature of the concern about seeing the word as the name of a piece of software is just a symptom of the current zeitgeist.
- jamil7 4y agoIt's not offensive as much as it's kind of odd sounding, and would feel awkward pitching to someone else.
- danpalmer 4y agoAgreed. While it might be debatable whether it's explicitly offensive, it's at least a bit of a grey area and it immediately stood out to me as a poor choice of name. Whether you agree or not with the use of the term, names are part of communication, and communication that people are going to take issue with (rightly or wrongly) is going to have an impact on a product/project/business, and should probably be reconsidered, unless the point is to cause controversy or dogwhistle certain values. This name for example would probably rule out use at many companies, and I suspect many would choose not to publicise it with things like conference talks.
- lolinder 4y agoThe problem is that in the age of the internet, it's very difficult to find anything that someone, somewhere won't be offended by. Every time an organization or project gives in and alters its innocently-chosen name because a tiny minority takes offense, they further normalize outrageous outrage. It's definitely a fine line to walk. There are names that originated in an offensive context, and it's easier for me to see the objection to those. But "lunatic" hasn't been commonly used in its offensive sense in nearly a century, so I don't think it's fair to stoke outrage towards a project that started in the 2020s and chose it for extremely innocent reasons.
- kotxig 4y ago"should probably be reconsidered" isn't exactly outrage is it? We can have sensible discussions about appropriate naming without being extreme one way or the other, as much as the internet seems to hate moderate discussion.
- danpalmer 4y ago> it's very difficult to find anything that someone, somewhere won't be offended by Sure, but there's a big difference to the marketability of a product between whether 30% get a funny feeling that it's not a great name and won't promote via word of mouth, vs 0.0001% who are known for taking issue with a lot of stuff shouting about it in their echochamber. > But "lunatic" hasn't been commonly used in its offensive sense in nearly a century I think it was reasonable to refer to "lunatic asylums" or even "looney bins" until quite recently. The offensiveness may be less, and less targeted at individuals than it was 100 years ago, but it's still there.
- elteto 4y agoIt is not used in a context in which it is offensive. It’s just a name. Maybe they just like looking at the moon a lot.
- sli 4y agoThis logic implies that one could name a project after an explicit slur and it being a project instead of a directed insult makes it no longer a slur. That doesn't track at all.
- dmitriid 4y agoIt does. A few years back a non-native English speaker presented an Erlang library called `coon` because he like this abbreviation of the word `raccoon`. [1] The shitstorm from Americans (US and Canada) was unbelievable. Even though: - most people on the mailing list where this was discussed never heard it used as a slur - people in the states where this word was purportedly still used as a slur never heard it used - several black people (both African Americans IIRC and a guy from South Africa) said they had no problems with the name (and promptly ignored) The name of the library was changed. Now. The question is: who decides it is a slur especially in our global world? Somehow, increasingly, it's the white Americans who end up being offended on everyone's behalf. See also: the performative activism around master/main branches in git. [1] Actual reasons: the name was available: https://github.com/comtihon/enot/issues/59#issuecomment-365183267 https://github.com/comtihon/enot/issues/59#issuecomment-3651...
- felixgallo 4y agoman, don't be ridiculous. 'coon' is objectively a long standing racist slur. That some people ("a guy from South Africa", ffs) claimed not to know this or notto have heard it personally doesn't make that untrue. I invite you to go to any black neighborhood in the US and chant 'coon' for as long as you can to determine just how performative the white americans are being. I'll take the short side of 30 seconds.
- 4y ago
- bheadmaster 4y agoEverything is "offensive" these days - anyone can claim anything is "offensive", and because it's subjective, it's impossible to even be proven wrong. The very word has lost all real meaning.
- kotxig 4y agodefinition of "lunatic" - "a person who is mentally ill (not in technical use)." I didn't say it was offensive. If it was called "autistic", the word is not offensive but... why? It's just a really strange choice.
- bheadmaster 4y ago> why? It's just a really strange choice. I personally thought it was a witty name. Had a tiny mental chuckle when I read it. Better question is, why not? If it's not offensive, then what is the reason you "wish they had called it something else"? > It's just a really strange choice Doesn't sound like a real criticism to me...
- kotxig 4y agoLet's just put it this way, I'm not advertising in anything associated with my professional credibility that I use "lunatic", for the very obvious reason that it's possibly offensive to some people and that the word offers nothing to convey meaning. I don't have to find it personally offensive to not want to associate with it.
- thingification 4y agoI can understand that as a heuristic. On the other hand, there are other people who might apply a different heuristic and guess that a project named 'lunatic' is less likely to attract the sort of people who might take, for example, a code of conduct as a tool to beat other contributors about the head. (I'm not saying that's you!) I guess there are "swings and roundabouts" and peoples' rules of thumb differ, which is perhaps diversity that's all to the good.
- eigenrick 4y agoThe origin of the name comes from the fact that it started as a Lua project. In Lua (Portuguese for moon), everyone loves any "moon" related names or puns for their project. As such, "Lunatic" fits right in. As someone who has family members with mental health issues, I don't find the term offensive at all. I, for one, by default think more of someone who's obsessed with the moon, I guess it's because I never read that article, so I've never been told to be offended by it. All that said, I do hope that the authors understand that they might be fighting an uphill battle with regards to adoption.
- lolinder 4y agoThe article you link to discusses "lunatic" being offensive when used in law in its original sense to refer to real people with real mental health problems. Whether that is offensive (and I think it probably is) is a completely different question from whether its modern, colloquial use is offensive. The word dramatically declined in popularity through the 19th century but started climbing again after ~1995[0]. The recent increase in usage is driven entirely by a much milder, colloquial meaning of "wildly foolish"[1]. I think being offended because our great-grandparents used the word literally is a bit silly. [0] https://books.google.com/ngrams/graph?content=lunatic&year_start=1800&year_end=2019&corpus=26&smoothing=3 https://books.google.com/ngrams/graph?content=lunatic&year_s... [1] Meriam Webster identifies the older meaning as "dated": https://www.merriam-webster.com/dictionary/lunatic https://www.merriam-webster.com/dictionary/lunatic
- macintux 4y agoInteresting. A huge part of the Erlang value proposition is that the language and runtime are designed to complement each other, and both have significant constraints imposed by the language design. Taking half of that equation, and supporting any language, feels like you’re missing a big part of the benefit.
- pessimizer 4y agoElixir, LFE, etc. seem to work fine for the people who enjoy them. https://github.com/llaisdy/beam_languages https://github.com/llaisdy/beam_languages LFE is Virding's himself, and has been around for longer than Erlang has been popular: Robert Virding - LFE - a lisp flavour on the Erlang VM (Lambda Days 2016) https://www.youtube.com/watch?v=Br2KY12LB2w https://www.youtube.com/watch?v=Br2KY12LB2w Edit: Implementing Languages on the BEAM - Robert Virding - London Erlang User Group https://www.youtube.com/watch?v=qm0mbQbc9Kc https://www.youtube.com/watch?v=qm0mbQbc9Kc
- weatherlight 4y agoI think you're missing the point. All these languages are functional programming languages, have structural pattern matching and share the same types. The types of languages you can develop on the beam are very restrictive. For example, you'll never get Ruby or Java to work on the BEAM VM. let's look at garbage collection. How does tradition stop the world, Mark-and-sweep garbage collection work on the BEAM? it doesn't really. Each process on the beam has its own garbage collection algo, because processes can't share memory, garbage collection on one process can happen without disrupting any other process. https://www.erlang.org/doc/apps/erts/garbagecollection https://www.erlang.org/doc/apps/erts/garbagecollection
- throwawaymaths 4y ago> For example, you'll never get Ruby or Java to work on the BEAM VM Uhm, several ways: 1. Bind the VM in as a C FFI artefact 2. Write your ruby or Java bytecode emulator to run on one Erlang process only. Since Java supports threads, each thread could live on a different process, any shared memory would live on an Ets table. "never" is a strong word. The reason why people don't do it is that it's not worth it. I believe riak embeds javascript in the erlang VM. You can imagine why that might be worth it.
- Quarrelsome 4y agohang on, what part of the web assembly stack is this competing with exactly? I'm likely just very ignorant on how Web Assembly works but I don't understand exactly how it fits. Do browsers have pluggable hooks for interpreting web assembly that you can swap out for this or smth? Or are we talking about running WebAssembly on the server here?
- chairmanwow1 4y agoMy understanding is using web assembly isolation to execute arbitrary untrusted code in a different (non-browser) env
- Quarrelsome 4y agoSo like what node.js is to javascript in the browser? For whatever reason I had mistakenly thought that web-assembly was purely a front-end browser thing.
- letmeinhere 4y agoYeah, this is one of many non-browser runtimes, e.g. see https://github.com/appcypher/awesome-wasm-runtimes https://github.com/appcypher/awesome-wasm-runtimes Lunatic is more opinionated than most of these or node, though, in that it's trying to emulate a particular concurrent system design pattern borrowed from Erlang/BEAM.
- dathinab 4y ago> mistakenly thought that web-assembly was purely a front-end browser thing WASM has well defined boundaries and with WASI it adds some none browser APIs (but still sandboxed). It's used a lot for: - edge computing - plugin systems (or sandboxing) - easier cross platform code by targeting wasm (for code which is logically well-enough isolated you can compile it to wasm once end then just use it pretty much anywhere (web, app, desktop, server, edge, smarttv) reliable without having to worry about security or cross platform constraints. - easier auto updating/ever green apps (e.g. I remember vaguely to have heard Disney+ does put all their core business logic into a wasm blob to for both easy cross platform and auto updating of some parts) Lunatic doubles down one the server focused easy cross paltform + sandboxed aspects potentially deployed at the edge. But I also have seen people use a library wasm-runtime to embed a program written as stdin->dostuff->stdout CLI app into a go program without having to bother with cgo or cross platform support of the CLI app.
- bkolobara 4y agoI'm Bernard, the creator of lunatic. Great to see us back on HN and happy to answer any questions! We have been busy pushing out a lot of new stuff. Recently we released a web framework [0] for Rust building on top of lunatic, and a live-view library [1] for crating full stack apps in Rust without JS. For now we are staying close to the Phoenix LiveView implementation, where everything is rendered on the backend and just a diff is sent over websockets to the frontend. But a big advantage of Wasm is that it runs in the browser too, so we hope to leverage this part to move some of the logic directly into the browser, like form checking, or offer a way to create offline-first experiences with the backend running as PWA in a service worker. [0]: https://github.com/lunatic-solutions/submillisecond https://github.com/lunatic-solutions/submillisecond [1]: https://github.com/lunatic-solutions/submillisecond-live-view https://github.com/lunatic-solutions/submillisecond-live-vie...
- titzer 4y agoI'm curious about this part: > This allows it to decide on a per process basis what syscalls are going to be forwarded to the operating systems. 1. Which system calls are being referred to here? 2. Does Lunatic follow WASI's capability-based filesystem access?
- bkolobara 4y ago1. You can limit almost anything, file system usage (fopen, write, ...), networking i/o, how much memory can be used, message sending, the capability of spawning child processes, etc. 2. Yes
- mr_luc 4y agoOoh, LiveView pattern implementors! I have a question -- I've been tinkering with a custom Phoenix LV client in my 'shop time', so I wanted to ask: are you doing your diffs on a string-based representation, like they do in the internal Phoenix LV protocol? Or are you sending the DOM patches? In the phx protocol, their diffs depend on having split the render into a tree of 'statics', 'dynamics', 'components', and on each change, that structure is patched, and needs to be recursively zipped to a string, parsed into a DOM, and patches computed against the previous DOM. I've been playing with a new client as a way of understanding it, and it's definitely a certain amount of work! Fortunately computing 'what needs to change to reconcile 2 html-like DOMs' is a project that's been wrapped into libraries a few times in a few languages (phoenix relies on other people having done that too, via the 'morphdom' library in JS, and Dockyard recently open-sourced an ergonomic Rust library I'm using in my client). So -- it's a lot of client work, but it optimizes for bandwidth. Cool. But I've wondered if there could be any benefit to optimizing for granularity of patches, and simpler clients -- by sending 'just the patches', ie the list of DOM operations that cause the desired end state. My intuition is that the bandwidth 'cost' would be prohibitive, because the list of patches required to perform the morph could be quite large for a change that appears small in 'what string has changed' terms. (maybe harder to debug, too? lots of trade-offs) I just don't have the energy to try it that way too, hehe, on the off chance that my intuition is off base and it'd actually help improve things (simpler clients, and maybe the bandwidth hit wouldn't be too bad?); it'd require deep server changes as well, when up until now I've only been writing a client. So I was curious what approach y'all are taking. Prior/related art in the Rust space: I know there's a non-Phoenix liveview project, 'dioxus', with a generic DOM liveview implementation that several clients have been created for, by making a state machine that operates on that list of generated Patches; however I don't know what that one sends, whether DOM patches directly, or Phx-style diffs that need to go phxDiff -> zippedUpString -> dom -> morphPatches -> applyToDom.
- toastal 4y agoWas interested, especially aiming to by language agnostic, then immediately not when I see all communications are exclusively via proprietary platforms. > Choosing proprietary tools and services for your free software project ultimately sends a message to downstream developers and users of your project that freedom of all users—developers included—is not a priority. — Matt Lee This means if Discord or Microsoft (parent of GitHub) or Twitter (I guess) decide to delete or ban your account, you are by proxy banned from the project, Lunatic; this means Lunatic is not in control of the moderation of its community. This also requires all users must give up personal data to the corporations in order to participate. This also further drives a wedge between those that prefer the spirit of open source not just in the style of communication, but those that want it in the tools used to create it as well. This project isn’t the only or first offender, but it’s frustrating seeing this pattern pop up over and over and it needs to be called out every time. People care about their privacy more than ever. Interest in OSS has never been higher. We just witnessed yet another exodus off Twitter for federated plaforms like Mastodon and other platforms because folks don’t want to deal with the whims of megacorporations. Everytime Microsoft or Microsoft GitHub make another questionable move, projects seek refuge on Codeberg/SourceHut/GitLab, or self-hosting. There are a non-negligible amount of folks that don’t want this.
- ghqst 4y agoHow often do people get banned from GitHub for reasons anyone would disagree with? (besides projects that are targeted for DMCA, but you seen to be talking about personal accounts being unable to participate in the community of an open source project)
- cestith 4y agoIt is MIT licensed so one could host their copy or fork entirely elsewhere. It's available as a Rust crate, which doesn't seem to have the issues that concern you. The Discord part is a little harder to address. Contributing back to the code upstream could be difficult. Projects have moved before when corporate hosts proved problematic for either the maintainers or enough users, such as the exodus from Sourceforge. I have no doubt if Discord, Github, or Twitter become issues the project could move elsewhere, possibly to a private Gitea and to Mastodon. Right now, though, the maintainers are probably happy to use these services and not worry about maintaining production servers for it.
- 83457 4y agoIf they need a theme song. https://youtu.be/uqUa_G1h3pw https://youtu.be/uqUa_G1h3pw
- Defletter 4y agoDoes Lunatic have a starter / example project?
- taldridge 4y agoThere's some things: - https://github.com/lunatic-solutions/chat https://github.com/lunatic-solutions/chat - https://github.com/lunatic-solutions/submillisecond/tree/main/examples https://github.com/lunatic-solutions/submillisecond/tree/mai...
- Defletter 4y agoMy apologies, I mean in terms of an AssemblyScript template / example project that takes advantage of https://github.com/lunatic-solutions/as-lunatic https://github.com/lunatic-solutions/as-lunatic
- LAC-Tech 4y agoFrom the FAQ: Each process has its own stack, heap, and even syscalls. If one process fails, it will not affect the rest of the system. This allows you to create very powerful and fault-tolerant abstraction. This is also true for some other runtimes, but Lunatic goes one step further and makes it possible to use C bindings directly in your app without any fear. If the C code contains any security vulnerabilities or crashes, those issues will only affect the process currently executing the code. The only requirement is that the C code can be compiled to WebAssembly. So as I understand it, an Erlang process can "crash" from an Erlang perspective and it's fine (and even encouraged!), but if it crashes from a system perspective (segfault or some such), it takes down all neighbouring processes as well - usually an issue when using foreign libraries. With this set up, one of your erlang processes can segfault and it's fine? I have to admit I'm not across using WASM as a general purpose backend.
- peoplefromibiza 4y ago> but if it crashes from a system perspective (segfault or some such), it takes down all neighbouring processes as well there are three different types of crashes in Erlang. First there are processes `spawn`ed with the spawn primitive. If such a process crashes, there's no risk for any other process in the system, not even exceptions can bubble up (or be intercepted for that matter). The second type is a linked process, a process whose faith has been linked to their children. In that situation if a parent process dies, intuitively all the children processes die with it too. If a child process dies, it brings down the parent too, and if the parent process is a child itself, recursively until the top Application process. It sounds risky until you realize that this mechanism allows parent processes to intercept child processes dying and act accordingly (restart one, restart all, ignore it, etc.) That's how supervision works in Erlang. Finally, if a process crashes when running as NIF (Native Implemented Function) or, to put it simply, a native library written in C (or that can export the same C calling convention) injected into the VM, it can bring down the entire VM.
- syrusakbary 4y agoDamn, it Wasm runtimes week! haha (Wasmer first, then WasmEdge and now Lunatic!) Good to see Lunatic here, they have been doing great work on their runtime. Props to Bernard and team :)
- ConanRus 4y ago
- thingification 4y agoIdly dreaming here, without enough understanding to even know how much this makes sense in this context, of: - Erlang-style concurrency (which I haven't tried so don't understand but hear good things about always) - With "platform" level capability security... - ... and language-level capability security - But with a sound and expressive type system like F# or similar - Oh, and garbage collection