Learn all about miniboxing in a 5 minute demo.

Will miniboxing be merged into Scala?

(back to news articles )

Lately the question of merging the miniboxing plugin into the Scala compiler has arisen in different contexts. We have seen Scala collections miniboxed by hand, and we have even received a suggestion that miniboxing should be an opt-out instead of opt-in, meaning that all type parameters automatically undergo the miniboxing transformation, as if they were annotated with @miniboxed .

We are very glad such questions are asked, as it gives us the opportunity to clarify the roadmap.

So, will the miniboxing plugin be merged into Scala?

Short answer

It depends on you! For now, it will stay a plugin, but the more projects use miniboxing, the more chances it has to become the standard.

###Long answer:

Miniboxing is not currently on the Scala roadmap, but we can change that!

The first step for any plugin that changes the compilation pipeline is to become trusted. And to do so, we need projects using it and reporting their experience. We have already tested the Scala linked list with 1.5-4x speedups, the spire library and we will continue trying other use-cases. But there’s a huge number of cool projects that could use the miniboxing transformation and we need your help!

So if you’d like to see miniboxing in Scala:

If the miniboxing plugin becomes a common sight in Scala project builds, it may be worth merging it into scalac . Then again, having it as a scalac plugin means easier development and quicker fixes, so keeping it a plugin might not a bad solution at all.

To wrap up, miniboxing will stay as a separate compiler plugin at least for the next Scala release. Whether or not it will become part of scalac in the future depends on you!

Will Scala collections be transformed with miniboxing?

We aim to have an alternative set of collections transformed using miniboxing, which map 1:1 with Scala collections. But this is a medium-term goal.

Will miniboxing become opt-out?

YES! We are currently working on a flag that will turn miniboxing on by default. Stay tuned! :)

Comments

Comments are always welcome! But to make the best use of them, please consider this:

If you have questions or feedback regarding the content of this page, please leave us a comment!

If you have general questions about the miniboxing plugin, please ask on the mailing List.

If you found a bug, please let us know on the github issue tracker.

Thanks! Looking forward to your messages!

Please enable JavaScript to view the comments powered by Disqus.

Disqus