Somewhat related. Your QOI lossless file format coupled with 7Zip outperfoms lossless PNG. Amazing work!
Porting my JavaScript game engine to C for no reason
11–20 of 139 posts
Re: Porting my JavaScript game engine to C for no reason
#12now rewrite it back to JS with https://github.com/KilledByAPixel/LittleJS j/k :D
Re: Porting my JavaScript game engine to C for no reason
#13Re: Porting my JavaScript game engine to C for no reason
#14now rewrite it back to JS with https://github.com/KilledByAPixel/LittleJS j/k :D
Re: Porting my JavaScript game engine to C for no reason
#15Re: Porting my JavaScript game engine to C for no reason
#16now rewrite it back to JS with https://github.com/KilledByAPixel/LittleJS j/k :D
Why, from C to Zig, from Zig to Rust. Compile the Rust version to WASM to finally make it runnable in the browser.
e.g. https://killedbyapixel.github.io/LittleJS/examples/stress/
Re: Porting my JavaScript game engine to C for no reason
#17With WASM it might actually run faster in the browser as well.
Re: Porting my JavaScript game engine to C for no reason
#18Earlier quoted context omitted.
Why, from C to Zig, from Zig to Rust. Compile the Rust version to WASM to finally make it runnable in the browser.
Doesn't Zig compile to WASM too?
https://floooh.github.io/pacman.zig/pacman.html
The Git repo is here:
https://github.com/floooh/pacman.zig
...in this specific project, the Emscripten SDK is used for the link step (while compilation to WASM is handled by the Zig compiler, both for the Zig and C sources).
The Emscripten linker enables the 'embedded Javascript' EM_JS magic used by the C headers, and it also does additional WASM optimizations via Binaryen, and creating the .html and .js shim file needed for running WASM in browsers.
It's also possible to create WASM apps running in browsers using only the Zig toolchain, but this requires solving those same problems in a different way.
Re: Porting my JavaScript game engine to C for no reason
#19With WASM it might actually run faster in the browser as well.
Years back I wrote a standalone Canvas2D implementation[1] that outperforms browsers by a lot. Sure, it's missing some features (e.g. text shadows), but I can't think of any reason for browser implementations needing to be _that_ slow.
Re: Porting my JavaScript game engine to C for no reason
#20With WASM it might actually run faster in the browser as well.
WASM still needs better multi-threaded support. We built a game in Bevy and it took minutes to sequentially load in all of the assets.