Git Product home page Git Product logo

dictu's Introduction

Dictu

What is Dictu?

Dictu is a high-level dynamically typed, multi-paradigm, interpreted programming language. Dictu has a very familiar C-style syntax along with taking inspiration from the family of languages surrounding it, such as Python and JavaScript.

What does Dictu mean?

Dictu means simplistic in Latin.

Dictu documentation

Documentation for Dictu can be found here

Codacy Badge CI

Example programs

import System;

const guess = 10;

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

    System.sleep(1);
}
def fibonacci(num) {
    if (num < 2) {
        return num;
    }

    return fibonacci(num - 2) + fibonacci(num - 1);
}

print(fibonacci(10));

More here.

Running Dictu

Dictu requires that you have CMake installed and it is at least version 3.16.3.

Using CMake (at least version 3.16.3 or greater)

$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -B ./build
$ cmake --build ./build # on Windows add "--config Release" here to get a Release build
$ ./dictu # on Windows the executable is ".\Release\dictu.exe"

Using CMake presets (version 3.21.0 or greater)

$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake --preset release
$ cmake --build --preset release
$ ./dictu # on Windows the executable is ".\Release\dictu.exe"

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.

Without CMake presets (at least version 3.16.3 or greater)
$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -DDISABLE_HTTP=1 -B ./build 
$ cmake --build ./build # on Windows add "--config Release" here to get a Release build
$ ./dictu # on Windows the executable is ".\Release\dictu.exe"
CMake presets (version 3.21.0 or greater)
$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake --preset release-nohttp
$ cmake --build --preset release
$ ./dictu # on Windows add "--config Release" here to get a Release build

Compiling with VCPKG

This project includes support for the VCPKG C/C++ package manager in manifest mode. To enable VCPKG support, the VCPKG_ROOT environmental variable must be set to the path of a check-out and bootstrapped vcpkg repository on the compiling machine, and the ENABLE_VCPKG cmake flag must be set.

Compiling with VCPKG will enable certain features of Dictu that requires external library features to be automatically pulled and compiled.

Without CMake presets (at least version 3.16.3 or greater)
$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_VCPKG=1 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake -B ./build
$ cmake --build ./build # on Windows add "--config Release" here to get a Release build
$ ./dictu # on Windows the executable is ".\Release\dictu.exe"
CMake presets (version 3.21.0 or greater)
$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake --preset release-vcpkg
$ cmake --build --preset release-vcpkg
$ ./dictu # on Windows add "--config Release" here to get a Release build

Docker Installation

Refer to Dictu Docker

FreeBSD Installation

For a full installation, make sure curl is installed. It can be installed from the commands below:

$ pkg install -y curl linenoise-ng

The following variables need to be set/available to run cmake successfully.

For Bourne compatible shells...

export CPATH=/usr/local/include
export LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH=/usr/local/lib
$ git clone -b master https://github.com/dictu-lang/Dictu.git
$ cd Dictu
$ cmake -DCMAKE_BUILD_TYPE=Release -B ./build 
$ cmake --build ./build
$ ./dictu

Extensions

Dictu has a Visual Studio Code extension here with the implementation located in the DictuVSC repo.

Credits

This language was initially based on the very good craftinginterpreters book, along with inspiration from Wren.

This project is supported by:

dictu's People

Contributors

jason2605 avatar briandowns avatar agathoklisx avatar willdasilva avatar manoharkakumani avatar jxxe avatar mannaramuthan avatar amuthan-tw avatar ziord avatar seanmcloughlin avatar thegreatcookiemachine avatar nightshade256 avatar midouwebdev avatar jamsilva avatar avinashupadhya99 avatar gvwilson avatar ezbob avatar vnksnkr avatar ajoe-t avatar abeaumont avatar teahsea avatar revengerwizard avatar artorias111 avatar lambocreeper avatar magnificentpako avatar tashima42 avatar shaochenheng avatar siddharths2710 avatar codacy-badger avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.