What is this project? 💡
OctaneMini is a tiny proof-of-concept programming language that compiles a single source file into JVM bytecode. The compiler and runtime are implemented in Java; the intended use is experimental and educational — to demonstrate parsing and manual JVM classfile emission.
-
Build the module:
- From the module folder:
cd newUpdates/ImperativeStaticCompiledLangOneFile && mvn package - From repo root:
mvn -f newUpdates/ImperativeStaticCompiledLangOneFile/pom.xml package
- From the module folder:
-
Run the compiler (no args will read
main.octaneand writeMain.class):- With Java:
java -cp target/octaneLangSimpleStaticCompiled-1.0.0.jar org.berlin.staticlang.CompiledLangOneFile - With Maven exec:
mvn -f newUpdates/ImperativeStaticCompiledLangOneFile/pom.xml exec:java -Dexec.mainClass="org.berlin.staticlang.CompiledLangOneFile"
- With Java:
-
Verify output:
javap -c Main.class(orjavap -v Main.class) to inspect generated bytecode.
newUpdates/ImperativeStaticCompiledLangOneFile/src/org/berlin/staticlang/CompiledLangOneFile.java— entry point, lexer, parser, AST, and visitor that drives compilation.newUpdates/ImperativeStaticCompiledLangOneFile/src/org/berlin/staticlang/Code.java— bytecode emitter helpers and code buffer logic.newUpdates/ImperativeStaticCompiledLangOneFile/src/org/berlin/staticlang/JavaCompilerHelper.java— JVM constants, constant pool helpers, and class file builders.newUpdates/ImperativeStaticCompiledLangOneFile/main.octane— example source used when no CLI argument is provided.
Note:
doc/directories contain copy/demos; prefer editing code undersrc/.
- Java compatibility: the module targets Java 1.5 (see
pom.xmlproperties). Avoid changes that assume newer classfile features unless intentional. - The compiler builds JVM classfiles manually (constant pool, attributes, code sections). Use
JavaCompilerHelper.ByteCodesconstants when modifying opcodes. - Parser style: recursive-descent + visitor (
ProgramVisitor) — most grammar/tokenization logic is inCompiledLangOneFile.
- Make focused changes in
src/files. Avoid editingdoc/copies unless documentation updates are intended. - Build:
mvn -f newUpdates/ImperativeStaticCompiledLangOneFile/pom.xml package. - Run compiler and inspect
Main.classwithjavap -c Main.class. - Add small tests under
test/when adding behaviors; toggle SurefireskipTestsinpom.xmlto run them in CI.
Author: Berlin Brown — see repository for license and historical notes.