An interactive scripting language where you can read and modify code comments as if they were regular strings

Related tags


Zac Programming Language

An interactive scripting language where you can read and modify code comments as if they were regular strings. Add and view text-based visualizations and debugging information inside your source code file.

Try it in your browser right away

The experience is better locally though, read on!


Since this is an interactive editor, the best examples are moving use cases.

Built-in Help


Workbook style examples that don't go out of sync


Cargo Install Instructions

Make sure you have the Cargo package manager with a recent nightly Rust, and from inside this directory:

cargo install --path .

How To Run

As an example, open examples/hello.zac in your editor. Then, run (preferably through your editor)

zac examples/hello.zac

(or if you're a Rust coder)

cargo build --release
target/release/zac examples/hello.zac


More Examples

It's Better With Syntax Highlighting

If you're using Vim, there's a syntax file in the repo. Put this in your ~/.vim/syntax directory, or ~/.config/nvim/syntax if you're using Neovim, and follow the instructions at the top of the file.

Interactive Editing

It's highly recommended that you save the file from inside of your editor instead of changing windows. Zac is meant to be used like Gofmt or Rustfmt, run every time you save your file.

In Vim, you can use the following command to save your file:

:map \t :w\|:!zac %

Zac Language Overview

You'll have a better time getting a feel of how the language works from looking at and running examples than from reading detailed documentation. Other than comment modification, Zac is a familiar-looking scripting language.

Comments come in two flavors, anonymous and named.

// This is an anonymous comment because it doesn't have a #identifier as
// the first line.
// This cannot be referenced or modified from within the code.

let #changeme = // some string

// #changeme
// This is a comment with the name #changeme.
// In this program, it is modified twice, once above and once below
// using the `let` expression.
// After running this program, this comment will instead contain:
// // some string another string

let another_string = // another string
let #changeme = cat(#changeme, chr(32), another_string)

// Named comments can be changed before and/or after they appear in the source code. Zac will throw
// an error if there are two comments in a program with the same name.

As of now, there is no specific syntax for string literals, if you need a string literal, you can make a comment.


This is a proof-of-concept I made in the first Lang Jam, a 2-day competition to design a programming language around the theme first-class comments.

Submitted to the contest under the team name SOLDIER.

Sumeet Agarwal
Sumeet Agarwal
A memory safe Lua interpreter

Hematita Da Lua Hematita Da Lua is an interpreter for the scripting language Lua, written entirely in 100% safe Rust. Hematita is the portugese word f

Daniel 56 Sep 2, 2021
A script language like Python or Lua written in Rust, with exactly the same syntax as Go's.

A script language like Python or Lua written in Rust, with exactly the same syntax as Go's.

null 457 Sep 19, 2021
Rust library to interface with Lua

hlua This library is a high-level binding for Lua 5.2. You don't have access to the Lua stack, all you can do is read/write variables (including callb

Pierre Krieger 453 Sep 5, 2021
A library for functional programming in Rust

It contains purely functional data structures to supplement the functional programming needs alongside with the Rust Standard Library.

Jason Shin 885 Sep 11, 2021
Safe interop between Rust and C++

CXX — safe FFI between Rust and C++ This library provides a safe mechanism for calling C++ code from Rust and Rust code from C++, not subject to the m

David Tolnay 3.1k Sep 14, 2021
Embeddable ED in rust

Add-ED The standard editor, now as a library Some time ago I decided to write an ED clone with syntax highlighting. On my way to that goal I needed to

null 3 Aug 3, 2021
Safe Rust <---> GraalVM Polyglot bindings using procedural macros

The class macro is the primary way to generate bindings to Java types; it will generate a struct (with generics if specified) that implements Pass and Receive and has all the methods you give stubs for. The methods generated can be used like normal rust methods, however mutability is not enforced. The fully-qualified type name should precede a block containing method and constructor stubs. Java primitives like char, int, and byte are aliased to corresponding Rust types.

Alec Petridis 21 Aug 22, 2021
Zero-cost high-level lua 5.3 wrapper for Rust

td_rlua This library is a high-level binding for Lua 5.3. You don't have access to the Lua stack, all you can do is read/write variables (including ca

null 44 Sep 5, 2021
Embedding Rust in Java

Java/Rust Example An example project showing how to call into Rust code from Java. OSX Linux Windows Requirements Java 7+ Rust (tested with 1.0, night

drrb 294 Aug 9, 2021
A Rust crate for automatically generating C header files from Rust source file.

Please be aware that this crate is no longer actively maintained, please look into the much more feature rich cbindgen instead. rusty-cheddar rusty-ch

Sean Marshallsay 187 Jul 6, 2021
tokio-console prototypes

tokio-console prototypes ⚠️ extremely serious warning: this is pre-alpha, proof-of-concept software! currently, the wire format has no stability guara

Tokio 719 Sep 15, 2021
eJNI is a Rust crate to make working with Java's JNI less painful by providing abstractions.

eJNI provides abstractions for often-used classes from the Java standard library, like Map and List. Besides this eJNI also provides easy ways to work with Java's primitives and their object counterparts (e.g int and Integer).

Tobias de Bruijn 7 Aug 12, 2021
Automatically generates Rust FFI bindings to C (and some C++) libraries.

bindgen bindgen automatically generates Rust FFI bindings to C (and some C++) libraries. For example, given the C header doggo.h: typedef struct Doggo

The Rust Programming Language 2.3k Sep 17, 2021
“The Tie Between Ruby and Rust.”

Rutie Rutie — /ro͞oˈˌtī/rOOˈˌtI/rüˈˌtaI/ Integrate Ruby with your Rust application. Or integrate Rust with your Ruby application. This project allows

Daniel P. Clark 526 Sep 8, 2021
A setuptools/wheel/cffi extension to embed a binary data in wheels

Milksnake Milksnake is an extension for setuptools that allows you to distribute dynamic linked libraries in Python wheels in the most portable way im

Sentry 698 Sep 2, 2021
Easy way to write Node.js module using Rust

node-bindgen Easy way to write native Node.js module using idiomatic Rust Features Easy: Just write idiomatic Rust code, node-bindgen take care of gen

InfinyOn 208 Sep 5, 2021
WebAssembly implementation from scratch in Safe Rust with zero dependencies

wain wain is a WebAssembly INterpreter written in Rust from scratch with zero dependencies. An implementation of WebAssembly. Features: No unsafe code

Linda_pp 178 Sep 6, 2021
Lineiform is a meta-JIT library for Rust interpreters

Lineiform Lineiform is a meta-JIT library for Rust interpreters. Given an interpreter that uses closure generation, it allows an author to add minimal

null 6 Sep 12, 2021
Native Ruby extensions written in Rust

Ruru (Rust + Ruby) Native Ruby extensions in Rust Documentation Website Have you ever considered rewriting some parts of your slow Ruby application? J

Dmitry Gritsay 780 Sep 3, 2021