Skip to content

kykyrudza-coding/integrity-rust-lang

Integrity

A small, readable programming language with clear semantics. Built in Rust.

Quick example

let name = 'World';
println("Hello, {name}!");

function factorial(n) {
    if n <= 1 { return 1; }
    return n * factorial(n - 1);
}

println("10! = " + to_string(factorial(10)));

Features

  • let for immutable bindings, var for mutable bindings
  • Numbers, strings, booleans, null, lists, maps
  • String interpolation in double-quoted strings: "Hello, {name}!"
  • Functions with closures
  • if / elseif / else, while, for..in
  • Built-in standard library for strings, lists, maps, I/O
  • Clear error messages with source locations

Getting started

# Build
cargo build --release

# Run a program
cargo run -- run examples/hello.ing

# Check syntax without running
cargo run -- check examples/hello.ing

# Start the REPL
cargo run -- repl

Examples

See the examples/ directory:

  • hello.ing - Hello World
  • variables.ing - Variables and immutability
  • branching.ing - If/elseif/else
  • loops.ing - While and for..in loops
  • functions.ing - Functions and closures
  • collections.ing - Lists and maps
  • strings.ing - String operations
  • fizzbuzz.ing - FizzBuzz

Documentation

Workspace architecture

Integrity keeps the frontend split into explicit layers:

  • integrity-syntax owns source spans and token definitions
  • integrity-ast owns the parsed tree (Program, Block, statements, expressions, bindings)
  • integrity-parser is the only stage that converts syntax tokens into AST nodes
  • integrity-driver owns CLI-facing orchestration for check, run, and REPL evaluation
  • integrity (CLI) is a thin shell for args, file I/O, terminal output, and process exit codes

That keeps lexer independent from AST internals and lets diagnostics depend only on source-level spans.

Testing

cargo test --workspace

License

MIT

About

Integrity Programing Lang

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages