Smojo/Major V3
  • Java 92.1%
  • Forth 7.5%
  • Shell 0.2%
  • M 0.2%
Find a file
2026-03-23 10:14:44 +08:00
dependencies Release Smojo 1.3.7 2026-03-23 10:05:11 +08:00
dist Clean repository and add release jar 2026-03-23 10:09:43 +08:00
docs Release Smojo 1.3.7 2026-03-23 10:05:11 +08:00
src/com/terraweather/mini Clean repository and add release jar 2026-03-23 10:09:43 +08:00
tests Clean repository and add release jar 2026-03-23 10:09:43 +08:00
.gitignore Clean repository and add release jar 2026-03-23 10:09:43 +08:00
build.sh Clean repository and add release jar 2026-03-23 10:09:43 +08:00
LICENSE Release Smojo 1.3.7 2026-03-23 10:05:11 +08:00
README.md Add binary download note to README 2026-03-23 10:14:44 +08:00

Smojo

Smojo is a FORTH-like interpreter implemented in Java, with a small VM/runtime core and a larger standard library layered in .m scripts.

The current runtime banner reports version 1.3.7.

Features

  • FORTH-style stack-based execution model
  • interpreted and compiled words
  • execution tokens (XT) and immediate words
  • locals, blocks, branching, looping, and does>
  • Java-backed primitive libraries
  • script-based standard library modules
  • REPL support via jline

Repository Layout

  • src: Java sources and bundled .m scripts
  • bin: compiled classes
  • dependencies: external jars
  • tests: regression tests
  • docs: architecture notes and diagrams

Build

Smojo currently builds with a small bash script.

Create the runnable jar:

./build.sh

That produces:

dist/smojo-1.3.7.jar

If you want the raw class build instead, the equivalent manual steps are:

find src -name '*.java' | sort > /tmp/smojo-java-files.txt
javac -cp bin:dependencies/jline-1.0.jar -d bin @/tmp/smojo-java-files.txt

Run

Start the REPL from the jar:

java -jar dist/smojo-1.3.7.jar

Run a single command from the jar:

java -jar dist/smojo-1.3.7.jar "version?"

Download

If you just want the binary, download the packaged jar from the repository or the GitHub release assets:

dist/smojo-1.3.7.jar

Run it with:

java -jar dist/smojo-1.3.7.jar

Start the REPL from class files:

java -cp bin:dependencies/jline-1.0.jar com.terraweather.mini.REPL

Run a single command:

java -cp bin:dependencies/jline-1.0.jar com.terraweather.mini.REPL "version?"

Run a script:

java -cp bin:dependencies/jline-1.0.jar com.terraweather.mini.REPL path/to/script.m

Tests

Regression tests are currently small Java programs under tests, with one directory per bug fix.

Current tests:

Example:

javac -cp bin:dependencies/jline-1.0.jar -d tests/001-token-stream-restore/bin tests/001-token-stream-restore/TestSimpleInterpreterTokenStreamRestore.java
java -cp bin:dependencies/jline-1.0.jar:tests/001-token-stream-restore/bin TestSimpleInterpreterTokenStreamRestore

Architecture

See docs/architecture.md for a higher-level description of the runtime, interpreter, loader, compilation model, and SVG diagrams.

License

This project is licensed under the GNU General Public License v3.0 or later.

See LICENSE.