Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No it won't. The language is not a super-set of Python, its another language that somewhat resembles Python. You can't drop in some Python code and run it with Mojo and expect it to work.


The goal is for the language to be a superset of Python

> Further, we decided that the right long-term goal for Mojo is to provide a superset of Python (i.e. be compatible with existing programs) and to embrace the CPython immediately for long-tail ecosystem enablement.

https://docs.modular.com/mojo/why-mojo.html


But see the section "Intentional differences from Python", which is after your quote,

https://docs.modular.com/mojo/why-mojo.html#intentional-diff...

> our approach to compatibility is two fold:

> 1. We utilize CPython to run all existing Python3 code “out of the box” without modification and use its runtime, unmodified, for full compatibility with the entire ecosystem.

> 2. We will provide a mechanical migrator that provides very good compatibility for people who want to move Python code to Mojo.

> Together, this allows Mojo to integrate well in a mostly-CPython world, but allows Mojo programmers to be able to progressively move code (a module or file at a time) to Mojo. This approach was used and proved by the Objective-C to Swift migration that Apple performed.

Maybe the long-term goal is to try to make it a true superset, but it sounds like the detailed plan is more practical, to basically provide a "Python-next" language, like Swift for Objective-C.


Isn't

>We utilize CPython to run all existing Python3 code “out of the box” without modification

from the docs the direct opposite of what the commentator claimed?


I think this discussion is a bit better if you read the docs:

>We utilize CPython to run all existing Python3 code “out of the box” without modification




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: