Skip to content

AlgoLang-Programming-Language/AlgoLangSource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algolang

A math-first, algorithm-focused programming language for clarity and deterministic execution



✦ Overview

Algolang is a statically scoped, bytecode-compiled programming language designed for learning algorithms, computer science fundamentals, and mathematical reasoning.

It emphasizes:

  • Clarity – Code reads like the algorithm itself
  • Determinism – Predictable, reproducible execution
  • Education – Ideal for learning language design, algorithms, and computation

✦ Features

  • Clean Syntax – Minimal, intuitive, focused on algorithms
  • Bytecode Compilation – Efficient and predictable execution
  • Stack-Based VM – Lightweight and inspectable
  • First-Class Functions – Pass and return functions like values
  • Lexical Scoping – Strict block-level variable rules
  • Standard Library – Core mathematical functions (abs, min, max, sqrt, pow, floor, ceil)

✦ Quick Start

Clone & Build

git clone https://github.com/AlgoLang-Programming-Language/AlgoLangSource.git
cd AlgoLangSource

# Build the compiler
make

Produces the algolang executable.

Run a Program

./algolang examples/fib.algo

Start the REPL

./algolang

✦ Example Program

fn fib(n) {
  if n <= 1 {
    return n
  }
  return fib(n - 1) + fib(n - 2)
}

print fib(10)

✦ Language Overview

Variables

let x = 10
let y = 20
let sum = x + y

Functions

fn add(a, b) {
  return a + b
}

print add(5, 3)

Control Flow

if x > 10 {
  print true
} else {
  print false
}

while x < 100 {
  x = x * 2
}

Data Types

  • Number – 64-bit float (42, 3.14)
  • Booleantrue, false
  • Nilnil (no value)

Operators

  • Arithmetic: + - * / %
  • Comparison: == != < <= > >=
  • Logical: and or !
  • Assignment: =

✦ Standard Library

abs(x)   # Absolute value
min(a,b) # Minimum
max(a,b) # Maximum
sqrt(x)  # Square root
pow(x,y) # x^y
floor(x) # Round down
ceil(x)  # Round up

✦ Architecture

Source → Lexer → Parser → AST → Compiler → Bytecode → VM
Component Description
Lexer Tokenizes source code
Parser Builds AST
Compiler Converts AST → Bytecode
VM Stack-based execution
Runtime Values & memory
Stdlib Built-in functions

✦ Project Structure

algolang/
├── include/
├── src/
│   ├── lexer/
│   ├── parser/
│   ├── bytecode/
│   ├── vm/
│   ├── runtime/
│   └── stdlib/
├── examples/
├── docs/
├── Makefile
└── README.md

✦ Philosophy

  • Clarity over Cleverness
  • Correctness over Performance
  • Simplicity over Features
  • Education First

✦ Contributing

  • Readable code & clear commits
  • Educational clarity is priority
  • All contributions welcome

Repository: GitHub


✦ License

MIT License – See LICENSE


✦ Version

0.1.0

About

Algolang, the source code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published