Welcome to the official repository for the Demon programming language, a simple, dynamic, and object-oriented scripting language implemented in Rust.
- Dynamic Typing: Variables are dynamically typed.
- Familiar Syntax: C-style syntax that is easy to learn for developers coming from languages like C++, Java, or JavaScript.
- Object-Oriented: Supports classes, methods, and inheritance.
- First-Class Functions: Functions are first-class citizens and can be passed around like any other value.
- Garbage Collection: Automatic memory management using a simple garbage collector.
- Tree-Walk Interpreter: A straightforward and easy-to-understand interpreter implementation.
- Rust (latest stable version)
- For Windows users, Visual Studio Build Tools are required.
We provide simple installation scripts for both Linux/macOS and Windows.
-
Clone the repository:
git clone https://github.com/moah0911/Demon.git cd Demon/ -
Run the installation script:
chmod +x install.sh ./install.sh
This will build the interpreter and install it to
$HOME/.local/bin. -
Update your PATH: Add the following line to your shell's configuration file (e.g.,
~/.zshrcor~/.bashrc):export PATH="$HOME/.local/bin:$PATH"
Then, restart your terminal or run
source ~/.zshrc(or your shell's equivalent).
-
Clone the repository:
git clone https://github.com/moah0911/Demon.git cd Demon/demon-lang -
Run the installation script:
.\install.batThis will build the interpreter and add it to your user's
PATH.
Create a file named hello.dm with the following content:
print("Hello, World!");
Once installed, you can run it from your terminal:
demon hello.dmFor a deeper dive into the language features, check out the example scripts in the examples/ directory. They cover everything from basic control flow to classes and inheritance.
