TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

WebAssembly without the browser

136 pointsby pacificat0ralmost 5 years ago

15 comments

tess0ralmost 5 years ago
Author of wasmex[1] here (an elixir package which allows runnung WASM).<p>Next to the mentioned wasmtime, wasm3, and wamr, there is also wasmer[2] I would add to the list of capable WASM runtimes.<p>The great things these runtimes offer are how easy they are to integrate into other programming languages environments. E.g. with wasmex you could easily run WASM from your elixir application (or with wasmer from ruby[3] or many other languages if you want).<p>Imagine building shopify, but without needing to invent your own template language for customers to extend their shop-template[4]. They could provide a WASM extension API where shop-owners could let sandboxed WASM files render their shop. This would let allow shop-owners to write templates in their favorite language instead of e.g. liquid and still be secure.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;tessi&#x2F;wasmex&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tessi&#x2F;wasmex&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;wasmerio&#x2F;wasmer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wasmerio&#x2F;wasmer</a> [3] <a href="https:&#x2F;&#x2F;rubygems.org&#x2F;gems&#x2F;wasmer" rel="nofollow">https:&#x2F;&#x2F;rubygems.org&#x2F;gems&#x2F;wasmer</a> [4] <a href="https:&#x2F;&#x2F;github.com&#x2F;Shopify&#x2F;liquid" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Shopify&#x2F;liquid</a>
hardwaregeekalmost 5 years ago
One area that I&#x27;m hoping WebAssembly will help with is running native extensions in a portable sandbox. That way libraries like nokogiri can be compiled to wasm ahead of time, then executed on a wasm runtime. There will be a perf hit but not having to wait for nokogiri to compile native extensions will be worth it.
评论 #24181649 未加载
followeralmost 5 years ago
Interested to see a number of people mention one of the attractions with WebAssembly being the sandbox &amp;customisation angles.<p>Sandboxed in-game avatar customisation was one of the motivations behind the &quot;WebAssembly Calling Card&quot; (WACC) project I released within the past couple of weeks, posted a Show HN here: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24072304" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=24072304</a><p>&quot;WACC: Like an avatar but WASM!&quot;<p>The WACC specification defines how three 32-bit ints (returned via 3 calls to a function in a WASM module) get turned into triangles:<p>* 256x256 coord system.<p>* 15 bit color + 1 bit alpha per vertex triangles.<p>* 1 FPS!<p>In part, WACC &amp; the WACC Viewer app is a demonstration of a WIP add-on for the Godot game engine that wraps the libwasmtime WebAssembly runtime so desktop Godot games&#x2F;apps can call functions in WebAssembly modules. (The other demo app is a tool to help explore `.wasm` files: <a href="https:&#x2F;&#x2F;gitlab.com&#x2F;RancidBacon&#x2F;wasm-exploder" rel="nofollow">https:&#x2F;&#x2F;gitlab.com&#x2F;RancidBacon&#x2F;wasm-exploder</a>)<p>The other main goal with WACC is to provide more visually interesting &quot;first run&quot; experiences for people embedding WASM runtimes and&#x2F;or provide a creative outlet for starting to play around with generating&#x2F;writing WebAssembly.<p>So, if you&#x27;re interested in playing around with some non-browser WASM you might like to have a play with WACC--maybe implement the spec for a different host or create your own Calling Card. (I would particularly like to see it running on standalone hardware like a badge or similar.)<p>Main site here: <a href="https:&#x2F;&#x2F;wacc.rancidbacon.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;wacc.rancidbacon.com&#x2F;</a>
pansa2almost 5 years ago
&gt; <i>This is powerful because you [can] use Rust or C++ as your scripting language.</i><p>Do people really want to use such complex, heavyweight languages for scripting?<p>&gt; <i>WebAssembly enables predictable and stable performance because it doesn’t require garbage collection like the usual options (LUA&#x2F;JavaScript).</i><p>Do garbage collection pauses cause significant issues when embedding Lua or JavaScript? If so, I would expect implementations of those languages to switch to reference counting, but none of them are doing so.<p>&gt; <i>Extremely fast programs in environments where you can’t JIT for reasons.</i><p>To get good performance, don&#x27;t WebAssembly implementations need to use JIT-compilation internally?
评论 #24187792 未加载
评论 #24183594 未加载
评论 #24184733 未加载
Shared404almost 5 years ago
This seems to me like WebAssembly works basically like Java, but the bytecode can be compiled to from multiple languages.<p>Is this correct?
评论 #24181279 未加载
评论 #24184267 未加载
评论 #24183408 未加载
评论 #24184826 未加载
rapidluaalmost 5 years ago
I doubt that WASM is good as an embedded language, unless performance requirements outweigh the inconvenience.<p>Dynamic languages are great for experimentation and exploring the system, e.g. a console in the browser is the fantastic tool and web dev people tend to try things there first. By embedding wasm, you are making tinkering with the system you provide less enjoyable for your users.<p>One could argue that since many languages compile to wasm, you can pick whichever suites you best. But in reality, you are probably limited to languages with thin runtimes, e.g. Rust or C. Otherwise you will end up with a huge wasm blob. Imagine, there are 2 Java extensions, a C# one and something in Python, all running simultaneously. It means 3 different runtimes with a footprint by far exceeding that of the application logic in an extension.<p>Another burden is the bridging between the host and an extension. Unlike lua or js you can’t pass and inspect objects, the only option is to marshal data as a byte blob. So if you were to pick up a language no one used to write extensions for the particular application before, the very first think you have to do is writing marshalers.<p>Last but not least, I disagree with the article calling S-expressions ugly and strongly believe in the opposite.
评论 #24185954 未加载
azakaialmost 5 years ago
&gt; WebAssembly enables predictable and stable performance because it doesn’t require garbage collection like the usual options (LUA&#x2F;JavaScript).<p>GC is a small part of that - the much bigger factor is dynamic optimization is necessary for fast Lua or JavaScript. Wasm is designed to not need that (like most languages that are not dynamically typed).
评论 #24181805 未加载
jmnicolasalmost 5 years ago
I&#x27;m not sure I understand the use case of the author. He mentions languages (Rust, C++ etc) that can be natively compiled to (almost) any platform, so what&#x27;s the point of running them in web assembly ? Like Java write once run everywhere ?
评论 #24185158 未加载
评论 #24185514 未加载
评论 #24185480 未加载
devwastakenalmost 5 years ago
Without proper security audits on wasms runtimes they can only be used as hypothetical tools. The main purpose of wasm is a sandbox that&#x27;s well defined, but that doesn&#x27;t matter if it&#x27;s implimentations are vulnerable.<p>You could use it to just &quot;deploy software anywhere&quot;, and that&#x27;s a neat idea, but it&#x27;s not &#x27;web&#x27; assembly, there&#x27;s no protections thst make it fit to run arbitrary code from the web.
erlend_shalmost 5 years ago
There’s a working proof of concept of WASM as a scripting foundation in a WIP programming game called Robot Rumble:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;robot-rumble" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;robot-rumble</a> <a href="https:&#x2F;&#x2F;rr-docs.readthedocs.io&#x2F;en&#x2F;latest&#x2F;technical-details.html" rel="nofollow">https:&#x2F;&#x2F;rr-docs.readthedocs.io&#x2F;en&#x2F;latest&#x2F;technical-details.h...</a>
评论 #24183324 未加载
评论 #24182713 未加载
srikualmost 5 years ago
(shameless plug)<p>I gave a talk, about a year ago, covering history of the problem statements from which WASM was born and the various forms it is taking.<p><a href="https:&#x2F;&#x2F;labs.imaginea.com&#x2F;talk-the-nuts-and-bolts-of-webassembly&#x2F;" rel="nofollow">https:&#x2F;&#x2F;labs.imaginea.com&#x2F;talk-the-nuts-and-bolts-of-webasse...</a><p>Welcome thoughts&#x2F;comments&#x2F;corrections&#x2F;additions.
评论 #24205395 未加载
chrisweeklyalmost 5 years ago
I found this writeup to be fairly well-written and detailed, but I lack the WebAssembly knowledge to comment on its other merits.
thdrdtalmost 5 years ago
I wish things like this could be used to break free from mobile app stores.<p>Download a virtual machine via the app store and then run any app written in any languages and compiled only once.<p>Almost like JAVA..
MPSimmonsalmost 5 years ago
Things like this is how we got NodeJS. Sigh.
评论 #24181674 未加载
评论 #24186023 未加载
评论 #24181703 未加载
nicetryguyalmost 5 years ago
If you are going to target WebAssembly outside of a browser environment, uh, why not just target LLVM, GNU, or uh, you know, Assembly... X86_64 or ARM are pretty standardized. Another part 1&#x2F;1 &quot;tutorial&quot; with some brilliant insight as per usual.
评论 #24183502 未加载
评论 #24184757 未加载
评论 #24185290 未加载
评论 #24183066 未加载