-
Notifications
You must be signed in to change notification settings - Fork 323
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
Adopting GraalVM's support for BigInteger #7420
Conversation
engine/runtime/src/main/java/org/enso/interpreter/runtime/number/EnsoBigInteger.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/number/EnsoBigInteger.java
Show resolved
Hide resolved
Currently there is 40 errors like this one where the precision of a number changes. |
engine/runtime/src/main/java/org/enso/interpreter/node/callable/IndirectInvokeMethodNode.java
Outdated
Show resolved
Hide resolved
...ne/runtime/src/main/java/org/enso/interpreter/node/callable/resolver/HostMethodCallNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/number/EnsoBigInteger.java
Show resolved
Hide resolved
Alas, GraalPython currently doesn't support diff --git test/Tests/src/Data/Numbers_Spec.enso test/Tests/src/Data/Numbers_Spec.enso
index 592bc7ac99..7b4879de67 100644
--- test/Tests/src/Data/Numbers_Spec.enso
+++ test/Tests/src/Data/Numbers_Spec.enso
@@ -835,6 +835,8 @@ spec =
bigint_spec "Enso" (x->x) (*)
bigint_spec "Java" to_java_bigint java_bigint_mul
bigint_spec "JavaScript" to_js_bigint js_bigint_mul
+ if Polyglot.is_language_installed "python" then
+ bigint_spec "Python" to_python_bigint python_bigint_mul
main = Test_Suite.run_main spec
@@ -844,3 +846,9 @@ foreign js to_js_bigint n = """
foreign js js_bigint_mul a b = """
return BigInt(a) * BigInt(b)
+
+foreign python to_python_bigint n = """
+ return int(n)
+
+foreign python python_bigint_mul a b = """
+ return int(a) * int(b) fails. With oracle/graalpython#346 the Python test seems to pass OK. |
Engine (linux) and also Windows runs are fine. Time to address the change requests, fix minor issues and integrate. Engine code owners, please review. |
engine/runtime/src/main/java/org/enso/interpreter/node/callable/InvokeMethodNode.java
Outdated
Show resolved
Hide resolved
...in/java/org/enso/interpreter/node/expression/builtin/interop/syntax/HostValueToEnsoNode.java
Outdated
Show resolved
Hide resolved
Thank you for your reviews. Let's execute benchmarks and if they are OKeyish, integrate. There is also second run and 3rd run to see the trends. Most of the Results seem fine. There is small slowdown in it'd be acceptable. However there is more than 10% slowdown in smaller slowdowns are also visible in On a positive side. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't wait to get this in and being able to move forward with stuff like #7354
Re. The difference adds one additional
and all the values are coming from Enso. Very likely this is caused by defensive check - we can certainly do better if we know the |
Pull Request Description
Fixes #7213 by reacting to new
isBigInteger
andasBigInteger
messages. Adjusts tests to requireBigInteger
when appropriate.EnsoBigInteger
no longer extendsNumber
. Enso tests to come.Important Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,