On Fri, Jul 17, 2020 at 1:50 PM Thomas Pellissier Tanon <
thomas(a)pellissier-tanon.fr> wrote:
you can see implementations in many languages,
but they are often subtly
different, and there's nothing in the system to avoid
that.
I just have a concern here. How do you plan to mitigate the edge case
differences between programming languages for the "native functions"
implementations?
For example Python 3 "int" type encodes arbitrary precision integers
while JavaScript numbers could only encode integers that fit in a
64bits IEEE 754 float and Rust i64 have a 64bits precision limit.
I am afraid that if WikiLambda wants to rely on language specific
implementations for performance reasons, WikiLambda would have to deal
with a lot of these discrepancies and end up in the same problems as
Rosetta Code.
I think this is relatively trivial: Python3 "int"s are simply a
different
type of entity from IEEE 754 floats and 64-bit or 32-bit or whatever
limited integer examples there are. We already translate between types
within single languages (string to int, int to float, big int to little
int, unsigned int to signed, etc.) so all that's required here is being a
little more exact about these variable types from the start. IEEE 754
floats have a rather precisely defined definition that should be met by all
implementing languages, for instance.
Arthur