Nim Version 1.6.6 Released
nim-lang.org
nim-lang.org
While the main team works on bigger things drawing v2 closer, there's still lots of issues of various magnitude and lots of housekeeping bits that can be done while getting yourself acquainted with the project's structure.
Here's a few links for your consideration:
* https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aope...
* https://dev.to/xflywind/best-ways-to-make-your-first-contrib...
As for numpy there are libraries that allow you to work with Python from Nim, and vice-versa. Not entirely sure how well they work for numpy as I haven't tried that myself. But there are also packages which does similar things in Nim. However packages will probably be your biggest hurdle when converting stuff to Nim. The Nim ecosystem is definitely smaller than Pythons, so it's a bit hit-or-miss if it has the packages you need for your specific usecases. You are more than welcome to join the Discord/IRC/Matrix room and ask around though.
My nim solutions were actually more concise than my JS code when doing some Advent Of Code puzzles.
And it has nimpy which is a bridge to the Python world though I haven't used it personally.
The only downside I can think of regarding nim is that the standard library is OK-ish I guess but not great. Still needs some work but I think they are aware of it.
I find it even more productive than python thanks to the typing system. An often neglected highlight that I appreciate a lot is the fact that static typing + procedure overload has the additional benefit that names of functions tend to be very natural (you can reuse the name of function if the type signature is different). That along with UFCS (universal function call syntax), allows to create great apis in no times. Also template are a very easy way to boost productivity and allow to write great DSLs. See also an old but still relevant and very valid introduction of Nim for Python programmers [0]
It can work with numpy and even better there is a performant numpy replacement called arraymancer. Take into account that since you do not need to be afraid of loops, even working with standard sequences is very performant. See also the SciNim getting started book [1]
[0]: https://blog.zdsmith.com/posts/nim-for-python-programmers.ht... [1]: https://scinim.github.io/getting-started/
Nim goes further there by removing the need for tools like Pandas and numpy. You don't have to write code in "Pandas-style" because native Nim is equally fast and sometimes faster.
Can you clarify this? Is there an equivalent data stack in Nim? Or is it that nim is lighter-weight because, for example, it permits transforming tabular data into language structures natively (i.e., without library support)?
For N-dimensional array computation: https://github.com/mratsim/Arraymancer/
This issue alone means I can't use it at work, and I haven't put much time and thought into Nim as a whole because I could only use it in private toy projects.
I understand it's mostly the AV vendors fault and the devs shouldn't have to worry about a problem they haven't caused, but for me, this grinds real-life adoption of the whole thing to a halt.
If not, it's possible to get reasonably priced code signing certificates.
I'm guessing the issue is that some malware writers started using nim, and the antivirus vendors then decided to make heuristics that detect nim generated binaries and call it malware.
Mingw might have a higher weight for "this is malware". Then you combine that with nim generating code that's common across most nim binaries (the GC, boilerplate symbols, etc).
Then there's perhaps not enough positive signals to offset that, since there's not yet a wildly popular windows app written in nim.
Also, in Hare's specific case, it doesn't _really_ matter as they will never support Windows or MacOS [1], and there isn't a significant presence of anti-malware software on linux distros.
Probably best to select the top 10 AV companies, to keep the workload down. Per each release, shouldn't be too bad, though likely someone or a group needs to be designated for the task.
https://news.ycombinator.com/item?id=31238375
This whole question generates a lot of controversy for some reason
There is trade offs to both sensitivity and insensitivity. Just because you are used to one approach from your favorite programming language does not mean the other way is "wrong".
Want a consistent style? Use that nice --styleCheck:usages option. No problem at all.
Honestly, I think Nim should keep the current approach just to filter out certain people.
Maybe it's not so bad in practice, but looking from the outside, I think... really? To be specific, case-insensitivity doesn't bother me, but the automatic conversion from camel-case to snake-case... very much so.
It prevents bugs where a developer mistakes one variable or proc for another having similar names.
For example in another language you might have variables isReady, isready, is_ready and use the wrong one, leading to a bug.
Nim does not allow defining 3 different variables like that.
But that I can, and other people's code can, refer to the same thing by different names, is a bridge too far.
Like I say, it won't deter me from trying the language, probably (I've been saying it for a while), but certainly doesn't make me more keen to try it.
And I'm not certain what scenarios you envisage where this would be an issue, why do you care how other people call your functions?
I care about how a function is called because so much tooling around programming is effectively grep. I can grep for a function name and get a pretty good idea where it is called. There's also a million variants of grep - git grep, unholy regular expressions (recently I used one to find all instances where foo is called with exactly 2, not 3 params, in Python), IDE plugins and so on. GitHub search? Google search for exceptions?
IIRC Nim comes with some kind of "nim-grep" that is camel-vs-snake-aware, but that doesn't fix all the other tools.
The minor gripe, additionally, is that you often have quasi-singleton classes called "FooManager", then a single instance called "foo_manager". Now... are these colliding? Or not, because the first letter _is_ case-sensitive? What does "fooManager" map to then?
In my utility function, this feature gives me nothing but concerns. But then again, I'm not (yet?) a user the Nim community provides for so... <meh>
Like this:
type FooManager = object
var foo_manager: FooManager
> Now... are these colliding? Or not, because the first letter _is_ case-sensitive?Well as you correctly reason, the first letter's case distinguishes them.
Convention in the language is for types to start with a capital letter and instances start with a lower case letter.
> What does "fooManager" map to then?
It maps to the `foo_manager` instance because underscores are ignored, they're just for you. By the way, underscores are exceedingly rarely used in Nim code because they're not semantically significant, why bother.
Still, if you like you can use them in your code, and others can choose not to as they want. Clashing identifiers are a compile error so no worries.
They can but the compiler will just tell you it's ambiguous and to qualify it. Also bear in mind Nim has very strong static typing, so for things to clash they also have to have exactly the same type, otherwise no worries.
You can even rename symbols on import or force qualification for all symbols, but I've never needed to do either in years of heavily using the language.
There are times when you might want to use the same variables in different cases (math), and the assumption that you wouldn't seems like nannying to me.
Also, fundamentally, it's a very english-centric view and encourages that by default. I'd prefer case assumptions weren't implicitly baked into the language at a basic level.
I guess for me I just feel like a character is a character and I don't want the language telling me I should view it differently.
I just look at it and see a foot and a gun pointing at it. The arguments for it sound to me like "it's fine, there's a safety and a clever mechanism that prevents shooting yourself in the foot".
Maybe it's all fine, but I'd for one feel more comfortable if the gun wasn't pointing at the foot in the first place.
Exploring different ways to write the same name does not excite me.
Nim prevents that. It's that simple.
--styleCheck:error strictly enforces camel case.
Having a single syntax with multiple semantic meanings would indeed be a foot gun.
I can't think of a way how different syntax translating to a single semantic meaning could cause any concern. It's not like the wrong thing can happen, it just might look differently depending on codebase.
If an identifier clashes, you get a compile time ambiguity error. It means `is_OK` and `isOk` will report ambiguous identifiers and force you to qualify it or rename it.
This also helps further reduce ambiguity indirectly by forcing sensible naming.
The benefit is to avoid confusing variables or procs named my_var, myVar and myvar.
var my_var = 1
myVar += 1
echo(my_var)
Will happily compile and give you 2. I'd prefer an error in that case because while I'm not liable to make that mistake but I could easily mistype long_variable_name as long_variablename without noticing and then cause myself problems when I try to grep. nim --styleCheck:error c x
This enforces the same capitalization style in your code: x.nim(1, 5) Error: 'my_var' should be: 'myVar'You cane enable styleCheck:usages by default in the compiler. Also, most editors do variable/proc autocompletion.
Also you can use nimgrep if have to search across projects written by different people.
Just to stress myself as an anecdote though, I have years in the language and it hasn't come up yet for me, and I've never needed to use `nimgrep`.
I've heard the claim that lean is going in this direction.
It has great GC piggybacking on the huge amount of efforts going into dotnet, each release since dotnet core has just gotten faster and faster, not just GC but many parts of the ecosystem, see e.g. https://devblogs.microsoft.com/dotnet/performance-improvemen...
Pattern matching is first class. See e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe...
I haven’t programmed with traits, but sounds like interfaces which you can have records implement. https://gist.github.com/robertpi/2964793
Function signatures are usually not needed due to the type inference algorithm, so while it is statically typed, you often don’t need to write out the types of functions.
1) Nim's leadership is awful and has always been historically. Those in charge of managing the community are more interested in their personal reputation's and resumes than they are actually contributing working software to the language's ecosystem. Even the BDFL treats Nim like their own personal compiler R&D playground. There are so many broken features in Nim which never see the light of day or never get removed.
2) Continuing to expand on the point above, the Nim compiler has become insanely difficult to work on. As more and more half-baked features have been added to the language, the situation has only worsened. There are many would-be contributors who have come into the community only to leave completely frustrated or appalled by the lack of interest in improving the situation from those leading the community.
3) The development path is driven by leadership and not the community, and leadership has no plan. This was extremely evident last year when Araq and others were asked for a roadmap for Nim and they admitted to not having one, and basically wrote one up in a forum thread. Araq and dom96 and a few others, especially those who have been brave enough to actually deploy Nim code in production (looking at you status.im) tend to dictate what gets worked on or fixed. There is no coordination amongst folks working on initiatives. You can look at the `fusion` project, which was started by Nim's leadership, drew contributors in, and then was abandoned by leadership while maintainers were left on the hook to keep things afloat until they too dumped the project.
Things have gotten so bad, that a hard fork has been in development since last year, and many of the more senior community members or those who have been around for a bit have migrated there: https://github.com/nim-works/nimskull
Nim's community now consists of mostly new members or folks who weren't really active in it before, but maybe used Nim. Of course, the leadership remains in place, but there are only a handful of folks remaining that have been around for more than a year or two. Mostly those who bit the bullet on using Nim in production or built large projects with Nim and are stuck maintaining them.
My advice would be to look elsewhere.
> how much frustration you will encounter fighting the compiler and broken / under-specified language features and semantics might be a turn-off.
unless you limittest generics, most people wont even encounter this.
> My advice would be to look elsewhere.
that would imply that there is a better alternative
I don't think my totally normal usage of generics for type safety could be called "stretching the limits." My usage of generics includes using a parameter [V] for OpenGL meshes to introduce type safety with the vertex type. I'm pretty sure that's perfectly normal?
Recently one of my friends tried compiling my project - pan[1] on Windows, and for whatever reason - it doesn't work! stating that it "cannot instantiate 'V'", whatever that means. I've had this error annoy me many times before, but I have no clue what triggers it or how to reproduce it reliably. Call this a 'stable implementation.'
[1]: https://github.com/liquidev/pan [2]: https://github.com/liquidev/aglet
Generally it's not usually an issue with Nim's generics itself, but rather bad error message. Definitely an area for improvement IMHO. Though having used a fair bit of C++ templates over the years, I still find the Nim errors much more tractable after a bit of experience.
There _are_ a few broken limits of Nim's generics, but they are things pushing the type system to a limit.
It's true that compiler developers like krux, Clyybber, saem migrated to nimskull, I don't disagree.
> but there are only a handful of folks remaining that have been around for more than a year or two
But I totally disagree with your false statements about "senior" community members (those who don't do compiler development) migrating to nimskull - this is not true at all. There are a lot of "senior" people left in the Nim community.
And again, nimskull isn't a "silver bullet" either. It has the flexibility to change major things in the language just because it's a hard fork and almost no one (except people who develop it) uses it for real projects, whereas Nim has an actual userbase that doesn't want their code to be broken, especially considering the fact that nimskull has already removed a lot of the stdlib libraries, especially async (which there is no alternative to in Nimskull).
Are there experienced programmers in the Nim community, sure? Are they able to fix Nim with Nim's leadership in place? Doubtful in my mind based on history.
Also, I apologize if it seemed like I was evangelizing Nimskull or suggesting folks switch to it. I agree it is in no shape to serve a replacement for Nim presently, and may not ever be.
Contrast this to, say, Zig, their road-maps and community structure is light years ahead.
This is the type of insecurity and paranoia one can expect to find when hanging out in Nim discord.
It's not a coincidence you see the same name pop up, every time someone gets bullied out of the discord.
Have you ever dealt with someone that constantly lies and misrepresents your opinions to make you look like a villain? Have ever gotten frustrated, because the person you're arguing with is constantly shifting the goalpost to their benefit? Have you ever said something needlessly rude out of frustration? How would YOU react, if after dealing with all this disingenuous bs, YOU get told to watch your tone or you get banned for being toxic?
The justifications after a ban always make logical sense, true. But if you read through the logs with even a little bit of empathy, it becomes clear very quickly who the toxic person in those interactions is.
Edit: I'm not talking about a specific person getting banned. This happened numerous times, including newcomers.
I'm not even including the horrible software they've authored and cargo culted into the language's ecosystem and tooling. That should be enough of an offense to be removed from any decision-making role.
He didn't cargo cult his software into the ecosystem. He made the ecosystem. Nimble is the package manager because there was no package manager until dom wrote one. Jester is the default web framework because it was first, and despite its age it's still pretty good. Same for choosenim. And asyncdispatch. And all of the other tools/libraries that he wrote.
Obviously writing some early software doesn't give him a free pass. I could understand the attitude if he was a jerk, but I've never seen him be anything but helpful.
Try to advocate for replacing any of dom's tools / software packages and see what happens. Try to advocate for taking Nim in a direction counter to what dom perceives as the right one, even though they no longer contribute to the language anymore besides telling people to fix their broken software they're no longer willing to maintain, or to throw their weight around in RFCs / IRC.
I'm sure fusion could have been handled better, and for 2021 the roadmap was a bit hazy, but I can't think of any other big missteps. Araq, dom, PMunch, and other senior folks are in the forms helping people and answering questions every day, and my interactions with all of them has been very positive. The big post 1.0 feature was arc/orc, and that was very well communicated. Bugs are being fixed, useful new features are being added, and future plans are being discussed in the open.
And Nim itself is great. The "if it compiles, it works" factor is high, yet I almost never feel like the compiler is fighting me. Simple things are simple (I'm teaching it to a group of 12 year olds), it's incredibly flexible, it's fast, and it's suitable for almost any sort of problem. There's nothing else like it, and I expect I'd continue using it for at least a decade even if it switched into maintenance mode tomorrow. I think it will take at least that long for something better to come along.
The point is the compiler has more and more cruft that makes it increasingly more complex and increasingly unreliable. It also makes it so that bugs are harder and harder to fix. Not to mention that it's basically impossible to track what is going on with the language at any given point in time because there is no roadmap or updated status. It also doesn't help that certain folks like to create ten GitHub issues and RFCs for every perceived slight in the language.
Once again, the problem boils down to a complete lack of leadership or interest in running the show - and instead of empowering the community to make that happen, leadership sits back and acts like everything is great and perfect and pats themselves on the back. When someone complains that it is not, leadership finds a way to defend itself and turn sentiment against the person complaining. It happens over and over again and it's why Nim isn't a success story like languages that actually have empowered communities and leaders that are interested in leading and not just collecting book revenues / making .io games, etc... while actively gatekeeping those who would like to get involved in making things better.
A have a sinking feeling such language exists and is called "C".
It’s like the “incredible journey” term for companies that get swallowed whole by other companies, leaving their customers to dry.