Are there any plans for an online REPL for Rescript?

I think the playground is amazing, I love the new additions like types on hover! I was wondering if there are any plans in the works for a playground that executes the code, and not just shows the compiled output? Something along the lines of https://svelte.dev/examples#hello-world that renders the components would be awesome for sharing snippets or creating examples!

3 Likes

Hey,

We’re (me and my friends from the ReScript Brazil community) planning to develop a very similar project. We call it “ReScript Learning Lab”. It will be more than a simple tutorial, we want to help the newcomers to learn the language from the beginning to the intermediate. Probably we’ll develop a REPL / Playground that not just shows the output, but executes and renders the components.

If there are any plans for the official playground to implement a feature that executes the code and show a preview, we would be happy to help :slight_smile:

4 Likes

Yeah, we want to eval the code at some point (that’s what you mean by REPL I believe?).

The current playground handles multiple versions of the playground bundle, which means you have different versions of runtime libraries (stdlib, rescript-react). Unload / reload JS files is a little tricky; it’s important to make sure you are not mixing runtimes (playground / cmijs).

So if you figure out a way to load the playground bundle / runtime libs (wüespecially in a web worker), we can integrate it in the playground.

1 Like

Just remembered that I talked about the problems in one of my stream recordings: https://www.youtube.com/watch?v=ki62RbVDVDQ

I would be interested to see codepen enhanced for this use case as well.

Maybe it’d be valuable to get a first-class template on https://codesandbox.io — they’ve had first-class reason lol support for some time.

1 Like

I went ahead and got a functional codesandbox template working:

Obviously the big issue is no syntax support.

2 Likes

I realise this thread is a year old, but I found out recently that its easy to use https://www.gitpod.io to run rescript online in an online vscode with the rescript extension installed.

I created a repo here with the required .gitpod.yml file: https://github.com/Darkle/gitpod-rescript

To run, all you need to do is click on: https://www.gitpod.io/#https://github.com/Darkle/gitpod-rescript and it will ask you to login with github and then you will have vscode with rescript running in the browser.

I’m not affiliated with them btw, i just thought this was cool.

4 Likes