Most websites that support something like this for compiled languages hit an HTTP API to compile the code.
try.purescript.org exists (though I’m not sure what kind of throughput it can handle), otherwise you can host your own instance of it and call the appropriate API.
Otherwise, you can stage your build to compile and include your code examples at build time. Then you don’t need to do any compiling at all at runtime.
Sorry, I really don’t want to make requests to external servers; I’d like everything to work on the user’s computer without depending on network access and server availability.
A crude solution would be to make a system call to the Purescript compiler, but I’m not sure how this works depending on the user’s Purescript installation (in my case for instance I don’t know how to call the compiler itself, I only have
What I was hoping to find is an interface to the Purescript compiler from within Purescript, like hint in Haskell.
There is no recent implementation of the PureScript compiler that runs in the browser, unfortunately.