News for hackers. Stuff that matters.
Re:Learning Programming with Nim by _bxg1 on Wednesday June 13, 2018 @10:01AM (#17303092)
I used to get excited about new-language posts on here, but I've gotten weary of them over time. So many are just slight variations on standard syntaxes that meet their creator's preferences. It's rare to see anything that's radical, and therefore truly interesting.
Re:Learning Programming with Nim by LyndsySimon on Wednesday June 13, 2018 @10:07AM (#17303152)
I see Nim as inhabiting an interesting space between Lisp and Python/Ruby/Perl.

I wouldn't say Nim is "radical", but it is interesting in that it combines ideas in a way that I've not seen in other languages. Whether or not it really takes off, it's a good thing that it's around - if nothing else, it's a slightly easier way for devs who work primarily in higher-level languages like Python and Ruby to encounter concepts they might not otherwise encounter, like macros and a complex type system.

Re:Learning Programming with Nim by a012 on Wednesday June 13, 2018 @10:10AM (#17303179)
Can you share some works one can do with Nim?
Re:Learning Programming with Nim by PMunch on Wednesday June 13, 2018 @10:17AM (#17303257)
Not 100% sure what you mean by works, but Nim has been used to create various things. For one the entire Nim forum: https://forum.nim-lang.org/ is written in Nim (both back-end and front-end), the game "Reel Valley" has been written in Nim, there is a company doing Ethereum blockchain using Nim: https://status.im/, and many more.
Re:Learning Programming with Nim by a012 on Wednesday June 13, 2018 @10:22AM (#17303306)
That's impressive. I'm curious whether I can use Nim in sysadmin job.
Re:Learning Programming with Nim by kaushalmodi on Wednesday June 13, 2018 @10:50AM (#17303602)
I am dabbling in Nim, and plan to replace bash/Python scripts with Nim. So far it looks really promising!

Few projects: nbuild[1], ntangle[2].

I wouldn't say that these are exemplary projects.. but they just show that Nim can replace bash/Python for command line utilities.

[1]: https://github.com/kaushalmodi/nbuild/ [2]: https://github.com/kaushalmodi/ntangle/

Re:Learning Programming with Nim by gtrs on Wednesday June 13, 2018 @11:48AM (#17304183)
Totally feasible, I ported Python code to Nim and it was super easy and I got a huge performance boost.

If performance isn't a big deal, the other thing I've noticed is that compilation guarantees a much higher quality of code compared to interpretation. At least compared to Python, I have been hit by bad code which didn't get caught because there was no test for it. I've not faced that with Nim yet.

No doubt you can still have issues but it's one less thing to worry about.

Re:Learning Programming with Nim by kungtotte on Wednesday June 13, 2018 @12:48PM (#17304785)
You also gain portability; no worrying about which Python version is installed on a target machine for example.
Re:Learning Programming with Nim by nimmer on Wednesday June 13, 2018 @12:51PM (#17304813)
Nim competes very well with Python, Go and Rust in the sysadmin / system library / daemons space.
Re:Learning Programming with Nim by sigzero on Wednesday June 13, 2018 @11:28AM (#17303998)
I'd say "it depends". If I was a solo sysadmin or a small team, I would probably use it. Big teams are harder to get "buy in" for a new language.
Re:Learning Programming with Nim by jblindsay on Wednesday June 13, 2018 @10:16AM (#17303251)
I used Nim a little while back to write a small CLI program that performs a feature-preserving smoothing of digital terrain data (see https://github.com/jblindsay/fp_denoise). I could have used, and have used, several of languages for this type of application. But I was interested in learning Nim and getting a feel for how well it lends itself to spatial analysis. I was quite pleased with the experience overall. The language feels a lot like a high-level language with the speed of a systems language. The one thing that I didn't find particularly easy was concurrency. I still haven't managed to figure that out but that is more a comment on my limitations than the language. Nonetheless, I can certainly see Nim taking off for data science once it hits v1.0.
Re:Learning Programming with Nim by PMunch on Wednesday June 13, 2018 @10:12AM (#17303192)
This tutorial obviously only scratches the surface of what is possible in Nim. If you want to dig deeper I recommend reading through the learnxinyminutes entry, along with maybe https://xmonader.github.io/nimdays to see some examples. Then of course the official tutorials. Or if you just want to dig into the crazy stuff to see what is possible https://hookrace.net/blog/introduction-to-metaprogramming-in...
Re:Learning Programming with Nim by simias on Wednesday June 13, 2018 @10:38AM (#17303474)
Nim is definitively niche but it's not really new, Wikipedia tells me that it's 10 years old (older than Rust [2010] or Go [2009] for instance). It just never got enough traction to really find its place in the ecosystem.
Re:Learning Programming with Nim by dom96 on Wednesday June 13, 2018 @11:00AM (#17303715)
> It just never got enough traction to really find its place in the ecosystem.

Probably a bigger factor is that Nim doesn't have a well-known organisation such as Google/Mozilla behind it.

Re:Learning Programming with Nim by drcongo on Wednesday June 13, 2018 @10:13AM (#17303215)
Nim isn't a new language, it's been around a while.
Re:Learning Programming with Nim by reacharavindh on Wednesday June 13, 2018 @10:48AM (#17303576)
There's something about not hitting 1.0. It instills doubt on adoption that things will change in a breaking way soon, and that you're going to need to rewrite your stuff in potentially non-trivial way.

I liked playing with Nim in spare time. But, I don't think I'll use it for anything I care about to maintain for a long time.

Re:Learning Programming with Nim by gtrs on Wednesday June 13, 2018 @11:54AM (#17304243)
Every language has faced challenges with change, nothing specific to Nim. And 1.0 is a distraction, if the language version has all the features you want, you can use it as long as you want. The code is also open and an unbearable bug can be easily backported.

If you do want the new cooler features, then ya, you may need to port your code but that's the case with any compiler update - you need to run a full regression at the very least.

Re:Learning Programming with Nim by kjeetgill on Wednesday June 13, 2018 @05:48PM (#17307284)
1.0 _may be_ a distraction but I think it's a fair one. It's a common enough convention that pre-1.0 versions are the developer's way of saying, "please please please don't treat this as ready and production quality. We're still figuring some things out and haven't settled on some key choices."

If that's not what the developers are trying to communicate with a pre-1.0 version I do wonder what they're gating 1.0 on. What needs finalization? Documentation?

Re:Learning Programming with Nim by ofrzeta on Wednesday June 13, 2018 @10:30AM (#17303397)
Given "the compiler is in development and some important features are still missing" (quote from the FAQ) it would surely qualify as new.
Re:Learning Programming with Nim by TylerE on Wednesday June 13, 2018 @10:32AM (#17303411)
It was first posted to HN in 2013.

https://news.ycombinator.com/item?id=6820474