4 ms·
Maybe someone can correct me, but I don't think it's a superset of Python--I don't think it will accept existing Python programs and I'm pretty sure you can't d
by throwaway894345 3y ago
Maybe someone can correct me, but I don't think it's a superset of Python--I don't think it will accept existing Python programs and I'm pretty sure you can't do all of the dynamic Python stuff (otherwise you would have to essentially compile/link an interpreter into your binaries giving you these super slow paths that aren't necessarily obvious when reading source code).
> Judging by what I've seen so far, it seems Modular has been able to "Rustify+Tritonify" Python code in a way that to me feels... very Pythonic.
I think it "feels Pythonic" because you're looking at Pythonic syntax. I suspect when you're banging your head against a borrow checker it will feel more like writing Rust. Like I'm pretty sure anything with a borrow checker will have to deal with lifetimes, mutable-vs-immutable references, shared mutability (cell/refcell in rust), etc; I don't know how you "Pythonify" that in any meaningful way?
- bjornasm 3y ago>We utilize CPython to run all existing Python3 code “out of the box” without modification >Further, we decided that the right long-term goal for Mojo is to provide a superset of Python
- asqueella 3y agoThe FAQ states that “Mojo is still early and not yet a Python superset, so only simple programs can be brought over as-is with no code changes.” I have no idea how to reconcile that with the quotes you provided. [edit] Ah, it seems you can control things running in a bundled CPython: plt = Python.import_module("matplotlib.pyplot") fig = plt.figure(1, [width, height], dpi) ax = fig.add_axes([0.0, 0.0, 1.0, 1.0], False, 1), "hsv", 0, 0, 1.5) ... plt.imshow(image)