Skip to content

Latest commit

 

History

History
112 lines (81 loc) · 1.82 KB

README.md

File metadata and controls

112 lines (81 loc) · 1.82 KB

Quasi 🔮

Quasi (/ˈkwāˌzī/) is an interpreted programming language that's designed to be largely similar to most languages, but with slightly off-putting syntactical differences.

Lint status Test status

Quick links

Installation

The binary name for Quasi is quasi.

Currently, building from source is the only way to install Quasi:

$ git clone https://github.com/matteopolak/quasi
$ cd quasi
$ cargo build --release
$ ./target/release/quasi --version
quasi 0.1.0

Usage

A slightly off-putting interpreted programming language.

Usage: quasi <PATH>

Arguments:
  <PATH>  Path to the script to execute

Options:
  -h, --help     Print help
  -V, --version  Print version

Examples

Examples can be found in the examples directory.

Syntax

Quasi is a dynamically typed language and not whitespace sensitive.

Comments

# This is a comment

Variables

let x = 1;
let y = 2;
let z = x + y;

Control flow

if x == 1 [
  print "x is 1";
] else if x == 2 [
  print "x is 2";
] else
  print "x is neither 1 nor 2";
while x < 10 [
  print x;
  x = x + 1;
]
for let i = 0; i < 10; i = i + 1 [
  print i;
]

Functions

fn is_even(a) [
  return a % 2 == 0;
]

print is_even(10); # true
print is_even(15); # false

Shadowing

let x = 1;
let x = 2;

print x; # 2