Interpreted, strong-typed, functional programming language with a unique syntax
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-04 14:31:37 -04:00
src feat(lang): Implement typed lists and improve display 2025-11-17 09:55:13 -08:00
.gitignore feat(lang): Implement typed lists and improve display 2025-11-17 09:55:13 -08:00
Cargo.lock if statements, equality operators and fixing a bug with strings 2025-08-18 16:44:14 -04:00
Cargo.toml if statements, equality operators and fixing a bug with strings 2025-08-18 16:44:14 -04:00
README.md Improved README formatting 2025-11-12 09:44:39 -05:00

rshell

An interpreted programming language featuring static types and a unique functional syntax.

Building

To build the project, navigate to the root directory of the project and run:

cargo build

Running

To run the project, use the following command:

cargo run

That will bring you into a REPL. Everything in rshell functions as a function and there is no syntax other than functions and data (no keywords) and that is done by design to make it simple.

Commands

Built-in functions and keywords

  • let(name, type(value)) - Variable and function declaration
  • func(param1, param2, ..., return_type, body) - Defines a new function (technically an anonymous function)
  • if(condition), then_expr, else_expr) - Conditional expression
  • pass() - A no-op that does nothing

Arithmetic

  • Note that the order of operations is most nested to least nested
  • +(a, b, ...) - Add two or more numbers
  • -(a, b, ...) - Subtract two or more numbers
  • *(a, b, ...) - Multiply two or more numbers
  • /(a, b, ...) - Divide two or more numbers
  • %(a, b, ...) - Add two or more numbers

Comparison

  • <(a, b) - Less than
  • <=(a, b) - Less than or equal to
  • >(a, b) - More than
  • >=(a, b) - More than or equal to
  • ==(a, b) - Equal to
  • !=(a, b) - Not equal to

Logical

  • and(a, b) - Logical AND
  • or(a, b) - Logical OR
  • not(a) - Logical NOT
  • xor(a, b) - Logical XOR

Utility functions

  • echo(...) - prints the argument to the console
  • float(x) - casts an integer to a float
  • len(string) - Returns the length of a string
  • reverse(string) - Reverses a string

Examples

let(square, func(int(x), int, *(x, x)))
let(cube, func(int(x), int, *(x, x, x)))

You can type exit to leave the REPL.