You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current ReScript design, operators for int and float types are distinct, requiring developers, especially those familiar with JavaScript, to learn and remember separate operators for these types. This distinction not only adds a learning curve for newcomers but also complicates the language's simplicity ethos. As the JavaScript ecosystem evolves and considers wider adoption of BigInt for larger integer operations, this approach might necessitate introducing yet another set of operators, further complicating the situation.
Proposal
I propose a syntax layer adjustment to allow a unified operator set for arithmetic operations across int, float, and potentially BigInt types. The goal is to streamline the developer experience by reducing the cognitive load and making the language more approachable for newcomers without introducing significant changes to the type checker.
Key Points:
Unified Operators: Use a single set of arithmetic operators that work intuitively across int, float, and BigInt types, similar to how JavaScript handles arithmetic operations without requiring different operators for different numeric types.
Minimal Changes to Type Checker: Keep changes to the type checking logic minimal.
Backward Compatibility: Ensure that these changes do not break existing codebases. A phased approach or compiler flags could be considered for a transition period.
The text was updated successfully, but these errors were encountered:
Background
In the current ReScript design, operators for
int
andfloat
types are distinct, requiring developers, especially those familiar with JavaScript, to learn and remember separate operators for these types. This distinction not only adds a learning curve for newcomers but also complicates the language's simplicity ethos. As the JavaScript ecosystem evolves and considers wider adoption ofBigInt
for larger integer operations, this approach might necessitate introducing yet another set of operators, further complicating the situation.Proposal
I propose a syntax layer adjustment to allow a unified operator set for arithmetic operations across
int
,float
, and potentiallyBigInt
types. The goal is to streamline the developer experience by reducing the cognitive load and making the language more approachable for newcomers without introducing significant changes to the type checker.Key Points:
int
,float
, andBigInt
types, similar to how JavaScript handles arithmetic operations without requiring different operators for different numeric types.The text was updated successfully, but these errors were encountered: