Show HN: Nimic – write pure Python and compile AOT to native binaries via Nim
Nimic is a Python module designed to enable writing code that can be compiled ahead of time (AOT) to achieve C-level performance. It allows developers to use a subset of Python while transpiling the code to Nim, maintaining compatibility with Python syntax. The module includes various features such as native type emulation, operator overloading, and a transpiler for converting Python code to Nim source code.
- ▪Nimic facilitates writing AOT compilable code using a subset of Python.
- ▪The module is based on the ctypes built-in module and includes emulation of native types.
- ▪Nimic code is valid Python that transpiles to equivalent Nim code.
Opening excerpt (first ~120 words) tap to expand
Nimic Nimic is a pure Python module that facilitates writing AOT compilable code with a subset of Python (domain specific language), aiming to get C-level performance without leaving Python. Based on ctypes built-in module, it includes emulation of native types, pointers and operations on them, implementing dispatch, operator overloading, and templates. Nimic closely follows Nim programming language, to which nimic code transpiles. Key principle: nimic code is valid Python that runs natively and transpiles to equivalent Nim code.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at GitHub.