A simple python program to be the compiler for my own small language, YoctoScript
Project description
YoctoScript
A minimal scripting language and interpreter for learning, experimentation, and fun.
Overview
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.
Features
- 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.
Installation
Install the package via pip:
pip install Yoctium
Usage
Import and Run Code in Python
from Yoctium import Yoctium
code = '''
var x = 5
Console.display(x)
'''
interpreter = Yoctium()
interpreter.run_code(code)
Run YoctoScript Files from the Command Line
After installation, you can run YoctoScript files (with .ys extension) directly:
yoctorun my_script.ys
This will execute the code stored in my_script.ys.
Example YoctoScript
var name = read("What is your name? ")
Console.display("Hello, " + name)
Save as hello.ys and run:
yoctorun hello.ys
License
Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yoctium-1.0.1.tar.gz.
File metadata
- Download URL: yoctium-1.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbe58147b9c0852b0c758838522a1e7d5b8c37c478f78ffc7c7b412282c0e633
|
|
| MD5 |
1667d25fdc0bc0028dde0807f9dc945c
|
|
| BLAKE2b-256 |
916e6b466b3665739ea44209b7e00aca14776b2cf663ac389ca71c13558e5363
|
File details
Details for the file yoctium-1.0.1-py3-none-any.whl.
File metadata
- Download URL: yoctium-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36a6628faf6d7aa80aa6ab52958e637fc21422875aac8af024904141bdf2f892
|
|
| MD5 |
e3f831ffc2989b58ff97b43829626b52
|
|
| BLAKE2b-256 |
7f781737d392ec44611306d5824deff09665dc62e9bbb63065caec90f34f4057
|