Code Monkey home page Code Monkey logo

zac's Introduction

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.

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

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.

zac's People

Contributors

sumeet avatar

Stargazers

James Magahern avatar  avatar  avatar LukasDoesDev avatar Kofi Gumbs avatar Ryan Mast avatar Bill Piel avatar Reilly Wood avatar Dario Vladović avatar Maddison Hellstrom avatar  avatar Omar Rizwan avatar Arthur Amos avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.