Add basic types support for IEEE 754 decimal32, decimal64 and decimal128
I propose to use the dec32, dec64 and dec128 type names.
It would ease financial application development. It would simplify database interop using the SQL DECIMAL type.
We could do the integration like for the i128 type and when LLVM officialy release the IEEE 754 implementation replaced our implementation with LLVM's one.
Additional information for LLVM integration?
https://discourse.llvm.org/t/rfc-decimal-floating-point-support-iso-iec-ts-18661-2-and-c23/62152 https://github.com/tahonermann/llvm-project
The question is: how bad would the experience be if this was implemented as user land types. I HAVE thought of it, but the fact that it's not often used in the languages that have it is sort of off-putting.
In user land we would lost, implicit/explicit cast, and arithmetic operators support. And when the decimal types are gonna be available in LLVM, code using the user land type will need to be modified, Or we stick with the user land code and go forward with it?
Would be nice to have a C3 interface like e.g.: IntegerType, FloatType, ..., that would allow a type to be defined with cast and arithmetic defined functions, and when the interface is implemented in a user type it would gives the same usage as the basic types.
Would be nice to have a C3 interface like e.g.:
IntegerType,FloatType, ...,
I've looked at this and it's a surprisingly big feature. If you have any detailed proposal I am definitely willing to look at it.
Would be nice to have a C3 interface like e.g.:
IntegerType,FloatType, ...,I've looked at this and it's a surprisingly big feature. If you have any detailed proposal I am definitely willing to look at it.
I will work on a proposal this week. do you prefer that I post it in the Discussions >> Ideas section?
That works fine.
Ping
Due to operator overloading, this is now more interesting as stdlib features.