-
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
Encapsulating array-like data and operations into a single package #7544
Conversation
lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/builtins/TypeWithKind.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/EnsoObject.java
Show resolved
Hide resolved
lib/scala/interpreter-dsl/src/main/java/org/enso/interpreter/dsl/builtins/TypeWithKind.java
Show resolved
Hide resolved
Current state seems to be stable. Let's do a bit of benchmarking. On par, except:
Let's delay querying
Running new benchmarks check based on 4c3e383 - assuming it is no worse we'll need to find out how to speed the ones listed above up... |
6181b10 introduces |
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/vector/Vector.java
Show resolved
Hide resolved
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.
Good job. I have written some minor comments.
type Array_Proxy | ||
## PRIVATE | ||
Value ignore |
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.
What is the reason for this ignored field?
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.
Removing the Value ignore
constructor turns Array_Proxy
into a singleton and fails:
[error] Test org.enso.interpreter.test.MetaIsATest.typesAreNotInstancesOfThemselves failed: java.lang.AssertionError:
[error] Type Array_Proxy shall not be instance of itself expected:
[error] at org.enso.interpreter.test.MetaIsATest.typesAreNotInstancesOfThemselves(MetaIsATest.java:238)
I decided to add a constructor to "silent" this tests.
The proper fix is to remove the type Array_Proxy
altogether, I think. It is not a type
anyway. It is just a place for the new
and from_proxy_object
methods. However I happily leave this for @jdunkerley, @radeusgd and for another pull request.
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Array_Like_Helpers.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Array_Like_Helpers.enso
Show resolved
Hide resolved
.../java/org/enso/interpreter/node/expression/builtin/immutable/FromArrayBuiltinVectorNode.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/enso/interpreter/node/expression/builtin/immutable/RemoveAtVectorNode.java
Show resolved
Hide resolved
import org.enso.interpreter.node.expression.builtin.meta.TypeOfNode; | ||
import org.enso.interpreter.runtime.callable.atom.Atom; | ||
import org.enso.interpreter.runtime.callable.atom.AtomConstructor; | ||
import org.enso.interpreter.runtime.data.Type; | ||
import org.enso.interpreter.runtime.type.TypesGen; |
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.
minor: Are these imports reordered with sbt enso/javafmt
or is it your IDE doing this? I am asking because your setup seems to create inconsistent import ordering - in this file, org.enso
imports are before com.oracle.truffle
, whereare, in GetStackTraceNode.java
it is the other way around.
I have seen a lot of import reordering in your recent PRs. I just want to make sure that we are on the same page and ensure whose setup is the prefered one.
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.
VSCode (with Apache NetBeans based plugin) is configured to clean imports aggressively. For example it expands *
imports to individual ones, removes unnecessary imports, etc. However the order is then finally set by javafmtAll
.
I have seen a lot of import reordering in your recent PRs.
Yeah, I've noticed that myself as well.
on the same page and ensure whose setup is the preferred one.
javafmtAll
is the final check, however it may be too "forgiving". I can change my settings to instruct the IDE to not touch imports automatically.
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/hash/HashMapToVectorNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/vector/Array.java
Show resolved
Hide resolved
test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Data/Vector.enso
Show resolved
Hide resolved
Another benchmark run to check the effect of |
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.
Mostly fine, apart from the warnings bit
distribution/lib/Standard/Base/0.0.0-dev/src/Internal/Array_Like_Helpers.enso
Outdated
Show resolved
Hide resolved
|
||
@BuiltinMethod( | ||
type = "Vector", | ||
type = "Array_Like_Helpers", | ||
name = "at", | ||
description = "Returns an element of Vector at the specified index.") |
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.
probably needs an update as well
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.
What kind of update would you suggest, @hubertp?
@Specialization(guards = "interop.hasArrayElements(values)") | ||
Vector fromArrayWithArrayLikeObject( | ||
Array vec, | ||
private static EnsoObject insertBuiltin( |
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.
Could probably just move this method to fromObject
?
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.
Done in 80a74d9e49
...ain/java/org/enso/interpreter/node/expression/builtin/immutable/InsertBuiltinVectorNode.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/vector/Array.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/vector/ArrayLikeHelpers.java
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/vector/ArrayLikeLengthNode.java
Outdated
Show resolved
Hide resolved
engine/runtime/src/main/java/org/enso/interpreter/runtime/data/vector/Vector.java
Show resolved
Hide resolved
ae89884
to
685580a
Compare
772f341
to
ba8931b
Compare
benchmark_results.pdf show the state of the benchmarks at the time of merging. Mostly improvements or on par. Slight regression at:
I merged anyway to avoid further conflicts. We can address the slowdowns in follow up issues. |
Pull Request Description
Fixes #6299 by:
Vector
&Array
- DoneArrayLikeLengthNode
andArrayLikeAtNode
& co. to access them - DoneImportant Notes
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR: