si32/ui32 vs i32/u32 #162
-
I saw this discussion on Discord, but I don't think there has been any follow-up yet, so I thought I'd repost it here since I'm also curious about this.
So it seems like the si32/ui32 syntax not only offers less ambiguity, but it also aligns with MLIR's built-in IntegerType syntax:
However, I think mji makes a good point that Python programmers will probably be more familiar with the i32/u32 syntax. Since I'm new to MLIR, I was wondering if any of the Mojo team members could share how they think about this tradeoff. For example, in which ways will being aligned with the MLIR syntax be helpful to Mojo users? Will this alignment primarily benefit users working at a lower level, closer to MLIR? Or will higher-level users also experience benefits? For instance, during debugging, could examining MLIR types be a part of that process? Also, Mojo currently supports signed and unsigned integers, but would it ever makes sense for Mojo to also support signless integers? Or are those mostly only used internally by MLIR during the optimization/lowering process? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yeah, for the core language types, our audience are general programmers and Python folks, not MLIR nerds ;-) We want things to be clear and unambiguous, compiler folk can deal with naming mapping. Abdul is out on vacation this week but we can discuss when he returns.
I don't see a benefit to that. It would mean that we couldn't use the standard Python operators (which imply sign behavior, e.g. on divides). Signless integers are good for compilers because they want canonical forms, but users want operations that work on types. It's a bit of a different concern. |
Beta Was this translation helpful? Give feedback.
Yeah, for the core language types, our audience are general programmers and Python folks, not MLIR nerds ;-)
We want things to be clear and unambiguous, compiler folk can deal with naming mapping. Abdul is out on vacation this week but we can discuss when he returns.
I don't see a benefit to that. It would mean that we couldn't use the standard Python operators (which imply sign behavior, e.g. on divides). Signless integers are good for compilers because they want canonical forms, but users want operations that work on types. It's a bit of a different concern.