/Dictu

Dictu is a simple dynamically typed programming language built upon the craftinginterpreters tutorial.

Primary LanguageCMIT LicenseMIT

Dictu logo


Codacy Badge CI

What is Dictu?
Dictu is a very simple dynamically typed programming language built upon the craftinginterpreters tutorial.

What does Dictu mean?
Dictu means simplistic in Latin.

Dictu documentation

Documentation for Dictu can be found here

Running Dictu

Dictu currently has two options when building, there is a CMakeLists file included so the build files can be generated with CMake or there is an included makefile for users that are more familiar with that.

CMake

$ git clone https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -B ./build 
$ cmake --build ./build
$ ./build/Dictu

Compiling without HTTP

The HTTP class within Dictu requires cURL to be installed when building the interpreter. If you wish to build Dictu without cURL, and in turn the HTTP class, build with the DISABLE_HTTP flag.

$ git clone https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -DDISABLE_HTTP=1 -B ./build 
$ cmake --build ./build
$ ./build/Dictu

Compiling without linenoise

Linenoise is used within Dictu to enhance the REPL, however it does not build on windows systems so a simpler REPL solution is used.

$ git clone https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -DDISABLE_LINENOISE=1 -B ./build 
$ cmake --build ./build
$ ./build/Dictu

Makefile

$ git clone https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ make dictu
$ ./dictu examples/guessingGame.du

Compiling without HTTP

The HTTP class within Dictu requires cURL to be installed when building the interpreter. If you wish to build Dictu without cURL, and in turn the HTTP class, build with the DISABLE_HTTP flag.

$ git clone https://github.com/Jason2605/Dictu.git
$ cd Dictu
$ make dictu DISABLE_HTTP=1
$ ./dictu examples/guessingGame.du

Docker Installation

Refer to Dictu Docker

Example program

var userInput;
var guess = 10;

while {
    userInput = input("Input your guess: ").toNumber();
    print(userInput);
    if (userInput == guess) {
        print("Well done!");
        break;
    } else if (userInput < guess) {
        print("Too low!");
    } else {
        print("Too high!");
    }

    System.sleep(1);
}

More here.