Beginner project you can play with

I did a ReScript intro workshop yesterday, which was a lot of fun. Forty-one people signed up and were introduced to ReScript while we built a small calculator.

If you want a fun project to play with, have a look at this repo.

The main branch contains a complete boilerplate project for vs code with recommendations for the extension you need and useful defaults settings.

It’s using ReScript, React, TailwindCSS and Vite.js, so if you need a boilerplate for using these technologies, you can use the main branch as a starter repo.

But if you’d like to try and build your calculator as well, there’s also an example branch with a finished calculator you can look at. It uses variants, pattern matching, and a mini “xstate” state machine for handling all the logic. You can see an example of the finished calculator here.

Feel free to ask questions here or directly in the repo.

6 Likes

Wow, this is really nice @mellson ! Great showcase of the power of ReScript and variants when dealing with state like this. Great work! :clap:

1 Like

Thank you @zth :blush: It’s hard to find the right balance for small projects, but a small calculator was my best idea for this workshop. And even though you’re not interested in building a calculator maybe it’s just nice to get some boilerplate for running ReScript in Vite.js which feels just as fast as the ReScript compiler :rocket: