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

Overview

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!

GoL

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

Built-in Help

help

Workbook style examples that don't go out of sync

fib

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

hello

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 %
   :e
   

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.

Status

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.

You might also like...
Ethereal - a general-purpose programming language that is designed to be fast and simple
Ethereal - a general-purpose programming language that is designed to be fast and simple

Ethereal is a general-purpose programming language that is designed to be fast and simple. Heavly inspired by Monkey and written in Rust

A project for generating C bindings from Rust code

cbindgen   Read the full user docs here! cbindgen creates C/C++11 headers for Rust libraries which expose a public C API. While you could do this by h

Run Java code from Rust!

Java Native Interface Bindings for Rust This library provides complete FFI bindings to the Java Native Interface, as well as a safe and intuitive wrap

Guarding 是一个用于 Java、JavaScript、Rust、Golang 等语言的架构守护工具。借助于易于理解的 DSL,来编写守护规则。Guarding is a guardians for code, architecture, layered.

Guarding Guarding is a guardians for code, architecture, layered. Using git hooks and DSL for design guard rules. Usage install cargo install guarding

A Web-App written in Rust with Yew, using the same SyntaxHighlighter from Google Code Archive as planetb.ca

PlanetB SyntaxHighlighter About This is a small app, providing static files to have a frontend to format your code so you can paste it with styles to

Twiggy🌱 is a code size profiler
Twiggy🌱 is a code size profiler

Twiggy 🌱 A code size profiler for Wasm Guide | Contributing | Chat Built with 🦀 🕸 by The Rust and WebAssembly Working Group About Twiggy is a code

Rust library for build scripts to compile C/C++ code into a Rust library

A library to compile C/C++/assembly into a Rust library/application.

This tool converts Lua code to TS automatically, including the conversion of common standards to their TS equivalents.

lua-to-ts This tool converts Lua code to TS automatically, including the conversion of common standards to their TS equivalents. Code that fails to be

A collection of unsound rust functions using entirly *safe* code

A collection of unsound rust functions using entirly *safe* code

Owner
Sumeet Agarwal
Sumeet Agarwal
A simple programming language made for scripting inspired on rust and javascript.

FnXY Programming Language Quick move: CONTRIBUTING | LICENSE What? FnXY is a simple programming language made for scripting inspired on rust and javas

null 2 Nov 27, 2021
A shell scripting language

Slash The system level language for getting the job done. Detailed documentation is available on the Slash site Motivation Bash is an awesome shell, b

null 27 Jun 17, 2022
A small scripting language running on V8.

Rook A small scripting language running on V8. After spending a few hours playing with V8, it seems like the only way to make this work is by transpil

Ryan Chandler 2 Dec 16, 2022
A forth-inspired, bytecode-compiled scripting language for Anachro Powerbus

Anachro Forth (core) Anachro Forth is a forth-inspired, bytecode-compiled scripting language for Anachro Powerbus platform. Use Case The intended use

null 14 May 27, 2022
A small embeddable scripting language

There is currently a tree-walking interpreter called bird in progress, but the plan is to have a bytecode vm in the end language_name is a small embed

nils 15 Dec 10, 2022
Sol is a lightweight language primarily designed for scripting environments

☀️ Sol A dynamically-typed (for now) and procedural programming language. About Sol is a lightweight language primarily designed for scripting environ

Joshua 3 Jul 25, 2022
whydia is a small embeddable scripting language

whydia is a small embeddable scripting language It's inspired by Javascript, Lox, Lua, Python, Rust and more Reference Overview Declaring variables us

Adi Yenuubarii 4 Apr 15, 2022
zzhack-cli is a Command Tool to help you quickly generate a WASM WebApp with simple configuration and zero code

English | 中文文档 zzhack-cli is a Command Tool that can help you quickly generate a WASM WebApp with simple configuration and zero code. It's worth menti

null 17 Feb 9, 2023
WASM bindings for React - enables you to write and use React components in Rust

This library enables you to write and use React components in Rust, which then can be exported to JS to be reused or rendered.

Yichuan Shen 55 Dec 24, 2022
plugy empowers you to construct agnostic dynamic plugin systems using Rust and WebAssembly.

plugy plugy is a plugin system designed to enable the seamless integration of Rust-based plugins into your application. It provides a runtime environm

Geoffrey Mureithi 22 Aug 12, 2023