4 ms·
Nim just looks like a dream language to me. It's a fusion of Python and Modula-3 with incredibly expressive macro support (almost as capable as Lisp!) and nifty
by amyjess 5y ago
Nim just looks like a dream language to me. It's a fusion of Python and Modula-3 with incredibly expressive macro support (almost as capable as Lisp!) and nifty features like UFCS.
I just wish I had the opportunity to use it. Every time I start working on a personal project, I always default to Python just because I know it well and I know the ecosystem has every library I could want. I need an excuse to write something in Nim.
- ajusa 5y agohttps://github.com/yglukhov/nimpy https://github.com/yglukhov/nimpy gives very, very solid access to the Python ecosystem from Nim - I've copied code from Python docs and have had it work with hardly any changes. Hopefully that's a good enough excuse to try Nim out for a personal project!
- nyanpasu64 5y agoI think Nim compiles to native code, is orders of magnitude faster than Python without NumPy, and has no GIL unlike Python with NumPy. I'd check out Nim for a project that doesn't require real-time processing without GC (and for real-time audio processing, Nim may be an option but I haven't explored it yet: https://forum.nim-lang.org/t/8613 https://forum.nim-lang.org/t/8613).
- elcritch 5y agoIt's funny you linked to my random post. I should probably follow up on that as it'd be a nice way to ensure you're not allocating on hot-paths. It'd be for audio processing and such! Overall I'm finding Nim performs well at real-time style processing with ARC – even when allocating memory. Its memory allocator is taken from research for embedded real time allocation. Still the best pattern is to pass memory as mutable variables on hot processing paths: proc processAudio(someBuffer: openArray[byte]) = ... Next couple of weeks I'll using Nim on an MCU taking real-time ADC readings at ~64khz. That'll be fun as it'll require interfacing pre-allocated DMA buffers and with multithreaded ARC managed buffers. And they say it's all web programming nowadays. ;)
- bckr 5y agoHow about a personal project to port a small library from Python to Nim? I've thought about this a bit. What package might you shoot for? I've recently tried using MoviePy, and I love the interface, but it's slooow to render (4 minute videos can take 30 minutes to render). I might just be using it wrong (I know it uses lower-level libraries like ffmpeg under the hood), but I am curious if Nim would be a more natural fit.