Oh, and I can confirm that `-Os` (i.e. optimize for size) does make a difference. #wasm #emscripten
Oh, and I can confirm that `-Os` (i.e. optimize for size) does make a difference. #wasm #emscripten
Playing with libav.js [1] (#ffmpeg in #javascript through #emscripten)
TIL about "async functions" [2]. Seems like moving from "normal" to "async" is a one-way street - normal functions can be easily called in an async context, but it looks like there's no way to get the value of an async function in sync context.
Yes, I can ".then(...)" on the return value, but then I'm back in callback hell and no longer "sync", am I...
[1] https://github.com/Yahweasel/libav.js
[2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function
I wrote a blog post on efficient & safe string building with C -
https://mathewstorm.ca/blog/C_Programming/Strings/daedalus-strings-01/
- I am helping my friend make a high-performance game engine with C that compiles to WebAssembly with EmScripten!
Learning C and how to make it more performant has been a lot of fun.
🌕 網路開發者的自虐指南
➤ 從 C 程式碼到網頁應用程式:一場充滿挑戰的旅程
✤ https://sebastiano.tronto.net/blog/2025-06-06-webdev/
本文探討了將 C/C++ 程式碼轉換為可在網頁瀏覽器中運行的 WebAssembly 的過程。作者分享了將一個 Rubik’s cube 最佳解算器轉為網頁應用程式的經驗,並詳細說明瞭設定環境、編譯程式碼、處理多線程、以及如何與 JavaScript 和 HTML 整合。文章坦承此過程複雜且令人沮喪,但最終成功並帶來了寶貴的學習經驗。這篇文章更適合有 C/C++ 基礎,想將程式移植到網路的開發者,而非尋找標準網路開發教學的初學者。
+ 這篇文章很誠實地描述了 WebAssembly 開發的困難,讓我對這個技術有更深入的瞭解。
+ 雖然過程聽起來很複雜,但如果能將現有的 C++ 程式碼移植到網路上,將會非常方便。
#網路開發 #WebAssembly #C++ #Emscripten
seems I somehow got #MicroHs #Haskell interpreter compiled and working in a browser using #Emscripten #WebDev
used a require.js I found online (from Tarp https://pixelsvsbytes.com/2013/02/js-require-for-browsers-better-faster-stronger/ ) and slighly patched for my use case / url layout, and some minimal #NodeModules folder (npm install --save path) with custom symlinks inside to choose the browser js.
the HTML from Emscripten is patched lightly to add the require script and a couple of require() calls. the standard library is included with preload file; the total size of the served folder is about 3.5MB.
the usability is terrible (have to enter input in a modal form with no history or completion etc, output goes to browser console) but it's a start!
I released an Emscripten port of Dawn, which is an open-source and cross-platform implementation of the WebGPU standard.
Proof-of-concept project, showing that it's possible to run an entire Large Language Model in nothing but a #PDF file.
It uses #Emscripten to compile #llama.cpp into asm.js, which can then be run in the PDF using an old PDF JS injection.
Combined with embedding the entire #LLM file into the PDF with base64, we are able to run LLM inference in nothing but a PDF
Запуск Linux внутри PDF
По мнению некоторых пользователей, PDF — простой формат для обмена документами. На самом деле это очень сложный стандарт, который поддерживает выполнение практически любого кода. Неудивительно, что в прошлые годы энтузиастам удалось успешно запустить Doom внутри PDF и провести ряд других интересных экспериментов. Оказалось, что на этом возможности движка по рендерингу PDF не ограничиваются. Он способен запустить даже эмулятор полноценного процессора, а в нём — целую операционную систему .
https://habr.com/ru/companies/globalsign/articles/898056/
#PDF #Linux #RISCV #LinuxPDF #Doom #DoomPDF #TinyEMU #Emscripten #asmjs #JSLinux #pdfsyntax
I've ported Empty Clip, a 2D role-playing shooter #game from 2006, for the web with #Emscripten. Needs WebGL2!
Boxedwine - Emulator that can run 32-bit Windows programs/games on multiple platforms via Wine.
https://github.com/danoon2/Boxedwine
My latest contribution to the Emscripten project is now live with 4.0.4: a contrib port to easily embed Lua in any project
https://emscripten.org/docs/compiling/Contrib-Ports.html#contrib-lua
Released emscripten-glfw 3.4.0.20250209:
* Added support for touch (mobile)
* Added support for wasm64 (-sMEMORY64 Emscripten option)
GitHub - ading2210/linuxpdf: Linux running inside a PDF file via a RISC-V emulator
Link📌 Summary: 本文介紹了一個名為 LinuxPDF 的專案,該專案使得 Linux 系統可以在 PDF 檔案內透過 RISC-V 模擬器運行。此技術運用到 PDF 檔案格式中所支持的 Javascript,並透過 Emscripten 將 C 程式碼編譯成 asm.js,進一步載入修改過的 TinyEMU 模擬器。雖然在 PDF 中運行 Linux 存在性能問題,但這一創新仍能展示 PDF 檔案的多元性及其潛力。
📢 Scaling multithreaded #WebAssembly applications with mimalloc and WasmFS, by @kripken:
https://web.dev/articles/scaling-multithreaded-webassembly-applications?hl=en. If you have a multithreaded #Wasm application that does lots of allocations or uses files, then you may benefit greatly by using WasmFS and/or mimalloc. Usage in #Emscripten:
```bash
emcc -sWASMFS -sMALLOC=mimalloc
```
I've ported Atomiks, remake of a classic puzzle game from 1990, for the web with #Emscripten. Even mobile friendly!
A port of Doom (1993) that runs inside a PDF file
https://github.com/ading2210/doompdf. Made possible through asm.js and #Emscripten. 🤯
I have a new #programming playground: #WASM with #Emscripten
https://emscripten.org/
I explored this platform some time ago, but had no practical use for it.
But #HTML5 #canvas elements can act as a "screen" for stuff generated or managed in c or #cpp.
Posting user events to a "native" WASM worker and posting back images to the browser's thread makes the browser a virtual machine for classic C programs.
It's not very performant, but sufficient.
And it's pure fun to see that it just works 😁
I've ported Simple Sokoban for the web with #Emscripten. Mobile friendly!
I've ported Starfighter, a side-scrolling shoot 'em up space game for the web with #Emscripten. Even (somewhat) playable on mobile!
I maintain the #Emscripten port of Brogue, a minimal roguelike game, now.