How To Create Your Own Programming Language Based On Java ♨️

Robusta programming language.

I graduated from college on 2017, one year later one of my professors asked me to come and teach some computer science courses, happily I said yes.

So I started to teach the basics of programming to freshmen students, one of the courses was about “Java’s cool”, which is a basic programming language based on Java, I will explain in this article how I rewrote and upgraded it.

Java’s cool was initially created by researchers from Nice University in southern France and was since then widely adopted in the education field, many french students learn Java’s cool as their first programming language as it’s being taught in high schools, colleges and vocational training centers.

From the above software we wanted to create a more elegant and less CPU consuming solution to teach the basics of programming to freshmen students in Paris 12 University.

That’s how Robusta project started !

  • Robusta is a basic programming language based on Java.
  • Robusta.jar is the core component, it’s basically a CLI tool.
  • Robusta-vscode is an extension to provide Robusta language support to vscode.

Robusta’s syntax 👩‍🏫

The syntax of Robusta is very similar to Java, as a matter of fact you can execute any Java code on Robusta, that’s because Robusta uses a Java compiler and runtime environment under the hood.

The syntaxic simplicity of Robusta brings ease to the learning process of programming for the first time.

Unlike Java, you don’t have to create a class to start coding in Robusta, which means that as a professor you don’t have to explain what a class is to a student who has never wrote a “Hello World” program.

Also, System.out.print() of Java becomes print() in Robusta, so all the confusing principles of the static “print” method called on the “out” static field of the “System” class in Java are abstracted by the simple “print” function in Robusta, many other functionalities are simplified in Robusta, a non-exhaustive list can be found here.

Robusta.jar 🧙🏻‍♂️

Robusta’s code should be written in a .jvs file (to keep the compatibility with Java’s cool), after its compilation a standalone executable jar archive is created.

This is how it’s done :

The command above generates an executable jar file having the same name as the .jvs file.

But how is-it done under the hood ? 🤹🏻‍♂️

Robusta.jar will basically take the content of the Robusta code and wraps it by some code as below :

That’s it, as simple as it seems Robusta is just a wrapper ! Students actually write Java code when they think they are coding in Robusta.

  • Console: is a Swing Terminal to display the result of print methods.
  • Drawer is a Swing window for 2D drawing functionality in Robusta.
  • All the static imports are for methods that could be used in a Robusta program.

You can download and find more about Robusta.jar here.

Robusta in VSCode 🤝

To provide a complete development environment, I also created an extension that makes programming in Robusta possible on the famous Visual Studio Code IDE.

The extension basically has 4 features :

  1. Robusta code execution: As the extension interacts with Robusta.jar you can directly compile Robusta code from VSCode.
  2. Problem matcher: In case of a compilation problem occurs, the problem matcher directly underlines the code causing the problem and displays the error message on hovering it.
  3. Code formatting / Colorization.
  4. Code Snippets.

The final product 🔮

Robusta is now being taught in Paris 12 University since 2019 and I hope for many years to come, it’s distributed under the terms of the MIT license.

You can find the source code of Robusta here, and for Robusta-vscode here, we welcome all kinds of contributions.

If you find this article interesting, feel free to let a comment below and / or click on the 👏 button.

Lead Software Engineer working across multiple technologies and frameworks. Always willing to challenge my problem solving skills.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store