Questions up front:

For the Nim roadmap, how much attention is going to be spent improving the backends besides C? Will the js backend be considered a part of the official 1.0 release?

Are there plans for other official backends in the future?


Excitement:

I wanted to quickly prototype some visualizations for some graph data I was working with. Picked out a Javascript library like visjs or d3js to learn and decided to try writing an example in Nim. The experience was wonderfully simple after a tiny bit of poking around jsffi.nim and dom.nim.

grapher.nim

import dom, jsconsole, jsffi

var vis {.importc.}: JsObject

var
  nodes = @[
    JsObject{id: 1, label: "Node 1"},
    JsObject{id: 2, label: "Node 2"},
  ]
  edges = @[
    JsObject{"from": 1, "to": 2, "arrows": "to"},
  ]
  options = JsObject{
    "autoResize": true,
    "height": "100%".cstring,
    "width": "100%".cstring,
  }

when isMainModule:
  let container = document.querySelector("#network")
  var data = JsObject{"nodes": toJs nodes, "edges": toJs edges}
  var network = jsnew vis.Network(container, data, options)
  
  console.log(network)

index.html

<html>
  <head>
    <title>Grapher</title>
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css" />
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
  </head>
  <body>
    <div id="network"></div>
    <script src="nimcache/grapher.js"></script>
  </body>
</html>

What a lovely experience. Just geeking out about it

2018-01-10 01:47:57
Well bugs are bugs and only critical bugs are scheduled to be fixed before v1. The JS backend is not special in this regard, it's widely used and quite stable too. https://github.com/nim-lang/Nim/issues/4470 seems to be the worst offender here.
2018-01-10 07:34:18

Our caveman ancestors had this silly belief that a tool should "do one thing and do it well"...

But then came Nim!

Nim does everything!

It slices, it dices, it generates code that generates code that generates code...

Write a kernel in Nim. Write your Web client-side in Nim. Earlier today I rewrote some shell scripts in Nim. It's SQL. It's even Haskell!

I predict that soon Nim will compile to DNA, subatomic particles, music videos, sexual fantasies, and even tactless bizarre forum rants that go on and on and don't really have a point...

2018-01-11 08:32:27

I predict that soon Nim will compile to DNA, subatomic particles, music videos, sexual fantasies, and even tactless bizarre forum rants that go on and on and don't really have a point...

Don't mistake Nim for Haxe : P

2018-01-11 12:42:03