Skip to content

TreeList for asymptotically-efficient immutable lists [part 1: Thoth's]#1031

Merged
object-Object merged 10 commits intoFallingColors:mainfrom
s5bug:vector-fixes-2
May 6, 2026
Merged

TreeList for asymptotically-efficient immutable lists [part 1: Thoth's]#1031
object-Object merged 10 commits intoFallingColors:mainfrom
s5bug:vector-fixes-2

Conversation

@s5bug
Copy link
Copy Markdown
Contributor

@s5bug s5bug commented Apr 28, 2026

Fixes #804
Conflicts with #897

This is part 1, part 2 will change ListIota to use TreeList, part 3 will change the VM to use TreeList for the stack.

s5bug and others added 2 commits April 27, 2026 19:44
TreeList is an immutable collection ported from Scala's Vector class
Co-authored-by: Alwinfy <20421383+Alwinfy@users.noreply.github.com>
Copy link
Copy Markdown
Member

@object-Object object-Object left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM! Comments are mostly cleanups for maintainability, and suggestions to reduce addon breakage

Comment thread Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FrameForEach.kt Outdated
Comment thread Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FrameForEach.kt Outdated
Comment thread Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FrameForEach.kt Outdated
Comment thread Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FrameForEach.kt Outdated
Comment thread Common/src/main/java/at/petrak/hexcasting/api/casting/eval/vm/FrameForEach.kt Outdated
Comment thread Common/src/main/java/at/petrak/hexcasting/api/utils/TreeList.java
Comment thread Common/src/main/java/at/petrak/hexcasting/api/utils/TreeList.java
Comment thread Common/src/main/java/at/petrak/hexcasting/api/utils/TreeList.java Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For transparency - I mostly just skimmed this file, don't have the energy to review 3300 lines of Java right now. General notes:

  • Would it be worth bulk replacing the various instances of vector/Vector with treeList/TreeList respectively, or at least the public ones?
  • Can the various public members be moved to the top of their classes so it's easier for consumers to see what methods are available?
  • Could maybe use more doc comments on public members
  • Very optional, but some unit tests might be nice if it's not too much effort

@object-Object object-Object added this pull request to the merge queue May 6, 2026
Merged via the queue into FallingColors:main with commit f59b665 May 6, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this to ✅ Done in Hex Casting May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Iris with Thoths crash

2 participants