3 ms·
I 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 p
by nyanpasu64 5y ago
I 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. ;)