Often learning a new programming language like ReasonML can be an arduous process as you have to set up the environment and tooling before you can begin learning.
That's where Sketch.sh by Nguyen Dang Khoa comes in. It's an online service addressing the problem for Reason.
Hey. My name is Nguyen Dang Khoa. I'm a freelancer from Viet Nam. I usually work on React.js/Node.js/ReasonML projects, and I built Sketch.sh.
You can think of Sketch.sh as a notebook with an integrated code editor. You can execute ReasonML/OCaml code and get the results immediately.
OCaml has its own virtual machine called ocamlrun
for executing the bytecode produced by ocamlc
. Here is an overview of OCaml's compilation targets:
js_of_ocaml is an OCaml-to-JavaScript compiler. Sketch.sh works by using js_of_ocaml
to compile ocamlc
and ocamlrun
to JavaScript and then executes user's input code by calling these tools.
Some solutions like repl.it, nextjournal offer the same functionality, but all the code execution is done server-side. They developed a special server infrastructure to handle this kind of work. With Sketch.sh, everything is executed inside the user's browser. Sketch.sh's server is used for saving, handling authentication, and many other things.
ReasonML is a fully typed language with a strong inference engine so you rarely see any code annotations. This is a big problem when helping others with their bug/coding issues; I have to open the terminal, run the compiler each time. I created Sketch.sh to reduce the friction when asking questions about ReasonML.
Currently, the process looks like this:
How cool is that?
I'm currently working on supporting BuckleScript and ReasonReact as well as improving SEO, discoverability of popular sketches.
Becoming a developer is getting more comfortable every day since there are tons of tools that help you learn about web development without leaving the browser. I hope that Sketch.sh will be part of that trend for folks who want to learn about ReasonML and web development in general.
Learn the basics first, JavaScript, HTML, and CSS. It will benefit you in the long run. Frameworks come and go, only the languages (JavaScript) stay. If you know JavaScript, you can adapt to any frameworks (React, Angular, Vue, Ember, and so on).
If you're interested in Sketch.sh or working on some challenging UI, come around and say hi at @sketch_sh.
Thanks for the interview, Nguyen! I think Sketch.sh is a great boon for people interested in Reason and also for those who want to support people learning it as it allows you to illustrate the usage of the language in a convenient manner.
You can [try Sketch.sh online](https://sketch.sh) and also [check out the code at Github](https://github.com/Sketch-sh/sketch-sh/).