[HN Gopher] Generate Python extensions using Nim language
       ___________________________________________________________________
        
       Generate Python extensions using Nim language
        
       Author : eagledotRL
       Score  : 99 points
       Date   : 2022-04-15 11:35 UTC (11 hours ago)
        
 (HTM) web link (ramanlabs.in)
 (TXT) w3m dump (ramanlabs.in)
        
       | kdheepak wrote:
       | 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.
        
         | eagledotRL wrote:
         | 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.
        
         | mikenew wrote:
         | 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.
        
       | [deleted]
        
       | Qem wrote:
       | 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.
        
         | bloblaw wrote:
         | 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).
        
         | akvadrako wrote:
         | 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.
        
           | systemvoltage wrote:
           | 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".
        
           | _dain_ wrote:
           | 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
           | ...
        
       | cb321 wrote:
       | Maybe also of interest is a nascent package for R calling Nim (or
       | vice versa): https://github.com/SciNim/rnim
        
         | V1ndaar wrote:
         | To add to that, there's also a Nim <-> Julia bridge:
         | https://github.com/clonkk/nimjl
        
           | gavinray wrote:
           | 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
        
       | elcritch wrote:
       | 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
        
       | spindle wrote:
       | This makes me want to write Python extensions using Nim using
       | Spry - http://sprylang.se
        
       | poulpy123 wrote:
       | 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
        
       ___________________________________________________________________
       (page generated 2022-04-15 23:01 UTC)