This is a bit of a straw man argument
.
I’m not a huge fan of Python, and I certainly don’t want Mojo to “be Python”. What I want is for programmers coming to Mojo to be able to build cool apps that are fast, secure, and reliable.
My concern is that Int is an incredibly subtle data type in Mojo, and yet the name doesn’t reflect this. When programmers come to Mojo (from anywhere!), they are going to bring their misconceptions about what an Int should be used for. The name implies that it’s the “simplest” integer type, whereas in practice, it’s the most complicated. If we pretend this complexity doesn’t exist, we are going to cause our users pain, and that’s what I don’t want to see happen.
As a simple example, let’s say I’m writing a library containing utilities for managing a website. My library defines a struct that stores a tally of site_visits. Great, site visits are an integer, so I should use Int right?
No… that’s a bad idea! If one of the users of my library wants to serve website requests on a 32-bit ARM chip, when they load the current site_visits tally from the database and store it in the Int, it’s at high risk of overflowing the integer, if the website becomes popular. (YouTube gets almost 4 billion site visits every single day.)
How did we mess this up? The root issue is that the size of Int is proportionate to the amount of addressable memory on the device upon which the library is running. If you are using Int to store a value that has no relationship to the device’s addressable memory (such as site_visits), you are misusing it.
I’m sure that a certain subset of Mojo users (e.g. C++ veterans) will spot this mistake, and a few of them will even say “duh, this is obvious”. But as language designers, we are setting ourselves up for failure if we are expecting our users to already be experts on such topics!
We can avoid this quagmire by signposting what an Int is actually for. This is very easy to achieve. We just need to choose a better name; one that reminds Mojo users that “this data type is for quantities related to the size of addressable memory”. The cost of making this change is very small, and the upsides are potentially significant. Even just putting a single-letter suffix at the end of Int would suffice. Consider two alternative universes:
- Mojo has
Int, Int32, Int64, BigInt, etc. In this universe, people pick Int when they are trying to “move fast” because it’s the simplest-looking choice, and it seems to do the job.
- Mojo has
IntMem, Int32, Int64, BigInt etc. In this universe, there is no “default” integer option. Therefore, the user has to consciously decide which integer type is the correct choice for their use case. If in doubt, they will always pick BigInt, because it is guaranteed to behave correctly, no matter how large its value gets.
As I mentioned earlier, I want Mojo users to build fast and reliable software. I don’t want them to be shipping a bug-riddled app because some library that they are using has chosen the wrong integer type. I acknowledge that there are infinitely many ways to ship a buggy app, but this is one class of bugs that we can mostly eradicate from the language just by naming the integer types carefully. It’s such an easy fix, and there are so few downsides.
TL;DR: What I care about is helping Mojo users succeed. The more papercuts we can eliminate with minimal effort, the better. The name of Int is such a low-hanging fruit, where the benefits far outweigh the drawbacks, that I think it would be a mistake to not do something about this.