top | item 29407796

(no title)

daredevildave | 4 years ago

PlayCanvas[0] is the probably the closest "web-first" solution compared to Unity. Used by lots of Snap Games & Instant Games. It's written in JS which means that it's way smaller ~350kB for an empty scene if I recall.

[0] https://playcanvas.com

discuss

order

jordwest|4 years ago

> It's written in JS which means that it's way smaller

There's nothing inherently large about WebAssembly, it's just that most practical wasm demos bundle emscripten (essentially an entire OS's standard library) or another very heavy layer in order to interop between the JS and WASM world.

As a bit of an experiment to see how small wasm could practically be with a minimal interop layer, I built this little project - the web demo is 90KB of JS + 70KB of wasm:

https://github.com/jordwest/cavernos

It was heavily inspired by this article which manages even smaller builds:

http://cliffle.com/blog/bare-metal-wasm/

There's a lot of room for improvement in terms of size optimisation in most projects, but it's still early days and for now most of them just bundle an OS compatibility layer to get things working quickly.