Will miniboxing be merged into Scala?
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:
- Start using it as a plugin, no matter how big or small your project is! Rest assured that with 150+ tests running with each commit, there’s little risk that miniboxing will break your code;
- Ask questions on the mailing list or via twitter;
- Report any errors you encounter on the github issue tracker;
- Write about your use-case and submit a pull request for the website (we welcome contributions!);
- Help spread the word, so others can use miniboxing too.
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!
comments powered by Disqus