
Writing a simple Python to C compiler: hello, fibonacci - pcr910303
https://notes.eatonphil.com/writing-a-simple-python-compiler.html
======
zwegner
This is similar to Nuitka in that it generates code that binds with the Python
C API, so it's easy to get compatibility/interoperability.

I have an old, abandoned project that translates Python to C++ "from scratch",
with no runtime dependencies beyond the STL[0]. It's very incomplete, and
probably has plenty of bugs, but might be interesting for anybody looking for
something more self-contained/embeddable. It has its own implementations of
lists, dicts, etc., and a basic garbage collector.

[0] [https://github.com/zwegner/pythonc](https://github.com/zwegner/pythonc)

------
aldanor
A good example of something similar that's actually very useful is Numba which
is a Python-to-LLVM JIT compiler; extremely useful for writing fast numeric
algorithms without leaving Python-land, sort of.

~~~
tkuraku
Numba I think is the perfect tool for numeric code. Much easier to work with
than Cython or native modules. You can also use numba to write Cuda functions.

------
giancarlostoro
First I was going to mention that this is what I believe Nim does (and Nim is
closely similar to Python with its own differences), but I also forgot about
Cython which achieves this as well. I guess the purpose of this though is to
walk through the process which is more interesting than just being linked to
Nim or Cython.

