Hacker News new | ask | show | jobs
by JonChesterfield 358 days ago
The factorial test giving zero on majo suggests they aren't doing arbitrary precision integer arithmetic.

I liked mojo as a python superset. Wanted to be able to run arbitrary python through it and selectively change parts to use the new stuff.

A "pythonic language" sounds like that goal has been dropped, at which point the value prop is much less clear to me.

5 comments

From Chris Lattner on Modular discord few days ago:

Yep, that's right. Int behaving like a machine integer is very important for systems performance. Leaving the "int" namespace untouched allows us to have a object-based bigint in the future for compatibility with python. As others have mentioned above, it is still a goal to be compatible with python in time, just not a short term priority

I guess they abandoned the python superset idea? I followed them for a bit when they first publicly launched and they said "don't worry, we'll be a real python superset soon" and the biggest omission was no support for classes. A few years later, it looks to be missing the same set of python features but added a lot of their own custom language features.
I'd say less abandoned, and more deferred.

It was highly aspirational goal, and practically speaking it's better right now to take inspiration from Python and have stronger integration hooks into the language (full disclosure, I work at Modular). We've specifically stopped using the "superset of Python" language to be more accurate about what the language is meant for right now.

Deferred means it’s coming, but we don’t know if it will ever come. I’d bet it won’t.
Being a Python superset and being fast are fundamentally in tension. It would be possible, maybe, to have a Python superset where you get the highest performance as long as you avoided the dynamic features of Python. However, I suspect it would make the user base grumpy to have a hidden performance cliff that suddenly showed up when you used dynamic features (or depended on code that did the same).
The dynamic features of Python are no different from the dynamic features of Smalltalk, Self, Common Lisp, but people have been educated to expect otherwise due to the adoption failure of dynamic compilers in Python community.
Taking unchanged Python and making it fast is basically impossible.
Sure - but you can support unchanged Python at regular Python speed, and also have extensions to the language that can be run at higher speed.
They explicitly casted it to an 'Int' on the mojo side, but the modular website claims that isnt a specific bit-width so i am surprised
It's not a specific bitwidth in a sense that it maps to whatever largest integer type is natively supported by the target architecture (i.e. basically 32-bit or 64-bit).
The Python superset concept was always a gimmick. The goal was always to juxtapose Python with a language that superficially looks like Python in order for you to completely migrate from Python to Mojo. It is just providing a smooth ramp for you to do so in the same Apple migrated folks from Objective-C to Swift.

Embrace. Extend. Extinguish.