Follow

So, as a hobbyist Go programmer, I'm trying out Nim now that it's hit 1.0, and so far Only like what I see.

I'd been interested in it in the past, but had lost interest for some reason, I forget exactly what.

Probably because I was trying to bite off more that I should have tried to chew at once with it.

But, my jumplist manager program was literally half as long in Nim as it was in Go, which is a compelling start.

idea.junglecoder.com/view/idea

On the other hand, I doubt Nim will ever have quite the same level of network effects as Go, whicheans I'd probably have to roll more of my own stuff when it comes to things like markdown parsers (they do exist in Nim, but I don't know what combination of features they support), RSS feed generators and other niceties of web dev.

I'm less worried about that than I would be in say, Erlang, since Nim can hook into C so much easier than either Erlang or Go

But Nim should make a much better language to write other languages and VM-type stuff in, between the better metaprogramming, and even just having access to generics. It also helps that Nim compiles to C, and has access to some of the same GCC techniques for writing high performance VMs, or so I'm told.

But even barring that, not having as many runtime requirements should make it to, for example, use Nim as a compile-to-js language.

Most of this is currently speculative right now. My next plan with Nim is to try and port my idea-wiki code from Erlang to it. I dunno how long that will take, but I'm expecting Jester+a Nim/c markdown parser+a SQLite database to be easier pickings, and maybe even less code and fuss for me than Erlang+an Erlang markdown parser+dets+cowboy

The biggest thing about Nim that I'm 50/50 about so far is the namespacing. It definitely feels like a Haskell or an Ocaml in that regard:

- By default, procs are statically dispatched, which is fine
- But, unlike Go, it's harder to visually scan code and see where different parts of it come from.
- Many functions have many overloads, and when you get type errors, so far they are of the "none of the 5-10 overloads of this function you're trying to call are a match.

I suppose the core difference is that Nim dumps imported names into your current namespace without any required prefixing, and expects you to forward declare any functions not yet defined that you reference.

That feels like F#, and both seem rather strange after using Go and Lua.

Overall, that feels a little sloppy compared to Go's or Lua'a namespacing tools. (Though both Go and Lua can operate that way if you want them too)

And the namespacing differences show, a bit:

Go projects tend to be split into multiple files by default, from what I can tell, where I think Nim code tends to be more likely to be in a single, bigger file. At least from what I can see.

But, for better metaprogramming, better C interop, and (hopefully) having to write less code on balance? I'm willing to get used to a different namespacing aesthetic to get there.

Go is nice, and has some great libraries, but I'm ready to try something else.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!