-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operations names (add/sub/div/mul) like in WebAssembly #105
Comments
@Yaffle also suggested the same syntax simplification ideas and even proposed further: the |
at the moment you'd do |
Awesome, even better. |
In the latest version of the spec, the comparison operator |
I'm not wedded to the names of the operators. Aligning things with WebAssembly is not a bad idea. |
I don't think the WebAssembly names were really chosen with the goal of being an interface for application developers. I prefer the more explicit names, but also it's fine to iterate on this until the proposal is proposed for Stage 2.7. |
Just to chime in with the status quo, as of today:
|
Thanks! The moderately longer name "Decimal128", while admittedly bulky, does align with the goal of making things human-readable. It also suggests to the programmer that we're dealing with decimal numbers, and are aligning with IEEE 754 Decimal128, which is a named standard thing that a web search will turn up. Although most programmers (I assume!) have never heard of Decimal128, this strikes me as a reasonable name for a standard library object. |
Cmp() operator is used in sorting algorithms, but in math you usually want something like gte():
Also names for basic operations
add/sub/div/mul
like in WebAssembly(Assembly) and in decimal.js is useful because it is much easier to write and read it. After some practice they feel like operator overloading +-/* and pretty readable.End users can add DEC alias in context by hands if they need more compact expressions.
The text was updated successfully, but these errors were encountered: