Hacker News new | ask | show | jobs
by adsharma 358 days ago
I like mojo for being closer to python than other systemsy languages.

But asking people to learn another language and migrate is a tall barrier.

Why not write python and transpile to mojo?

3 comments

My impression is that mojo is not python, there are similarities, but under the hood mojo is much more similar to c++/rust.

As part of this it has a stronger type/lifecycle/memory model than python.

Maybe you could write, some level of transpiler, but so much of the optimizations rely on things that python does not expose (types), and there are things that python can do that are not supported.

Transpilers in general tend to be significantly less well maintained and optimised than direct APIs
I'm not a disinterested observer.

Py2many has had a mojo backend for a year now.

https://github.com/py2many/py2many/tree/main/tests/expected

The plan is to have a mechanical tool someday that can transpile Python code to Mojo