Minimal VSCode with reason-vscode


I’m hoping to move some coursework in my introductory CS course from Ocaml to Reason, and perhaps to use VSCode as a “development environment”. I put that in quotation marks because the largest programs students will write are perhaps a few hundred lines. They’re used to writing Racket code in DrRacket, where they can type code and easily run it from within the same interface, and it appears that reason-vscode might provide that within VSCode. [Please correct me if I’ve misunderstood this!]

To be clear: I’m an utter novice here. I’ve never used VSCode, and never written a Reason program.

I installed VSCode on my Macbook; i added the reason-vscode extension. I created a new “.re” file on the desktop containing only this:

let a = 4;

and I was hoping to be able to run this minimal program and see something like

val a:int = 4

I tried Debug…Start Without Debugging, and was prompted to “Select Environment”, with Node.js as the only alternative, so I selected that, and got a warning “Cannot find a program to debug.”

In doing this, I was trying to follow the hints given at, which seemed to suggest “Get VSCode; install the reason-vscode extension; do stuff!”, but it appears that at a bare minimum, there’s an expectation that a bunch of other things are installed. Given how Reason appears to work, some BuckleScript stuff, and Node.js, seem to be a bare minimum.

If someone can help me get a minimal setup working, I’ll produce a document that says how to do it step-by-step (for the benefit of my class) and share it widely, helping avoid stupid questions like this one in the future.

By the way, I’d be completely happy with pointers to other things I can read.


Hi, have you checked out ? It sounds like that’s exactly what you’re looking for.


What you’re looking for sounds like an REPL. Reason/Ocaml has one and it’s called rtop/utop. But it comes with a terminal interface. is an UI on top of rtop/utop that provides what you need. You should check it out.

#4 does indeed look useful as a way to introduce students to the language with minimal overhead — it could be perfect for a first lab session in which they get to play with ReasonML and compare it to Racket (which they’ll have been using up to that point). But I really would like something a little closer to an IDE. So while I’m grateful for the suggestion, I’ll repeat the question I asked (or a better-phrased version of it):

“Can someone tell me the minimal setup needed to make “VSCode + the reason-vsode extension” actually work for developing small reason programs completely within VSCode?”

I’m working on a mac, but I assume that this is pretty much irrelevant, and I CAN work on a Windows or Linux machine if providing an answer for either of those is easier for some reason. Also, I’d be happy to be given a list of all the reason-related tools you have installed, and then reduce them down myself, if that’s easier for someone to provide.

Thanks in advance for any help.


Gotcha. So for an IDE-like experience in Reason the standard recommendation is to use VSCode + reason-vscode. The main issue with using a more IDE-oriented tooling is that you will need to do an upfront investment in getting students set up and familiarized with a build system. Either they will need to use the BuckleScript tooling, which will produce JavaScript output that will need to be run in a browser or NodeJS, or they will need to use dune, which will produce native output. Either way, each build system will require some getting used to.

So you’ll need to make a decision about which path you want to go.

There are a couple of other factors, like what kind of development workflow you’re looking for. Using dune allows you to load and run parts of the project in a REPL (but as far as I know only with OCaml syntax, not with Reason syntax). Using BuckleScript allows you to run output JS in the NodeJS REPL to test it out. The REPL situation is not very well-developed.


I think that the NodeJS solution is the way to go in our particular context. (It feeds at least a little bit into one later course, and it means avoiding OCaml syntax and its … uh … idiosyncracies, which is part of why I wanted to move to Reason in the first place.)

So assuming that the NodeJS solution is how I’d like to go, what’s involved in going from a basic ReasonML program like my

let a = 4;

to seeing output like

val a:int = 4

in some window in VSCode? I take it that to do such a thing, I need something like a “makefile”, probably in some directory related to the location of my source-code. I’d be happy if someone could give me a pointer to getting such a thing set up for tiny programs like mine, rather than ones that will interact with web pages, etc., and require multiple bits of scaffolding.


The recommended installation and setup steps are covered in . That all assumes that you have NodeJS installed. (A little Reason plug: is a nifty tool to manage Node versions.)

VSCode setup is covered in

The VSCode plugin shows signatures like let a: int = 4 immediately on the line above any binding (in the editor window itself).

For a BuckleScript project (i.e. compile to JavaScript), new project setup is covered in


Thanks very much. I’ll try those, and return if I find myself unable to make progress.


It’s a pity CodeSandbox doesn’t support custom extensions and doesn’t include reason-vscode out of the box (which is a little weird given they have a Reason Template. Because CodeSandbox basically is an online version of VS Code and it does run Reason. Note that this sandbox differs very little from what you get creating a sandbox using Reason template. I’ve just thrown away React )

But anyway, going with BuckleScript has an upside of being able to use CodeSandbox as well as VS Code proper, which might prove useful while you’re learning.


Actually you just reminded me that supports ReasonML in an IDE-like experience fully online.

@jfh you might try this out, no install required:


you can’t get such output when using Bucklescript


Woah :open_mouth: !!!

fnm is great and really fast !