# Is it possible to modify the Python interpreter to generate machine code and run directly on the processor?

**URL:** <https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318>\
**Category:** Python Help\
**Created:** [December 5, 2023, 12:31am UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318 "2023-12-05T00:31:01Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Rieidi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rieidi/32/16322_2.png) [@Rieidi](https://discuss.python.org/u/Rieidi)\
**Post date:** [December 5, 2023, 4:23pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/22 "2023-12-05T16:23:42Z")

</div>

I understand your observation, and I reiterate my strong determination to develop a compiler and integrate it into Python. I am committed to this challenge, as I see it as a significant opportunity to enhance performance and delve deeply into the intricacies of programming language implementation. This is a project that motivates me, and I am eager to tackle the challenges that will arise along this development path.

---

<div class="post-metadata">

**Author:** ![jamestwebber](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jamestwebber/32/12799_2.png) [@jamestwebber](https://discuss.python.org/u/jamestwebber)\
**Post date:** [December 5, 2023, 4:52pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/23 "2023-12-05T16:52:38Z")

</div>

That is a noble goal, but taking on such a colossal project by yourself is a recipe for burning out and giving up. I’d recommend familiarizing yourself with the existing CPython codebase and trying to help with the existing open issues first. That is the path to learning the scope of the larger goal you have set out for yourself, and will build up the relationships and experience you’ll need to integrate something so large into the main version of Python.

---

<div class="post-metadata">

**Author:** ![Rieidi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rieidi/32/16322_2.png) [@Rieidi](https://discuss.python.org/u/Rieidi)\
**Post date:** [December 5, 2023, 5:13pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/24 "2023-12-05T17:13:49Z")

</div>

I would need a huge team, but no one helps. So I’m going to close this here before more people arrive to respond. ☠ I’ll learn but then I’ll come back.

---

<div class="post-metadata">

**Author:** ![barry-scott](https://avatars.discourse-cdn.com/v4/letter/b/e9c0ed/32.png) [@barry-scott](https://discuss.python.org/u/barry-scott)\
**Post date:** [December 5, 2023, 8:06pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/25 "2023-12-05T20:06:47Z")

</div>

> [@gkb](#):
>
> Maybe [Nuitka](https://github.com/Nuitka/Nuitka)?

Yes! That’s it. I see its still active, cool!

---

<div class="post-metadata">

**Author:** ![bryevdv](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/bryevdv/32/7424_2.png) [@bryevdv](https://discuss.python.org/u/bryevdv)\
**Post date:** [December 5, 2023, 8:57pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/26 "2023-12-05T20:57:13Z")

</div>

[Numba](https://numba.pydata.org/) seems relevant here.

---

<div class="post-metadata">

**Author:** ![elis.byberi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/elis.byberi/32/35937_2.png) [@elis.byberi](https://discuss.python.org/u/elis.byberi)\
**Post date:** [December 5, 2023, 9:41pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/27 "2023-12-05T21:41:06Z")

</div>

Just noting that all the aforementioned compilers can only compile a subset of the Python programming language or are not a drop-in replacement for CPython.

---

<div class="post-metadata">

**Author:** ![Rieidi](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/rieidi/32/16322_2.png) [@Rieidi](https://discuss.python.org/u/Rieidi)\
**Post date:** [December 5, 2023, 9:43pm UTC](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318/28 "2023-12-05T21:43:01Z")

</div>

It is therefore a very strange idea to create a compiler just for this.

[Previous page](https://discuss.python.org/t/is-it-possible-to-modify-the-python-interpreter-to-generate-machine-code-and-run-directly-on-the-processor/40318.md?page=1)
