A lightweight, dynamically-typed scripting language implemented in Java. Simple syntax, easy to learn, fun to use.
- Dynamic typing
- Arrays and dictionaries
- Functions and classes with inheritance
- Built-in string methods
- REPL mode for interactive coding
- Clean, readable syntax
- Compile the project:
javac -d out src/com/mainsrc/ivoryscript/*.java- Run a file:
java -cp out com.mainsrc.ivoryscript.IvoryScript yourfile.ivory- Or start the REPL:
java -cp out com.mainsrc.ivoryscript.IvoryScript- Run the JAR file (or go to releases):
- To execute a script:
java -jar releases/IvoryScript.jar yourfile.ivory- To start the REPL:
java -jar releases/IvoryScript.jarCheck out the docs folder for:
- Getting Started - How to build and run
- Syntax Guide - Language syntax reference
- Edge Cases and Rules - Important gotchas
- Built-in Functions - Function reference
- Examples - Code examples
var name = "World";
print "Hello, " + name + "!";
var arr = [1, 2, 3];
print arr[0]; // 1
fun greet(name) {
return "Hello, " + name;
}
print greet("Alice");
"Alice");
This interpreter follows the structure and approach from Crafting Interpreters by Robert Nystrom. The book is an amazing resource for learning how interpreters work, and this project implements many of the concepts from it.
I'm still learning programming and language implementation, so this isn't the most complex or optimized interpreter out there. But it works, and building it has been a great learning experience. The code is straightforward and readable, which makes it easier to understand and modify if you're also learning.
See LICENSE file for details.