Learning ReScript - Part 1 (Intro, Setup)
Finally I am taking the time to learn ReScript. Follow me on my journey and read how I approach it, mixed with some of my opinions and experiences.
ReScript (see rescript-lang.org) is a strongly-typed programming language that compiles to JavaScript, I call it a types-first language.
It has exhaustiveness built-in from the go, which means more complete error checks by the compiler and more complete code before you deploy.
It infers a lot of types, less types to write.
It also claims to look and
act a lot like JavaScript, which I would not highlight, since the more real typing you
do in ReScript the less it is like JavaScript, naturally (JS is just not typed).
Still I find it very interesting, because I think it really eases the use of (strict) typing,
way more than languages like PureScript. ReScript allows using types in a much more
efficient way than languages like flow or TypeScript because it is typed-first and
not taped onto JavaScript. Curious? Want to follow along learning, then start with
Part 1, and have fun.
Finally I am taking the time to learn ReScript. Follow me on my journey and read how I approach it, mixed with some of my opinions and experiences.
In Part 1 I started with ReScript,
I set up a project
and made my first steps, got it running.
Now I want to learn more and get to the point where I have a feeling for how to use ReScript,
lets see where it takes me. I guess it will take me more than this "Part 2" post to be
comfortable to start a project with ReScript.
The setup is working, I can compile and run ReScript files, I touched a bit on the syntax in Part 2, next I will continue through the docs chapters from top to bottom.
Taking in the rear view mirror for the first time and trying to sum up what I learned from ReScript and compare it to my initial expectations.
seen formatting and first type annotations in part 3, now lets get a bit more concrete with tuples real data structures ftw
parseInt()
Katas
I had planned building the kata for Number.parseInt()
already a while ago.
Starting to work I discovered very quickly that this seemingly tiny kata is quite a
rabbit hole that offers a lot of things one can learn.
Especially about how things evolve in the spec and how to read the spec, fortunately
this is a pretty easy to read part of the spec.
It was the second time that we did Tetris as our task for the JSCodeRetreat and I have to say, that the participants' comment made me realize that we are on the right track. Though not all comments were purely in favor of Tetris, I think Tetris is the better task for a (JS) CodeRetreat.
It was Evren who triggered the idea of using Tetris as the task for the next JSCodeRetreat. And I have to say it was a good idea, it was a bit more challenging than the Game of Life and left more room for discussions and also allowed to explore more (software) design challenges.
The callback-hell times are long over. We have better tools now. But which of the new kids on the block do you want to play with? In this meetup, last night we tried out async functions, also known by the name "async/await". It was a fun learning experience. Keep reading and get inspired.