A minimal scripting language and interpreter for learning, experimentation, and fun.
YoctoScript is a lightweight scripting language, designed to be simple and approachable. The core of the project is the Yoctium interpreter, which executes YoctoScript code and allows you to experiment with language design and scripting.
- Variable Declarations — Use
var x = 5to create variables. - Function Calls — Built-in calls like
Console.display("Hello"). - Built-in Types and Functions — Includes
String,read(for input), and more. - Command-Line Execution — Run
.ysscripts directly from the terminal. - Error Reporting — Helpful errors with line numbers.
- Easy to Extend — Simple Python codebase for adding your own features.
Install the package via pip:
pip install Yoctiumfrom Yoctium import Yoctium
code = '''
var x = 5
Console.display(x)
'''
interpreter = Yoctium()
interpreter.run_code(code)After installation, you can run YoctoScript files (with .ys extension) directly:
yoctorun my_script.ysThis will execute the code stored in my_script.ys.
var name = read("What is your name? ")
Console.display("Hello, " + name)
Save as hello.ys and run:
yoctorun hello.ysApache License 2.0