Introduction to Rava2

Rava2 is a complete Java source code interpreter written in C. It parses Java source files and executes them directly via AST interpretation without bytecode compilation.

Key Features

  • Direct Execution: Run .java files directly without compilation.
  • Modern Java Support: Lambdas, streams, records, sealed classes, pattern matching, text blocks.
  • Full Threading: Thread class with start, join, sleep, yield support.
  • Standard Library: Implementations of java.lang, java.util, java.io, and java.net packages.
  • Memory Safe: Built-in overflow protection, automatic cleanup, valgrind-clean.
  • Lightweight: Minimal footprint compared to traditional JVMs.

Quick Start

./rava2 HelloWorld.java

Example program:

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello, Rava2!");

        var numbers = Arrays.asList(1, 2, 3, 4, 5);
        numbers.stream()
            .filter(n -> n % 2 == 0)
            .forEach(System.out::println);
    }
}

Supported Java Features

CategoryFeatures
TypesClasses, interfaces, enums, records, sealed classes, generics
Control Flowif/else, for, while, switch expressions, try-catch-finally
Modern FeaturesLambdas, method references, streams, pattern matching, text blocks, var
ThreadingThread creation, join, sleep, synchronized blocks
I/OFile operations, readers, writers, buffered streams
NetworkingTCP sockets, server sockets, HTTP support

Documentation Guide

Running Examples

Rava2 comes with example programs demonstrating various features:

./rava2 examples/01_hello_world.java
./rava2 examples/08_lambdas_streams.java
./rava2 examples/20_basic_threads.java

Visit the Examples page to try them interactively.