This is the first sweep of work to get turtle to compile with the WebAssembly target wasm32-unknown-unknown. We still have a long way to go until we have full WASM support.
This PR gets us to the point where you can compile to WASM (see the build-wasm script) but we are not yet able to actually render anything. The generated WASM program outputs the JSON commands we would usually send to the renderer process. Those commands still need to be handled before this implementation is complete.
In order to get this to compile, we stubbed out a lot of things like the Event struct. Anything relying on piston was stubbed out with an empty struct or enum. As we add full support, we should move away from tying ourselves to piston too much and create our own Event enums and structs.
One of the problems that will need to be solved is that WebWorkers only support asynchronous communication, so without shared memory it will be really problematic to make turtle work in a browser. If we can't do bidirectional message passing, we can't do things like events, input, etc. and that would really limit the functionality of turtle.
This is the first sweep of work to get turtle to compile with the WebAssembly target
wasm32-unknown-unknown
. We still have a long way to go until we have full WASM support.This PR gets us to the point where you can compile to WASM (see the
build-wasm
script) but we are not yet able to actually render anything. The generated WASM program outputs the JSON commands we would usually send to the renderer process. Those commands still need to be handled before this implementation is complete.In order to get this to compile, we stubbed out a lot of things like the
Event
struct. Anything relying on piston was stubbed out with an empty struct or enum. As we add full support, we should move away from tying ourselves to piston too much and create our ownEvent
enums and structs.One of the problems that will need to be solved is that WebWorkers only support asynchronous communication, so without shared memory it will be really problematic to make turtle work in a browser. If we can't do bidirectional message passing, we can't do things like events, input, etc. and that would really limit the functionality of turtle.