When comparing LiveScript vs Nim, the Slant community recommends Nim for most people. In the question“What are the best languages that compile to JavaScript? ”Nim is ranked 7th while LiveScript is ranked 20th. The most important reason people chose Nim is:

Nim has a built-in VM, which executes macros and some other code at compile time. For example, you can check if you're on Windows, and Nim will generate code only for it.

Pros

Pro

Designed for High-level functional code

LiveScript has terse syntax for common functional operations like map, and ships with a library, prelude.ls, with many of the functions most commonly used by functional programmers.

Pro

Good amount of programmer flexibility

There's a huge range of features that can make common tasks faster.

Pro

ECMA 6 Features

It is the declared goal of LiveScript’s creators to track ECMAScript 6. Hence, the language gives you ECMAScript 6 plus type annotations (which are optional).

LiveScript's module syntax is currently a bit behind the ECMAScript 6 specification (something that will be fixed eventually). It supports two module standards: CJS (Node.js) and AMD (RequireJS).

Pro

Fixes coffeescript scoping issues

= is used to declare variables in the current scope, in order to redeclare variables of outer scope := is used. This way bugs are reduced.

Pro

Supported by WebStorm and Visual Studio

Pro

Compile-time execution

Nim has a built-in VM, which executes macros and some other code at compile time. For example, you can check if you're on Windows, and Nim will generate code only for it.

Pro

Really cross-platform

The same code can be used for web, server, desktop and mobile.

Pro

Multi paradigm

Imperative, OOP, functional programming in one language.

Pro

Easy to read

Nim has a lot of common with Python in terms of syntax. Indentation-based syntax, for/while loops.

Pro

Great metaprogramming features

There are generics, templates, macros in Nim. They can allow you to write new DSL for your application, or avoid all boilerplate stuff.

Pro

Easy to integrate with another languages

You can use Nim with any language that can be interfaced with C. There's a tool which helps you to create new C and C++ bindings for Nim - c2nim.Also, you can use Nim with Objective C or even JavaScript (if you're compiling for these backends).

Pro

Strict typing

Checks your code at compile time.

Pro

Built-in Unicode support

You can use unicode names for variables, there is "unicode" module for operations with unicode.

Pro

Type interferencing

You only need to specify types in your procedures and objects - you don't need to specify type when you're creating a new variable (unless you're creating it without initialization).

Pro

Has built-in unittest module

With built-in "unittest" module you can create test with a very readable code.

Pro

Garbage-collected

You don't need to deal with all those manual memory allocations, Nim can take care of it. But also you can use another GC, or tweak it for your real-time application or a game.

Pro

Has built-in async support

Nim has "asyncdispatch" module, which allows you to write async applications.

Pro

Supports UFCS (Unified Function Call Syntax)

writeLine(stdout, "hello") can be written as stdout.writeLine("hello")proc add(a: int): int = a + 5 can be used like 6.add.echo or 6.add().echo()

Ad

Cons

Con

Strong functional lean

LiveScript is designed to be a high level functional language. For people who prefer a more imperative approach it can be hard to get used to.

Con

Still in pre 1.0

Alternative Products

Each month, over 2.8 million people use Slant to find the best products and share their knowledge. Pick the tags you’re passionate about to get a personalized feed and begin contributing your knowledge.