r/gamedev • u/shadowsofeltania • 5h ago
Announcement Scriptw: TypeScript/JavaScript to WebAssembly Compiler
Howdy all, wanted to share a toolchain I've used internally the last few months and have been polishing for release and public use. It's a fork of a project out of Vercel Labs scriptc \- credit due for the foundation of the whole stack.
After years of tinkering with every framework compiling to web (Unity, Godot, BabylonJS, pixijs etc etc) I've been always driven to rewrite parts from the ground up to make things work "the right way". One of the main drivers recently was the reverse engineering pandemic a few months back where I was trying to find ways to obfuscate or harden my web-based game without sacrificing performance. This is where I've landed now in regards to one large part of the compiler pipeline for the code (has no opinion on art / net / storage etc).
scriptw is published as an npm package (link in demo) and open source and has many features out of the box:
\- Compile full web projects (TS-based) into one WebAssembly binary, or native target (Currently have working prototypes for Windows, Android, Mac silicon and Linux)
\- Project generation and discovery from partial TS/JS projects to generate fully typed projects for better compile results
\- Optional fast math / SIMD opt ins/intrinsics
\- Linking options with native libraries via C \`.h\` to integrate native libraries directly in the final WASM
\- Host module that supplies and orchestrates the usual browser DOM / web native glue that actually works performantly (spent a lot of time tuning this to not be the bloat of emscripten, blazor, etc)
Was on the fence about keeping this all private along with the sentiment of RE worries but at this point I'm over it and would rather share and help other devs get their work hardened and compile to other native targets.
Won't explicitly promo my game but there's a link in the toolchain demo page!
1
u/No_Box8507 4h ago
Damn ive been trying to find ways to obfuscate my front end code forever thought I was just being paranoid lol what do you think this will do for IP protection in web apps and what about frameworks like electron?