The “One VM” Concept – towards the holy grail of polyglot programming
Would it be fair to say that the GraalVM is a step closer to the holy grail of polyglot programming? Yes, according to the virtual machine experts from MicroDoc. Here’s an overview of what the GraalVM can do for software developers.
It was designed to be the programming interface of the future for the Oracle database, and therefore much effort and vast resources have been put into the development of the Graal virtual machine.
According to MicroDoc’s managing director Dr. Christian Kuka this ensures not only an array of interesting features that will make life easier for developers and project managers. On top of that, you can consider GraalVM to be future proof. As part of the Oracle database product it has a life cycle is 10+ years.
Speaking all languages
– This allows for easy integrating of machine learning, neural networks and deep learning applications into your usual business applications. Most of the KI algorithms are written in Python, but currently, if you want to integrate them into some kind of mainstream software-product, you have to rewrite them in Java or C/C++ to use them in your code. So, normally you would have one developer write the prototype application in Python and another rewrite it in whatever language is running on the target platform/device. With GraalVM there’s no need for rewriting, because you can run Python, Java and C not only on the same virtual machine but also at the same time in the same process.
Mix as you like
Moreover, developers can choose the programming tools they are most comfortable with and which fit the best for the task at hand. They can even use different languages in one single program, and run everything using the safe environment of the GraalVM. Also, they can debug from one language to another.
– Many people have put a lot of effort into the infrastructure of theses languages and that gives you more quality and stability, compared to newer and less mature languages like R or Ruby.
– Furthermore you can use GraalVM as the runtime for you own application specific language by extending it. You can choose to extend it yourself or let MicroDoc do it for you.
Good for working together
And even when it comes to long-term projects running over several years, due to the polyglot features of the GraalVM, senior developers can write in their preferred coding language, while new developers are free to choose something else. And senior developers will not be restricted to just maintaining old code, while the youngsters can have a go at the new and fancy stuff. Both parties can work in the same world, on equal terms.
Updating legacy code
Also, the GraalVM creates a new possibility for handling legacy code. Currently if you want to update legacy applications, you can choose to rewrite them from scratch, or write software around them to add additional APIs. Rewriting part of the legacy software in a different language, and keeping the remaining part unchanged has been very complicated in the past because you had to integrate code over language and runtime system barriers, for instance code running in a VM with native code running directly on the OS.
Now you can just run the legacy stuff in the GraalVM together with new code. For instance you can take out one class, write it in Java and take another functionality and rewrite it in Python. Everything will be running on the same VM, communicating inside the virtual environment.
At the same time, using the GraalVM makes decision-making easier, when it comes to new projects.
– When you start a new project you always discuss which language and which libraries to use, says Dr. Christian Kuka.
– That can be tricky, as one project is always connected somehow to a lot of other projects. The polyglot feature of the GraalVM allows you to choose much more freely. So, all in all, the GraalVM has a lot to offer, to developers as well as to project managers. It will make embedded development significantly more agile, efficient and future-proof.