Yet Another Javascript Alternative: ReScript

Yet Another Javascript Alternative: ReScript

Yet another Javascript alternative: ReScript - Did we really need another one? Do we need yet another JavaScript alternative? Should we stop playing around with these languages and start using JS accepting its flaws and defects? Aren’t we tired of alternatives popping up every year?

Did we really need another one?

CoffeeScript, TypeScript, PureScript and now we also have  ReScript. Granted, it’s not “new new”, but it’s recent and it’s trying to take the place of the good old, and Microsoft-backed, TypeScript.

So what do you think? Do we need yet another JavaScript alternative? Should we stop playing around with these languages and start using JS accepting its flaws and defects? Aren’t we tired of alternatives popping up every year?

Welp, apparently no, we aren’t.

What’s the deal with ReScript?

Really, what makes it different from all alternatives?

Like many of them, it’s an opinionated version of what JavaScript with a strongly typed system should look like. According to their website (and from the tests I’ve made myself), the type system is:

  • Better than Typescript’s because it’s simpler and inferred. Yes, TS can infer some types but it doesn’t encourage you to let it do it. However ReScript does and their interpreter is quite good at catching those typing errors.
  • Static, because it’s not used during runtime. Which if you ask me, it’s an oversimplification of the problem. But who asked me? Nobody. According to them, the static inference during compilation is all you need to make sure your code is safe from those nasty bugs.
  • Fast. And I can attest to that after my tests with the language. With the  VSCode plugin, all you have to do is save the file and you’ll get immediate feedback.

Granted, their type system sounds awesome, but that’s not all they try to sell you as a better alternative to TS. There is the fact that they don’t try to be a superset of JavaScript, but rather a curated list of features.

That means they distilled the original language into what they deemed appropriate (thus, the opinionated part). In practice this means you don’t have constructs such as classes, loose global objects such as console or semicolons for that matter (that’s right, they finally settled that age-old argument: semicolons aren’t needed, deal with it).

For you, as a JavaScript (or TypeScript) developer looking to educate yourself on a new thing means you have to re-learn the language. It’s not just about adding type annotations with RS, you have to re-learn how everything works. Is it too much of a hustle? For the basic stuff not really, especially not if you’ve also worked with other languages such as Ruby or Python.

nodejs programming javascript react

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

Increase Performance of React Applications Via Array JavaScript Methods

Increase Performance of React Applications Via Array JavaScript Methods. We will create a simple event management application in the react to add, update, and delete an event.

Learn React and JavaScript Programming Basics with Example Code

Learn React and JavaScript Programming Basics with Example Code. How does modern JavaScript knowledge make you an efficient React developer? What kind of changes do you need in your mindset when you design and develop a React application? How to Use Let and Const in JavaScript. How to Use Template Literals in JavaScript. How to Import and Export Modules in JavaScript. How to Use Arrow Functions in JavaScript. How Destructuring Works in JavaScript. How the Spread Operator and Rest Parameter Work in JavaScript. How to Use Classes in JavaScript

React cloneElement: A Better Way to Build a Component API Props in ES6 Javascript and Ts

Using the React cloneElement is a better way to build a component API props in ES6 Javascript and Typescript. Here's a tutorial on how to do so.

React Component Lifecycle Methods With React Hooks

For working with any tech you must know the lifecycle. When writing React components, we need access to lifecycle events to handle a variety of side effects: like fetching data on mount, changing props when the component updates, cleaning up before the component unmounts, etc.