(The Scala Center team is dedicated to providing regular and transparent community updates about project plans & progress. In this forum we created a new topic category to allow quicker orientation going forward: “Scala Center Updates”. Even though all feedback is welcome, we keep the right to make executive decisions about projects we lead. Overview of all our activities can always be found at https://scala.epfl.ch/records.html)
Dear Scala contributors,
The Scala Center is happy to announce the road-map for Scala Native.
Scala Native (SN) was adopted by the Scala Center about three months ago. During this period, we have taken a good look into the project and its prospects. In this post, we would like to share our findings and why we decided to continue our investment in the Scala Native project.
Importance of Scala Native
Scala Native is interesting, because, as its description says, it is “Scala on bare metal”. This means that you can write your program in Scala and get an output that does not have the overhead of the JVM.
More importantly:
- Scala Native is a Scala platform that can interoperate with native C/C++ libraries, in an easy and elegant way. Ultimately, a Scala Native application is a native application, with no JVM dependencies.
- Interoperability with native libraries is a remarkable prospect, because it means that we can have programs (a) written in a strong functional language, that (b) take advantage of the functionality and the performance characteristics of such libraries.
- Scala Native can already be used to do systems programming. Richard Whaling has written a book on that very topic.
As shown, Scala Native is already meaningful for some areas, while it can become very significant for others. This is what drives us forward and why we are investing in Scala Native.
Current Status
At the moment, Scala Native is mature enough to build fast native applications from Scala projects, with optional C/C++ components. It has its own IR, called the NIR, which translates to LLVM IR and, ultimately, to a native executable.
It also supports low-level primitives, in order to do low-level manipulations, for example on memory, files, etc. It can also seamlessly interoperate with the standard C library, or any external library for that matter.
On the other hand, we are aware that SN falls a little bit behind, as far as the evolution of the Scala language goes (SN currently supports only Scala 2.11). It could also benefit from a simpler and more practical testing framework, with decent reflection support.
Next Steps
Based on all of the above, we are taking the following actions to ensure the Scala Native evolution, both in terms of catching up with the Scala language, as well as making it easier for developers to port their applications.
Short-term goals (within May 2020):
- We have recently merged reflective instantiation support. We will make sure that the SN testing infrastructure is updated to make use of it. This will hugely simplify the testing infrastructure and will open the way so that developers and library maintainers can easily write native tests for their applications.
Mid-term goals (until September 2020):
- We will be making sure to upgrade Scala Native to Scala 2.12 and, later, Scala 2.13. This is important because SN needs to evolve together with the Scala language.
We truly believe that Scala Native can become an essential part of the Scala ecosystem. The above actions are the fundamental first steps to be taken towards that objective.
Once we have completed the short and mid-term goals, we can look forward to longer term goals.
Long-term goals:
- Improve and enhance native interoperability, so that Scala Native can support as many libraries as possible.
- Keep up with the Scala language releases.
Conclusion
The Scala Center team that will be working on Scala Native will consist of 2 engineers (1 full-time and 1 part-time). You can expect us to be more responsive to issues on Github (this includes the issues that are already open), but we also ask you to please be patient. We are aware there has been a vacuum period and there’s much to catch up with.
In the beginning, we will be prioritising contributions that take us closer to the short-term goals described above. However, all contributions are welcome, so if you have a cool idea, we encourage you to open a PR.
We are looking forward to making progress with SN and we hope that the community will actively participate in this effort, with feedback and contributions.
Stay tuned for updates and we hope that you decide to go native!
- The Scala Center Team