Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What are Nim’s main weaknesses?


Post author here. A few things that make me sad in the pants:

- js doesn't have source maps (kinda of a big deal to me)

- some error messages are head scratchers (seem to remember trying to add things to an immutable array not being clear)

- docs could use love (eg seeing more examples of macros in action)

- devel (their nightly compiler) can be rough (e.g. i found the "strings cannot be null" cutover a bit rocky -- my own damn fault, i can't go back to 0.18 after being on 0.18.1)

- the big one I think, however, is adoption. I keep hearing "i'll just use rust or go". That's legit as they're also awesome.

nim's stdlib is massive (too big?) and there's tonnes of high quality packages out there. You won't be left thinking... well, crap, looks like I need to talk to roll this redis layer myself.

EDIT: Formatting. How does it even work?


I have implemented source maps for the js backend : https://github.com/nim-lang/Nim/pull/7508

They aren't merged yet in the upstream compiler because I wasn't sure if I wanted to refactor the jsgen with them, but otherwise they are almost there: I use them in a personal project in a forked branch


The docs issue and devel being rough are both due to the pre-1.0 status and the smaller community. It's a little bit of a catch-22; you need adoption to gain contributors but people won't adopt until there's enough contributions to make it stable.


yeah, which is usually where big companies help out. Their respect in the tech communities makes people take note of the new technology.

I really really think "underdog" is the best way to describe Nim because of this.


> nim's stdlib is massive (too big?)

It has less modules than Python.


These affect people in different ways but off the top of my head:

- No Nim v1.0 yet, despite this we do our best to create a deprecation path for everything that's possible.

- No big company like Google/Apple supporting the language.

- Community is smaller than that of Go/Rust.


A biggy is that it only really has a single developer, and no big corporate users. And relatedly the library ecosystem is relatively weak. It also has a GC, so it can't be used for really low-level stuff where that is a problem.

It's looking pretty promising though. Especially if you are a fan of python's syntax.


That is not totally true. Nim's own GC is written in Nim. You can turn the GC off.


I use Nim for Cuda, OpenCL and cache-sensitive/memory-bound multithreaded computation.

You can mix and match manual memory management and GC-managed types in the same codebase.


In this very article, which is pretty light on details, one of the few facts presented is that you can disable GC.


Agreed. I purged a bunch of stuff and still feel like I left too much in.

A couple of bonus facts for you:

- they've got an effects tracking system where you can have the compiler track (and whistleblow!) which functions are pure or not

- their multi-phase compiler allows you to read in source code at build time (from files or external programs!)

- their macro system is typesafe as it operates at the AST level

- the guy who created it will always tell you how he feels

- again with their macro system... there are FP libs, pattern matching libs, and OO libs that can "literally" transform the language to fit your preference

- and one more just for you: they don't support tail call optimization (ducks)


> - the guy who created it will always tell you how he feels

What does this mean?


I'm guessing, but I think the OP means that the Nim creator is a bit like Linus Torvalds. He will tell you if he feels your idea is silly, especially if he's argued against that idea hundreds of times already.


it sounds awesome


Two developers at least. One of whom is in this very thread. It's a concern, yes, but actually has been around for more than a decade, and is showing absolutely no sign of slowing down or going into hibernation.

I have just seen a ... competing language team spending developer time on purging the code of what they call ableism. apparently it's now offensive to talk of a sanity check ot to facetiously refer to OCD in a comment.

At least we may hope the Nim team lacks manpower for such idiocy.


Which competing language team?

All I found on Google was this gist of someone saying "sanity check" should be avoided. ("health check, too) [1], and some issues and pull requests in projects that were not languages.

One of the latter is clearly trolling to test Linus Torvalds' resolve to be polite [2][3][4][5], complaining about "ableist/saneist" terms, including "silly", on several of Linus' repositories.

You can tell it is a troll because it is just copying/pasting the exact same complaint, just changing the name of the project. It is not even bothering to change the list of alleged problematic words and their counts, so for example it is claiming that perconvert has 144 occurrences of "sanity check" when it actually has 0. In fact every single claim on that one is wrong. The only word from the complaint actually in pesconvert is stupid, which occurs one time, not the six times claimed. Second sign it is a troll is that it is from a GitHub account created just before the complaints were posted.

[1] https://gist.github.com/seanmhanson/fe370c2d8bd2b3228680e388...

[2] https://github.com/torvalds/uemacs/issues/16

[3] https://github.com/torvalds/linux/pull/595#issuecomment-4236...

[4] https://github.com/torvalds/pesconvert/issues/4

[5] https://github.com/torvalds/test-tlb/issues/5



Submitted by the same person who is trying to troll Linus. Looks like the troll is happy with the result:

> Thank you so much, it's so much more inclusive now. My rabbi will be pleased.


Trouble is the commit is there: The thing has been taken at face value.

This galloping madness is beginning to scare the shit out of me.


No it hasn't.

>We realise it's a troll, but we had an internal discussion and we decided that we wanted to remove these anyway. We're not being terrorised into change just because a (bad) troll appeared, they just happened to bring attention to a real issue.


"We didn't do it because the troll said so, but because the troll said so".

Either way, the decision is ... whichever derogative may not yet be blacklisted, sorry, interdicted.


It has no algebraic data types and pattern matching.


Someone wrote pattern matching as a macro - nim is pretty powerful.



That's the one.


Do you have a reference for that immediately to hand, or should I search for it ...


What algebraic datatypes is Nim missing?

It has generics, tuples, tagged and untagged unions, it even has C++20 concepts.


This is enough to make me keep using C++ for the use cases where Nim is meant to shine, or choose Rust instead. If I'm to learn a modern language, I really expect it to support modern paradigms.

I can see why it'd be interesting to someone with no C/C++ knowledge to get into systems programming though.


Tabs are not allowed for indentation.


Nice. I don't mean to be flippant, but I would consider that a feature.


Preferring spaces for indent?


Being opinionated


My preference is for spaces as well. Sadly, go uses tabs.


const hand* ^^ is that a pointer? Are we moving backwards?


No, it isn't. `*` after a name means that the variable/function/type/etc. is public and can be seen/used when you import a module.

So the whole expression just means "a public constant string (automatically inferred type) named `hand`".


oh, that was a surprise. thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: