3 ms·
I’m not the OP but have implemented a bioinformatics algorithm library with with Nim. I had an implementation in Python and just ported it to Nim. I have been
by bdl 6y ago
I’m not the OP but have implemented a bioinformatics algorithm library with with Nim.
I had an implementation in Python and just ported it to Nim. I have been incredibly impressed with Nim to say the least. I managed to make the Nim version orders of magnitude faster with fewer lines of code while having more features. With the excellent Nimporter library, I can easily make a Python API and have it be pip installable.
I genuinely think Nim (or similar) may be the future of my field. Combined with its JS compile target and WASM support, it lets me target my three main “platforms“: web, Python API, and high-performance CLI.
- cl3misch 6y agoThis sounds very interesting! What are your thoughts on nim vs julia? In the scientific community, julia is popular for similar reasons as nim like easy syntax and compiled code. If you think nim will take over in bioinformatics, how is the support of numerical algorithms like BLAS and LAPACK?
- planetis 6y agohttps://forum.nim-lang.org/t/5242 https://forum.nim-lang.org/t/5242 There is https://github.com/mratsim/Arraymancer https://github.com/mratsim/Arraymancer n-dimensional tensor (ndarray) library Native plotting library: https://github.com/Vindaar/ggplotnim https://github.com/Vindaar/ggplotnim as well as many other packages.
- totalperspectiv 6y agoThis is a good write up imo: http://lh3.github.io/2020/05/17/fast-high-level-programming-languages http://lh3.github.io/2020/05/17/fast-high-level-programming-...
- bdl 6y agoI have never written anything “production” grade with Julia, so do take my opinion with a grain of salt. However, I did once try to translate a simple algorithm library from Python into both Nim and Julia. Julia was no faster than Python with my initial naive implementation. After consulting the forum and getting help, I did manage to get it running fast. My impression of Julia is that it can be incredibly fast but it takes work to get to that stage. In contrast, with Nim, my code looked nearly identical to my Python code (i.e. quite simple) and ran fast from the start. This has been my general impression of Nim after doing a few projects in it: you write clean, readable code and get fast code out. There is no step 2. With respect to numerical algorithms, Nim has good support for BLAS and LAPACK. I personally haven’t used them, so I can’t comment. Nim’s metaprogramming allows for things like this [1], which is a macro library that translates between idiomatic Python and Nim. While I don’t use it myself (I find Nim’s idioms to make sense for Nim) it does make the transition a lot easier. [1] https://github.com/Yardanico/nimpylib https://github.com/Yardanico/nimpylib
- deleted 6y ago[deleted]