When comparing Nim vs ClojureScript, the Slant community recommends Nim for most people. In the question“What is the best programming language to learn first?” Nim is ranked 14th while ClojureScript is ranked 37th. The most important reason people chose Nim is:
Checks your code at compile time.
Ranked in these QuestionsQuestion Ranking
Pro Strict typing
Checks your code at compile time.
Pro Really crossplatform
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 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 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 Built-in Unicode support
You can use unicode names for variables, there is "unicode" module for operations with unicode
Pro Compile-time execution
Nim has 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 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
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 you real-time application or a game
Pro Has built-in unittest module
With built-in "unittest" module you can create test with a very readable code
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()
Pro Live interactive programming with figwheel
Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding! Every time you save your ClojureScript source file, the changes are sent to the browser so that you can see the effects of modifying your code in real time.
Pro Share application logic between browser and Clojure server
Clojure is also able to run web servers, so one can reap similar benefits to NodeJS in terms of sharing code between client and server.
Pro Simple syntax
Lispness makes ClojureScript trivial to comprehend after an initial learning overhead.
Clojure and ClojureScript are designed to be able to interact with their host. So the language by design makes it is easy to use existing JS libraries.
Pro Can be used with React out of the box
Pro The Spec core library
From the creator of Clojure:
Spec is a new core library (Clojure 1.9 and Clojurescript) to support data and function specifications in Clojure.
Writing a spec should enable automatic: Validation, Error reporting, Destructuring, Instrumentation, Test-data generation and Generative test generation.
Pro Excellent build tools
Both Leiningen and Boot are great build tools that manage code dependencies and deployment.
Pro Excellent tools for web development
ClojureScript has superb wrappers around React.js (see Reagent) that make building single-page apps a breeze. With figwheel, it's a web dev experience unlike any other -- hotloaded code, repl interaction, and instantly reflected changes make good development fun and fast. You can add things like Garden to make CSS-writing part of the same holistic experience and suddenly all development is a pleasant, smooth process.
Con Still in pre 1.0
Not very stable and has a rather small community.
Con Syntax may seem cryptic to people not used to Lisp