When comparing Nim vs Javascript / GitHub Electron, the Slant community recommends Nim for most people. In the question“What are the best languages to write a desktop Linux application in?” Nim is ranked 14th while Javascript / GitHub Electron is ranked 17th. The most important reason people chose Nim is:
There are generics, templates, macros in Nim. They can allow you to write new DSL for your application, or avoid all boilerplate stuff.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
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 Strict typing
Checks your code at compile time.
Pro Has built-in unittest module
With built-in "unittest" module you can create test with a very readable code.
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 Has built-in async support
Nim has "asyncdispatch" module, which allows you to write async applications.
Pro Really cross-platform
The same code can be used for web, server, desktop and mobile.
Pro Easy to read
Nim has a lot of common with Python in terms of syntax. Indentation-based syntax, for/while loops.
Pro Multi paradigm
Imperative, OOP, functional programming in one language.
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 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 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 Built-in Unicode support
You can use unicode names for variables, there is "unicode" module for operations with unicode.
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 Works on Linux, Windows, Mac
Being powered by Javascript, apps build with Electron can be packed to run on all 3 platforms.

Pro Wide spread support
Javascript is a very easy language to learn, and is handy for all manner of other things. There's a good chance you already know it, or that you will need to know it in the future.
Pro WebApps without additional work
If you don't require native features and could write a web app (i.e. a website with dynamic elements), then you could just extend it and turn it into a native app. This means that people just need to type your URL to use you app and may get more by downloading and installing it.
Cons
Con Low performance
Electron applications use significantly more CPU, RAM, and disk space than applications written in almost any other framework. This results in poor battery life as well as an unpleasant user experience.
Con Backwards incompatibility between versions
Electron is growing and constantly changing, but there is no care whatsoever whether the changes in a new version will break your application or not. Even if you write and maintain one app, changes to how Electron handles JS files and functions will make maintenance of a single app your full time job. Even the development process, programming mindset and tooling changes between versions, so there is no guarantee that your app will even have a proper architecture a year from when you've built it.
