several months ago I already asked if somebody knows how to include an online-REPL into a website, because a colleague and I would write an online lesson about FP with Elm. Include online REPL
For the first part it would still be great to have an online-REPL, because at schools, there is often the problem that you cannot install arbitrary software and it is often prohibited to open the terminal. Ideally, it would be a REPL like the one in the official guide, where individual code fragments are provided that can be further explored in the REPL. However, a blank REPL that is just linked as an alternative to the terminal would also be sufficient. Unfortunately, neither of us is particularly skilled in JavaScript, and we are not Elm experts either. As far as I know, the online REPL is connected to a server that executes the Elm code and then sends back the response.
You might be interested in Discover Functional Programming with Elm. I don’t know if they have the time to help but they’ve done some “run Elm for a website”. Might also be worth asking @terezka how the Elm try page works as that’s similar.
The Try Elm! and all other solutions I’ve seen so far always communicate with a server.
I think something running in the browser without a server backend would be optimal for teaching programming concepts.
Maybe you can have a look at elm-interpreter and adapt it?
Execution speed should not be a big issue for smaller snippets and having a repl, and maybe there is even more progress that was not shared yet?
I think @miniBill or @jxxcarlson could be good contacts to ask.
I did some work on an Elm Notebook project a while back. The main idea is to have notebooks with cells of either markdown text or Elm code. You evaluate the code by ctrl-enter or using the buttons. Evaluation works by talking to the Elm compiler so that you get good error messages.
I hadn’t used this app in a while and going back to it now I find the UI in need of MUCH work! Maybe useful for teaching functional programming, but needs a lot of work.
After some trial and error, I was able to get elm-interpreter up and running. It looks very impressive. But from what I can tell, there doesn’t seem to be an obvious way to get Elm compiler error messages.
@jxxcarlson : I have seen elm-notebook.org before, and to me that is also very impressive. It doesn’t directly fit my needs, but technically it should be pretty close. If you are willing to help that would be fantastic!
If there would be a version that is just a simple REPL, that would already be great.
Another version I could imagine is something like a very simple version of Thonny (and similar IDEs for Python) where you put your Elm-Code in the upper area and use it in in the REPL below: