Table of Contents
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++.
Follow these steps to set up and run the Lotus interpreter on your local machine.
Ensure you have the following installed:
- A C++ compiler
- Visual Studio
- Clone the repository:
git clone https://github.com/Multipixels/lotus-lang.git
- Navigate to the project's src directory:
cd lotus-lang/src
- Open the
lotus-lang.sln
file in Visual Studio. - Build and run the
lotus-interpreter-tests
tests. - Build the
lotus-interpreter
project.
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
- Statically-Typed Variables: Includes primitive types like
boolean
,integer
,float
,character
, andstring
. - Collections and Dictionaries: Flexible and easy-to-use data structures.
- Functions: Define reusable blocks of code with return types and parameters.
- Control Structures: Use
if-else
,while
,for
, and more. - Built-in Functions: Log messages, calculate lengths, and more.
- Basic Syntax and Grammar
- Functions
- Control Structures
- Collections
- Dictionaries
- Strings
- Error Reporting Improvements
- Garbage Collection
- Standard Library Functions
Richard Motorgeanu - [email protected]
Project Link: https://github.com/Multipixels/lotus-lang