Skip to content

IvoryScript is a lightweight scripting language primarily written in Java!

License

Notifications You must be signed in to change notification settings

SamhithPola2025/IvoryScript

Repository files navigation

IvoryScript

A lightweight, dynamically-typed scripting language implemented in Java. Simple syntax, easy to learn, fun to use.

Features

  • Dynamic typing
  • Arrays and dictionaries
  • Functions and classes with inheritance
  • Built-in string methods
  • REPL mode for interactive coding
  • Clean, readable syntax

Quick Start

  1. Compile the project:
javac -d out src/com/mainsrc/ivoryscript/*.java
  1. Run a file:
java -cp out com.mainsrc.ivoryscript.IvoryScript yourfile.ivory
  1. Or start the REPL:
java -cp out com.mainsrc.ivoryscript.IvoryScript

Recommended method to start the program:

  1. 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.jar

Documentation

Check out the docs folder for:

Example

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");

About This Project

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.

Screenshots:

image image

License

See LICENSE file for details.

About

IvoryScript is a lightweight scripting language primarily written in Java!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages