Skip to content

berlinbrown/ImperativeStaticCompiledLangOneFile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OctaneMini β€” Imperative Static Compiled Language (one-file)

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.


Quick start πŸ”§

  • Build the module:

    • From the module folder: cd newUpdates/ImperativeStaticCompiledLangOneFile && mvn package
    • From repo root: mvn -f newUpdates/ImperativeStaticCompiledLangOneFile/pom.xml package
  • Run the compiler (no args will read main.octane and write Main.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"
  • Verify output: javap -c Main.class (or javap -v Main.class) to inspect generated bytecode.


Key files & structure πŸ“‚

  • 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 under src/.


Conventions & important notes ⚠️

  • Java compatibility: the module targets Java 1.5 (see pom.xml properties). Avoid changes that assume newer classfile features unless intentional.
  • The compiler builds JVM classfiles manually (constant pool, attributes, code sections). Use JavaCompilerHelper.ByteCodes constants when modifying opcodes.
  • Parser style: recursive-descent + visitor (ProgramVisitor) β€” most grammar/tokenization logic is in CompiledLangOneFile.

Development workflow βœ…

  1. Make focused changes in src/ files. Avoid editing doc/ copies unless documentation updates are intended.
  2. Build: mvn -f newUpdates/ImperativeStaticCompiledLangOneFile/pom.xml package.
  3. Run compiler and inspect Main.class with javap -c Main.class.
  4. Add small tests under test/ when adding behaviors; toggle Surefire skipTests in pom.xml to run them in CI.

Contact & history

Author: Berlin Brown β€” see repository for license and historical notes.

About

Imperative Compiled Language in One Source File for the JVM

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages