[ $davids.sh ] โ€” david shekunts blog

๐Ÿ˜Ž Wow, and WASM turned out to be something ๐Ÿ˜Ž

# [ $davids.sh ] ยท message #232

๐Ÿ˜Ž Wow, and WASM turned out to be something ๐Ÿ˜Ž

The discussion under the previous post allowed us to summarize the current areas of WASM application and you know... it turns out to be a surprisingly cool technology outside of the browser as well

#wasm #serverless #cli #db #rust #go #zig

  • @ [ $davids.sh ] ยท # 1353

    Here's what we have in a nutshell:

    . Scripts or lack of Garbage Collector

    The application lifecycle should either be very short (start -> execute -> kill) because there's no built-in GC yet, or have no GC at all (RUST, C, Zig).

    For example, terminal utilities, custom DB functions, and serverless.

    . Cross-execution

    WASM runs on any computer, becoming a universal platform for creating terminal utilities in absolutely any language. To run them, you'll only need to install WASM on your computer once (which sooner or later will likely be built into all OSs). This will replace language interpreters and allow you to run scripts from all languages.

    . Cross-compilation

    This allows you to build an application on any system that will run on WASM on any other system. At the same time, the size and startup speed of such applications are minimal (smaller than default builds).

    . PaaS

    Since WASM is an "interpreter," you can run third-party code in a sandbox mode, controlling its access, resources, and runtime. This is convenient for creating PaaS platforms. Considering the optimization in terms of size and speed, WASM seems to be the ideal evolution for Serverless (although it's already being tagged as an "Edge" technology, it's in the same domain).

    My prediction:

    โ€“ The future of Serverless and Edge belongs to WASM.

    โ€“ WASM will be integrated into OSs, allowing you to write scripts in any language and run them on any OS from a single binary (this will be simply great).

    โ€“ It will continue to be actively integrated into databases to enable the execution of functions written in any programming language.

    โ€“ Various GC implementations for WASM will emerge, and they will gradually start allowing the migration of languages with GC to it. This will then lead to the development of Serverless Containers on WASM.

    โ€“ If the transition is seamless for non-system programmers (they'll just need to compile and run via WASM), then the entire web will jump to WASM.

    P.S.

    I also found an interesting project: wasmer โ€“ what's interesting is that they already offer running Django (I still don't understand how this will work without GC) and Wordpress on WASM (PHP is already a scripting language, so I believe it).

  • @ Vassiliy ITK Kuzenkov ยท # 1354

    There seems to be wcgi for Django and PHP https://wasmer.io/posts/announcing-wcgi

  • @ [ $davids.sh ] ยท # 1355

    Ah, yes, I agree.

    Python is also, in fact, a scripting language.

    By the way, for some reason, I don't see anything about Lua, but it's a popular language and perfectly suited for WASM.

  • @ Vassiliy ITK Kuzenkov ยท # 1356

    Yeah, I think they even compiled LUA for the browser with WASM, I saw it somewhere. I played around with Fennel (a Lisp that transpiles to LUA) and https://github.com/ceifa/wasmoon

  • @ Ivan ITK ๐Ÿšซ ยท # 1357

  • @ Ivan ITK ๐Ÿšซ ยท # 1371

    Here's something on topic, I just saw a very unusual solution on wasm, I'd say unconventional thinking gives rise to such interesting concepts https://github.com/RReverser/wasm-bindgen-rayon

  • @ [ $davids.sh ] ยท # 1374

    I don't understand one thing: is this for real-time calculations or for big data after all?

    I'm just curious, if it's real-time, does that mean we're one step closer to full-fledged games in the browser on WebAssembly?

  • @ Ivan ITK ๐Ÿšซ ยท # 1375

    I think Mozilla Experiments has a project with games where they've been developing for all the new trendy technologies like wasm, webgl, webgpu, webvr, etc. for a long time. As far as I remember, some engine like old UE or Unity was ported or they tried to port it, but there was some project to convert desktop games to the web, and back then I remember many games being ported.

    Here's an article I found that discusses games on wasm https://hacks.mozilla.org/2017/07/webassembly-for-native-games-on-the-web/

  • @ Ivan ITK ๐Ÿšซ ยท # 1376

  • @ Ivan ITK ๐Ÿšซ ยท # 1377

    but technologies were developing so rapidly at that moment that marketing couldn't keep up, so they kind of exist, all the possibilities are there, but no one has invested enough in them for them to become mainstream)

  • @ Ivan ITK ๐Ÿšซ ยท # 1378

  • @ Ivan ITK ๐Ÿšซ ยท # 1379

    This is what I was into back then))

  • @ Ivan ITK ๐Ÿšซ ยท # 1380

    There was also Duke Nukem and some kind of strategy game.

  • @ Ivan ITK ๐Ÿšซ ยท # 1381

  • @ Ivan ITK ๐Ÿšซ ยท # 1382

    User rossisred ported his "Funky Karts" game from C++ (targeting Android) to WASM. Direct link to the game: https://www.funkykarts.rocks/demo.html

    Blog post on porting the engine: http://www.rossis.red/wasm.html

    Original thread: https://news.ycombinator.com/item?id=14411328

  • @ Ivan ITK ๐Ÿšซ ยท # 1383

    https://developer.mozilla.org/en-US/docs/Games/Introduction There's a lot described here on MDN about web games, it's very interesting, by the way. I skimmed through it and bookmarked it to read later)

  • @ Ivan ITK ๐Ÿšซ ยท # 1384

    And this solution simply does honest parallelism in the browser, essentially extending the sandbox limits for the application through web worker threads with shared memory capabilities, and the guy basically made all of this into an SDK for easy and safe work with it.