Skip to content

πŸ’€πŸ“œ A lightweight, Python-inspired scripting language with emoji support and modern features.

License

Notifications You must be signed in to change notification settings

cryptrunner49/zscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

85 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’€πŸ“œ ZScript

ZScript is a lightweight, expressive scripting language inspired by Python β€” but with its own minimalist and expressive style. It supports Unicode and emoji identifiers, functional programming constructs, file I/O, and can be embedded as a shared C library. Whether you're automating tasks, scripting games, or exploring creative code, ZScript makes it simple and fun.


πŸš€ Quick Start

var hello = "Hello, World!";
println(hello);  // Outputs: Hello, World!

πŸ“– Explore language features in the Usage Guide β†’


✨ Features

  • 🌍 Unicode & Emoji Identifiers β€” Name variables Ο€, 🐱, or any emoji you like.
  • 🧠 Familiar Python-like Syntax β€” Use var, const, func, if, for, and more.
  • βš™οΈ Built‑in Functions β€” clock(), shuffle(), random_between() and others built-in.
  • πŸ“ File I/O β€” read_file() and write_file() to handle files natively.
  • 🧱 Structs & Closures β€” Define custom types and encapsulate behavior.
  • 🐧 Linux‑Only β€” Runs out of the box on most Linux distributions.
  • 🧬 Embeddable VM β€” Integrate ZScript with C, Go, Rust, or C++ applications.

πŸ”½ Download

Get the latest prebuilt binaries and development files from the Releases β†’:


βš™οΈ Installation

βœ… Requirements

  • OS: Linux (Debian, Ubuntu, Fedora, Arch, etc.)
  • Tools: gcc, make, pkg-config, libffi, readline
  • Go (Golang)

🧰 Install with Script

System-wide:

curl -sL https://github.com/cryptrunner49/zscript/raw/refs/heads/main/install.sh | bash -s -- install --system

User-only:

curl -sL https://github.com/cryptrunner49/zscript/raw/refs/heads/main/install.sh | bash -s -- install --user

πŸ— Build from Source

git clone https://github.com/cryptrunner49/zscript.git
cd zscript
make vm
./bin/zvm samples/scripts/rpg_game.z

🧠 Embedding ZScript

ZScript is easy to embed in other languages like C, Go, C++, and Rust.

βœ… Example in C

#include "libzscript.h"
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {
    ZScript_Init(argc, argv);

    if (argc > 1) {
        ZScript_RunFile(argv[1]);
    } else {
        int exitCode;
        char* result = ZScript_InterpretWithResult("1 + 2;", "<script>", &exitCode);
        if (exitCode == 0) printf("Last value: %s\n", result);
        else printf("Execution failed with code %d\n", exitCode);
        free(result);
    }

    ZScript_Free();
    return 0;
}

πŸ›  Build & Run

make lib
gcc -o run_sample samples/lib/c/sample.c -Lbin -lzscript -Ibin
LD_LIBRARY_PATH=bin ./run_sample

πŸ” More Embedding Examples

Find ready-to-run embedding samples in:

These show how to use ZScript with FFI across different ecosystems.


πŸ§ͺ Platform‑Specific Setup

Ubuntu / Debian

sudo apt update
sudo apt install gcc pkg-config make golang libffi-dev libreadline-dev

πŸ—Ί Roadmap

What’s next for ZScript?

  • Elif
  • Pattern Matching
  • Switch Statement
  • Enums
  • Error Handling
  • Standard Library

✨ Track progress or suggest features via Issues β†’


🀝 Contributing

We’d love your help! Whether it's fixing bugs, improving docs, or proposing featuresβ€”your contributions matter.

πŸ‘‰ See the Contributing Guide β†’ to get started.


πŸ“„ License

ZScript is licensed under the GNU GPL-3.0.
See the LICENSE for details.

About

πŸ’€πŸ“œ A lightweight, Python-inspired scripting language with emoji support and modern features.

Resources

License

Stars

Watchers

Forks

Packages

No packages published