Limited Time Offer for New Clients: FREE website migration + 3 months FREE hosting/maintenance. Get started
×

Review of Transpilers [Part 2]

Looking to save money
on your website?

Answer a quick question to see our specials.

Have a website that needs
some updating?
Want to move away from
your current web host?
Need to bring more
visitors to your website?

3 FREE months of hosting and maintenance

FREE website migration to our platform

FREE Digital marketing analysis to help drive results

Fill out this form today to get started.

* This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

IN NOVA FERT ANIMUS MUTATAS DICERE FORMAS
CORPORA; DI, COEPTIS (NAM VOS MUTASTIS ET ILLAS)
ADSPIRATE MEIS PRIMAQUE AB ORIGINE MUNDI
AD MEA PERPETUUM DEDUCITE TEMPORA CARMEN!

I want to speak about bodies changed into new forms.
You, gods, since you are the ones who alter these, and all other things,
inspire my attempt, and spin out a continuous thread of words,
from the world’s first origins to my own time.

Metamorphoses” by Ovid

Transpilation is the process of compiling source code written in one language to generate source code for a desired target language. With the ubiquity of JavaScript used not only in almost all modern web browsers but also in a growing number of server-side applications, a new generation of transpilers that target the generation of ECMA-compliant JavaScript have emerged to provide developers with a robust set of tools to develop efficient and elegant source-to-source solutions.

The motivation behind the transpilation process is that it accelerates the use of next-generation language syntax and language features while helping to ensure that the adoption of the language features results in browser-compatible JavaScript that meets the functional goals of applications.

In Part 1 of this series, two example transpilers were reviewed: TypeScript and Fable. In this second article, Babel and Nim are reviewed.

Babel

Babel allows developers to write code utilizing modern features of JavaScript without worrying about browser compatibility. It does this by transforming code into the older ES5 standard (a since-revised standard on which JavaScript is based). It is updated with yearly modules, collected together in a master preset that contains all changes since ES5. This lets developers use such features as classes, arrow functions, multiline strings, destructuring, and generators/iterators.

The Babel website includes a page of basic examples, linked to a “Try it Out” page that shows how Babel transforms pieces of code.

Nim

Nim is a program language capable of compiling into C-family languages (C, C++, Objective-C) and JavaScript. Note that Javascript compilation is considered an experimental feature and is presented with a list of restrictions in the documentation. Nim allows performance-enhancing optimizations at the compilation level and is extensible through templates, macros, and external libraries. It has also performed relatively well in benchmark testing.

Here are a few links for further exploration of the Nim language:

Blogger Dennis Felsing has provided an excellent, feature-by-feature overview of Nim’s capabilities.

Babel vs. Nim: Who Rules the Web? Check out our latest technical blog to find out. Our software developers are totally geeking out rn.

Let's Connect

Need expertise and innovation on your project? Our team can help.

What are you looking to do?

* This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The latest trends & topics