GitHub – zscriptlang/zscript: The ZScript Compiler.


ZScript is a modern, type-safe high level programming language that transpiles to JavaScript.
It focuses on structured control flow, explicit execution ordering, and compile-time power without adding runtime overhead.

This repository contains the official ZScript compiler (zsc), grammar, and tooling.


For Doing Tests i have used Jules because i dont have any servers of linux etc.
We need more users and developers to support ZScript.
Also ZScript is Fully Open that means if you have Desing and porpsal for language Syntax or Features etc you can directly make a isuue and I will accept it if it is nice.

ZScript is designed for developers who want more control than JavaScript offers while still staying inside the JavaScript ecosystem.

Instead of introducing heavy runtime abstractions, ZScript performs most of its work at compile time and emits clean, readable JavaScript that runs on Bun.

ZScript is still evolving, but it is already usable and stable for experimentation, tooling, and language research.


  • Current version: v0.4.1
  • Stage: Active development
  • Stability: Stable compiler, evolving language

ZScript is currently developed and maintained by a single developer.

To grow the project further, help from developers, compiler enthusiasts, and testers is needed.
Contributions, feedback, and real-world testing are highly appreciated.


compiler/ – ZScript compiler (zsc)

grammar/ – ANTLR grammar and generated files

examples/ – Example ZScript programs


ZScript ships with a single official tool: zsc.

Transpile a .zs file to JavaScript:

The generated JavaScript is written to:

Compile and run immediately using Bun:

zsc run main.zs --arg1 arg2

Any arguments after the file name are forwarded to the program.

zsc integrates directly with Bun and can forward Bun commands without even needing bun installed on system:

zsc bun install
zsc bun add antlr4
zsc bun run index.js

This allows ZScript projects to use the full JavaScript ecosystem naturally.


From v0.4.1 ZScript has added robust and powerful Type Checking System.
And it has been tested on Jules Also by the test scripts in example folder.

ZScript provides explicit control over execution order.

Execute code at the end of a block in last-in, first-out order:

fn example() {
  defer console.log("cleanup");
  console.log("work");
}

Execute code at the end of a block in first-in, first-out order:

fn example() {
  queue console.log("step 1");
  queue console.log("step 2");
}

Fixed-count loops without boilerplate:

repeat 3 {
  console.log("hello");
}

Inverse while loop:

unless (ready) {
  wait();
}

Explicit infinite loop:

Standard loop control statements are fully supported.

Clear and expressive alias for throw:

Some JavaScript features are intentionally harder to access directly in ZScript.

When full control is required, a raw JavaScript block can be used:

js {
  const fs = require("fs");
  console.log("raw js");
}

The js keyword is removed during transpilation, and the code inside is emitted exactly as written without any transformation.


  • Compile-time power, runtime simplicity
  • Explicit behavior over implicit magic
  • Clean, readable generated JavaScript
  • Small, composable language features

ZScript aims to explore better structure and clearer intent on top of JavaScript rather than replacing it.


ZScript is currently maintained by a single developer.

You can help by:

  • Reporting bugs
  • Writing examples
  • Improving documentation
  • Testing edge cases
  • Discussing language design

Even small contributions are valuable.


This Tools Helped in ZScript Development.


MIT License


ZScript is an experiment in structured control flow and explicit execution on top of JavaScript.

If that idea interests you, you are welcome to contribute.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *