Lotus

Lotus

A statically-typed procedural programming language with an interpreter built in C++.

Lotus is a programming language I developed to explore the principles of statically-typed procedural languages, test-driven development, and software testing. With Lotus, you can write programs using familiar constructs like collections, dictionaries, and control structures, all parsed and interpreted through an interpreter written in C++.

Built With

Prerequisites

Ensure you have the following installed:

Installation

  1. Clone the repository:
    git clone https://github.com/Multipixels/lotus-lang.git
    
  2. Navigate to the project’s src directory:
    cd lotus-lang/src
    
  3. Open the lotus-lang.sln file in Visual Studio.
  4. Build and run the lotus-interpreter-tests tests.
  5. Build the lotus-interpreter project.

Usage

Write Lotus programs in .lotus files and run them through the interpreter. Here’s an example program:

-- Find the sum of the values in a collection
integer sum = 0;
collection<integer> myCollection = [2, 4, 6];

iterate(value : myCollection) {
  sum = sum + myCollection;
}

log(sum);

Run the program:

./lotus-interpreter example.lotus

Features

GitHub Page