7 ms·
Running WASI binaries from your HTML using Web Components
- benno128 3y agoG’day, if anyone has any questions about this I’m happy to answer them here.
- jurynulifcation 3y agono questions, hope you're having a good day, cool idea!
- benno128 3y agoHaha thanks, you too!
- simonw 3y agoI tried this in your Python example: import sqlite3 >>> db = sqlite3.connect("data.db") Traceback (most recent call last): File "<stdin>", line 1, in <module> sqlite3.OperationalError: unable to open database file Presumably that operation failed because there isn't a writable virtual filesystem. Would it be possible to provide one?
- pseudosavant 3y agoWhat a novel way to integrate a bunch of web technologies! It makes me much more interested in using WASM.
- chii 3y agoI can imagine how a new style of web-only terminals be possible. The filesystem is realistically _any_ url, and you can load any wasi programs (via a shell, which is also just another wasi program). I wonder if this is practical, or just a gimmicky way to use a computer...
- benno128 3y agoThanks! Yeah WebAssembly has an exciting future ahead of it.
- bantunes 3y agoWould it be practical to output HTML from these WASI components and build a page from them?
- benno128 3y agoI wouldn't put it in prod, but it would be possible. You'd need a JS binding layer that dealt with the output and wrote it to the page, but it could be minimal. There are other projects that are targeted more at this kind of thing if you want dynamic access to the DOM from Web Assembly (sorry I don't know them off the top of my head).
- Zetaphor 3y agoUnfortunately this page doesn't load in Firefox on Linux
- Zetaphor 3y agoAlso just tested in Chromium, doesn't seem to work for me on Fedora Linux. Just locks up the browser
- tarasglek 3y agoHi, I already support typescript execution in http://chatcraft.org/ http://chatcraft.org/ via wasm esbuild. Runno is really cool as it will also lets me support intepreted languages like Python and maybe even golang(assuming i can have a wasi binary produce another wasi binary). From docs: Currently @runno/wasi supports running only unstable and snapshot-preview1 WASI binaries. The snapshot-preview1 standard is more recent, and preferred. Where does one see what's part of snapshot-preview1? My google-foo is failing me.
- benno128 3y agoSnapshot Preview 1 is the standard all tools are building to right now. The specification is available here: https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md https://github.com/WebAssembly/WASI/blob/main/legacy/preview... It's pretty unreadable though! Preview 2 looks like it will be a big change, and is just being finalised at the moment. I'd expect that when preview 2 is available there will be an improvement in the quality of documentation. I'm not sure how long it will take after release for tools to start switching to it. I'd expect Preview 1 will still be the main target at least for the rest of this year.
- n89nanda 3y agowebsite not loading for me
- benno128 3y agoIt's a bit temperamental on some browsers sorry (I've seen it fail on Arc). I implemented my own front-end router and I have done a bad job. I've seen it work today on Chrome, Firefox and Safari.
- n89nanda 3y agoi tried chrome and safari as well, no luck
- benno128 3y agoSorry! Sometimes web is hard.
- kamel3d 3y agoNot working on chrome here
- politelemon 3y agoWhy is it temperamental? When you say frontend router do you mean in the SPA sense (eg, React/Angular) or do you mean like your own load balancer (eg ALB/HaProxy/Nginx)? (Not working in Firefox for me)
- benno128 3y agoSPA sense. It’s cobbled together because I just have fun with it. Not sure why it’s temperamental, haven’t bothered investigating.
- ben-schaaf 3y agoSeemed to load, but brought my phone to a crawl (Firefox Android).
- appleflaxen 3y agoI get "Runno crashed: ReferenceError: SharedArrayBuffer is not defined" in every component.
- benno128 3y agoIs this on the blog post, or are you trying it out yourself? If it's on the blog post, it sounds like your browser doesn't support `SharedArrayBuffer` (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...) or you've disabled Cross Origin Isolation somehow. It might be because you have an old browser (there was a period where it was disabled) or you have disabled Cross Origin Isolation yourself (maybe a security setting?).
- sureglymop 3y agoSame here - using mobile chromium on android.
- kbumsik 3y agoSharedArrayBuffer was affected by Spectre vuln and was disabled in some old browsers (or browser config).
- xena 3y agoThis is seriously awesome. I'm gonna use it in my blog. Stay tuned!
- benno128 3y agoLooking forward to it!
- drawkbox 3y agoVery slick and opens up so many possibilities. WebAssembly, WASI, like WebRTC/WebGPU/WebXR/WebAudio, just makes webdev, gamedev + native/networking very very interesting in this phase of technology where js frameworks are culty bloated/verbose and apps are the main thing for marketing/tools. Web apps + tools are opening up with wasm/wasi. Runno (https://runno.dev/ https://runno.dev/ + https://runno.dev/wasi https://runno.dev/wasi) is a great idea and helps make interesting native stuff in a sandbox locally. Running all this directly without having to mash into assembly is a great idea. Awesome job on this! > Runno helps you make runnable code examples that can be embedded in web pages. This is very handy for educational tools, it means: > - You can make code examples that don't need users to install scary tools. > - No need to run a server, it all runs client-side in the browser. > - Your users can edit and re-run any code examples you make. > - The examples are extremely customisable with HTML, CSS and JavaScript!
- pjmlp 3y agoYet I am still waiting to see a game with the same capabilities of Infinity Blade, that Apple used in 2011, as an example of a game showing of the newly acquired OpenGL ES 3.0 capabilities of iDevices. Or the Unreal Engine 3.0 citadel demo, also in 2011, for Flash/CrossBridge. It seems the only thing usable is running ShaderToy demos, and 3D views on ecommerce sites.
- parasti 3y agoThat expectation is off by nearly a decade. WASM games in terms of performance are closer to 2000 than 2010. Here's an open source indie game from 2003 that I ported to WASM [1]. It struggles to hit 60 FPS on devices that were released a good 15 years after the game itself. Browsers sometimes struggle to animate simple lines at 60 FPS still to this day, because they're just hugely massive platforms with thousands of moving parts with no room for big, complex apps on top of them. [1] https://neverball.github.io/ https://neverball.github.io/
- speps 3y agoI need to double check what you're saying, how do you show the FPS in your WASM port?
- chantepierre 3y agoHello, thank you for this work as it shows great creative potential. A suggestion for runno's website, though : when I clicked on the link posted on HN, I did not expect to download that much data. Maybe you could find a way to offer pre-rendered examples and give the user who visits your site a (very visible) option to really download and run things ?
- benno128 3y agoThanks for the feedback! It’s also cost me about $15 so far. I don’t think I’ll do that again, but it was fun as a demo!
- stuaxo 3y agoGreat stuff. Is it possible to output to markup from these programs ? It would be cool if python wsgi programs in this could work somehow.
- benno128 3y agoYeah of course! They've got STDIN/STDOUT/STDERR and I've built a Virtual Filesystem. But if you're using WASI binaries locally they don't have that restriction. You might be interested in WAGI: https://github.com/deislabs/wagi https://github.com/deislabs/wagi And to catch up on WASI: https://xeiaso.net/talks/unix-philosophy-logical-extreme-wasm https://xeiaso.net/talks/unix-philosophy-logical-extreme-was...
- unnouinceput 3y agonot loading even after 5 minutes. Firefox latest version here (116.0.3 - 64bit)
- rapnie 3y agoIt is a nice proof-of-concept, but a pity that runno uses firebase. Any software with built-in SaaS services from advertisement agencies are a no-go area for me.