Giter VIP home page Giter VIP logo

dito's Introduction

Dito Programming Language

Dito is a work-in-progress toy interpeted language made to learn about writing parsers, interpeters etc. Things change around a bit so some docs arn't up to date. The syntax is pretty generic at the moment but probally will try out some more idiosyncratic concepts in the future.

This is the most up to date repo but its not that stable.

Examples

For full list of examples see examples directory or the stdlib. Heres example of dynamic programming used to find the total number of ways a target number can be made given a set of coins. This can be found in full in the exampls dir described.

def main() {
    let coins  = [1, 2, 5, 10, 20, 50, 100, 200]
    let target = 200
    print(coinSums(coins, target))
}

def coinSums(coins, target) {
    let sack = array(target+1)
    sack[0] = 1
    for coin in coins {
        for i in range(coin, target+1) {
            sack[i] += sack[i-coin]
        }
    }
    return sack[target]
}

Having a go...

The most simple way to build with go build then use the executable or just go run main.go. You can try out the language either in a interactive shell with:

./dito

or to run a file:

./dito funcs.dito

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.