Inspiration
Rhovas is inspired by a number of core problems in many modern-day languages - though other solutions exist for these problems, Rhovas's design principle of 'performance first, safety second' and emphasis on API enforcement presents new ideas that don't restrict performance.
What it does
Rhovas itself is a set of semantic specifications on how the language must work. This project is primarily a compiler for the language that can compile and execute .rho files on the Java Virtual Machine.
How I built it
Rhovas uses Antlr4 to define and generate a parser to handle constructing an abstract syntax tree. The AST is then managed and printed into Java. Early testing involved the use of Jasmin to generate .class files using direct bytecode manipulation.
Challenges I ran into
Transforming the AST was generally pretty straightforward, however field initializers using constructor parameters (in the form 'var x = ctor.x`) were incredibly difficult to get working as they require some significant movement of the AST and a strong understanding of the initialization dependencies. I also had difficulty working with Java's Process system to invoke the Java compiler and execute the built class files.
Accomplishments that I'm proud of
The core features of the language are all support and translate properly into Java, though there is only minimum available validation. I am also pleased with the syntax highlighting in the source file, which was much easier to set up than I believed and well worth the time.
What I learned
Actually parsing the language is one of the easiest steps of the process (even without the use of tools like Antlr), and there's much more work to be done. I certainly know more about compiler design and grammar production than when I started, but I realize now there are greater challenges ahead.
What's next for Rhovas
With the first compile created, Rhovas can now enter a design-test-feedback system to further solidify its syntax and improve the language. The next major project is validating the source, which starts with implementing a proper type system and scoping module.
Log in or sign up for Devpost to join the conversation.