Why Nimpylib
It helps you to:
- use much Python-like out-of-box API in Nim:
- with no need of any Python dependency (neither dynamic library nor binary).
- even handy for ones who don’t use much Python but want more functions in Nim
- translate your Python program to Nim:
- gaining a right-away speed boot of even 700x
- no worry about binary distribution or packaging, just “compile once, distribute everywhere”
- amazing small binary size: as of v0.9.7, for a simple
print("hello world")
, the produced binary is only:- 372K in debug
- 176K in release
- even 56K with size strip compile flags like
-d:strip
1 on MacOS.
- rid of many annoying runtime-errors (which are turned to compile-time error)
- gain a better view into different behaviors between Python and Nim:
dynamically-typed
vsstatically-typed
- unconvertible syntax from Python to Nim, e.g.
end
keyword,not in
syntax
…
Copied from repo’s README.md but update link of mustRewriteExtern
consider flag of
-d:danger -d:strip --opt:size --threads:off -x:off -t:-flto
(if gcc/clang is used), which reduces size to even 55.6K ↩︎