zexlang

command module
v0.0.0-...-d92998c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2025 License: MIT Imports: 4 Imported by: 0

README

Zex (/ziː.ɛks/) Language

Zex is a simple programming language that is designed to be easy to use and understand.

About

Zex is a weakly-typed, interpreted language that is designed to be easy to use and understand. Zex is built in Go as a learning project and is not intended to be used in production.

Features

  • Weakly-typed
  • Interpreted
  • Zex Blocks

Installation

To install Zex, you need to have Go installed on your system.

go install github.com/bndrmrtn/zexlang@latest

Usage

To run a Zex program, you can use the zexlang command.

zexlang run <file>

Flags can be used to cache or debug the program.

zexlang run <file> --cache --debug

Examples

Basic Hello World program:
println("Hello, World!")
Define a variable and print it:
let x = 10;
println(x);
Define a function and call it:
fn add(a, b) {
  return a + b;
}

let result = add(10, 20);
println(result);
Define a block and use it:

(this is currently not working as intended, but it is the intended syntax)

define MyBlock {
  let x = 10;

  fn construct(value) {
    this.x = value;
  }
}

let block = MyBlock(20);
println(block.x);
Using namespaces:

File main.zx:

namespace main;

import("other.zx");
other.printHello();

File other.zx:

namespace other;

fn printHello() {
  println("Hello from other.zx!");
}

Support

Support my work by giving this project a star.

Documentation

Overview

ZexLang is a simple templating programming language that is designed to be easy to use and understand.

Zex is built in Go and is designed to be a simple. Created by Martin Binder Website: https://mrtn.vip

Directories

Path Synopsis
internal
ast
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL