News for hackers. Stuff that matters.
Re:Generate Python extensions using Nim language by Qem on Friday April 15, 2022 @11:55AM (#31041665)
I suspect Nim has a good shot at getting popular, by piggybacking on Python syntax, the same way several other languages (e.g. Java, JavaScript) got popular by piggybacking on C syntax. Python just became number 1 on TIOBE index. Once part of the generation of developers just starting now, Python-first, needs to learn a systems programming language, Nim provides a path of least resistance for migration, close to the syntax they will be already used to.
Re:Generate Python extensions using Nim language by bloblaw on Friday April 15, 2022 @02:01PM (#31043467)
For me, Nim provides much of the developer productiveness of Python, but with higher performance.

I'm a big fan of Nim, and while I love Python, I keep finding more ways to use Nim instead of Python because it means if my proof-of-concept in Nim gets popular, I can avoid making trade-offs in scaling (due to performance).

Re:Generate Python extensions using Nim language by Tozen on Saturday April 16, 2022 @04:43PM (#31055933)
Very good point. For Python enthusiasts, Nim positions itself nicely as a next step. I don't think Nim will ever reach the heights that Python has amazedly found itself at, but do think there is going to be a bit of "gravitational influence", that keeps giving Nim some public attention.

Eventually, Nim could find itself on the TIOBE top 50 to 30 rankings. That would put it among known languages such as D, Scala, and Haskell. Which might not seem like much, but considering all the new programming languages that are out here now, it is actually quite significant. The competition among newer languages (Rust, Crystal, Zig, Vlang, Odin, Julia...) vying for attention and to replace some of the older ones is fierce.

Re:Generate Python extensions using Nim language by akvadrako on Friday April 15, 2022 @04:17PM (#31045283)
The problem with Nim is that it doesn't follow the Zen of Python (nor does Python anymore but Python doesn't need to compete as a new language).

Basically, it's just too complicated and all over the place.

Re:Generate Python extensions using Nim language by _dain_ on Friday April 15, 2022 @06:56PM (#31046956)
I mainly program in Python, but Nim has its own Zen and I respect that it's different.

    Copying bad design is not good design.
    If the compiler cannot reason about the code, neither can the programmer.
    Don’t get in the programmer’s way.
    Move work to compile-time: Programs are run more often than they are compiled.
    Customizable memory management.
    Concise code is not in conflict with readability, it enables readability.
    (Leverage meta programming to keep the language small.)
    Optimization is specialization: When you need more speed, write custom code.
    There should be one and only one programming language for everything. That language is Nim.
If I wanted Zen of Python I'd just keep programming in Python ...
Re:Generate Python extensions using Nim language by systemvoltage on Friday April 15, 2022 @05:35PM (#31046164)
Python ecosystem, say Pytest, doesn’t follow Python zen either. It has implicit magic all over the place. String parsing from function names, the entire concept of fixtures is exact opposite of “explicit is better than implicit”.
Re:Generate Python extensions using Nim language by kdheepak on Friday April 15, 2022 @11:04AM (#31041037)
I've used https://github.com/yglukhov/nimpy and I have to say the package, the author and the nim community were all phenomenal in helping me implement nim code that works as a Python package.
Re:Generate Python extensions using Nim language by mikenew on Friday April 15, 2022 @01:13PM (#31042772)
I've asked (sometimes stupid) questions in the Nim Matrix channel about some particular thing I was stuck on, and every time someone has answered it graciously and almost immediately. The community has been great, and I'm starting to really like the language.

For me it's like Python in the sense that I can bang out a quick, single-file program on a whim, but if it starts growing beyond that Nim is really fast, expressive, and portable. I can cross-compile a binary for any common platform (Nintendo Switch even), and then just send it over and run it.

Re:Generate Python extensions using Nim language by eagledotRL on Friday April 15, 2022 @11:22AM (#31041221)
Yes. community has been an outstanding factor in my whole journey of Nim so far.It becomes so easy to try out new features with such active feedback.
Re:Generate Python extensions using Nim language by elcritch on Friday April 15, 2022 @02:36PM (#31043987)
Also of interest for people might be Genny. It’s a Nim library to automate creating language bindings for other languages. Currently it supports Python, Node, and C.

https://github.com/treeform/genny

Re:Generate Python extensions using Nim language by cb321 on Friday April 15, 2022 @09:16AM (#31039876)
Maybe also of interest is a nascent package for R calling Nim (or vice versa): https://github.com/SciNim/rnim
Re:Generate Python extensions using Nim language by V1ndaar on Friday April 15, 2022 @11:57AM (#31041690)
To add to that, there's also a Nim <-> Julia bridge: https://github.com/clonkk/nimjl
Re:Generate Python extensions using Nim language by gavinray on Friday April 15, 2022 @12:46PM (#31042412)
To add to that, there's also a Nim <-> JVM bridge: https://github.com/yglukhov/jnim

And wrapperless C++ interop through macros: https://github.com/n0bra1n3r/cinterop

Re:Generate Python extensions using Nim language by poulpy123 on Friday April 15, 2022 @04:23PM (#31045368)
I'm toying a bit with nim these days, and I find it quite pleasant. it is a pity that it did not find the same success as go or rust
Re:Generate Python extensions using Nim language by spindle on Friday April 15, 2022 @06:22PM (#31046642)
This makes me want to write Python extensions using Nim using Spry - http://sprylang.se