We are currently building an educational tool where students can write Scala 3 code in a browser window to solve exercises but with some restrictions: for example, if we want students to implement data structures and algorithms by themselves and not import them straight away, we have made compiler plugins that detect such code. This already works if the student is working in their own IDE and submits the code to a compile and automatic grader server where the plugin actually resides.
Now, we want to implement this in a browser where the compiler immediately underlines the forbidden code. This already works in the IDE as the language server can show error messages from the compiler plugin even when just writing the code without compiling.
We would greatly appreciate suggestions for workflows around this issue. Thanks!
The goal here is to bring the entire Scala 3 compiler to clientside in the browser via WASM, so we don’t want to compile anything serverside. I suppose there must be some VM that can do this?
Thanks you! How would I build the compiler from source? We managed to get the index.html to render in browser but the compiler manifest of course could not be fetched.
I built it locally on one of my ubuntu 24.04 boxes, but I could not get it to work as I did not know how to get my Firefox nor my Chromium browser to expose the wasm stuff. It says it compiles the pre-filled hello-world main, but then nothing happens.
Great to know! I found the settings in chromium to enable webasm and it says it compiles but still no “Hello world” is printed for me. I’ll fiddle some more during the weekend if I get the time.