I wasn't going to post this but I decided I wanted to share it
I've been working on a web demo for my programming language margarine. Currently it compiles via LLVM on my mac mini and ships back a runnable wasm file
I don't know how to feel about it, honestly. I'd been working on this on and off for the past 4 years or so. It has had value types, reference types, a garbage collector, a custom VM, compiled directly to wasm, LLVM, back to custom VM, back to LLVM
But yeah. Stuff. We're back to pure value types with Rc as an escape hatch for mutation. Not sure what else to say
OH! WASM and loops!
So when building this demo I ran into an issue where if you did loop {} the browser would start lagging a lot & eventually the tab would crash. The solution I came up with was to insert a function call to yield the runtime at the end of every LLVM basic block. This is applied after LLVM optimisations. It calls the function and the function checks if 8ms has passed, if so it yields to the browser.
So far it seems to work fine but I'm open to suggestions