apple / pkl

A configuration as code language with rich validation and tooling.
https://pkl-lang.org
Apache License 2.0
10.38k stars 280 forks source link

Vendor org.graalvm.collections #795

Open translatenix opened 1 week ago

translatenix commented 1 week ago

Motivation: Package org.graalvm.collections is used throughout the Pkl codebase. It is most heavily used in the Truffle interpreter, which requires putting most collection methods behind @TruffleBoundary. At the moment, this is done by wrapping collection methods with static methods declared in classes EconomicMaps and EconomicSets. However, static wrapper methods are inconvenient to use, decrease code readability, add some overhead, and are easy to forget about.

Changes:

Result: Cleaner, safer, and more efficient code.

bioball commented 1 day ago

I am not sure we want to do this. This makes it hard to upgrade the collections library, and I'm not sure how much of a performance gain we get out of this.

and are easy to forget about

Thankfully, our CI builds (on main) will catch these errors if they are forgotten.

Curious about @holzensp and @stackoverflow's thoughts