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++.
Ensure you have the following installed:
git clone https://github.com/Multipixels/lotus-lang.git
cd lotus-lang
out
and navigate to it:mkdir out
cd out
cmake ..
For the Lotus interpreter and test suites, run
cmake .. CMAKE_BUILD_TYPE=Debug
Compile the project.
i. (Windows) Open solution out\LotusLang.sln
in Visual Studio and build.
ii. (Mac/Linux) Run make
mkdir out
cd out
mkdir build-wasm
cd build-wasm
call emcmake cmake ../.. -D DCMAKE_SYSTEM_NAME=Emscripten
cmake --build . --target LotusLangWeb
To open up the interpreter in your CLI, simply run the binary.
.\LotusLang.exe
./LotusLang
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 += value;
}
log(sum);
Run the program
.\LotusLang.exe example.lotus
./LotusLang example.lotus
boolean
, integer
, float
, character
, and string
.if-else
, while
, for
, and more.