Skip to content
🚚 A dynamic programming language with a focus on simplicity
Branch: master
Clone or download
Latest commit 5dbc9bb Jul 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Create FUNDING.yml Jul 9, 2019
docs Update LEARN.md Jul 11, 2019
examples added comments Jul 11, 2019
truck added comments Jul 11, 2019
vim added comments Jul 11, 2019
.gitignore
LICENSE Create LICENSE Jul 12, 2019
README.md Update README.md Jul 11, 2019
banner.png add banner and logo Jul 10, 2019
logo.png add banner and logo Jul 10, 2019

README.md

Truck is a dynamic programming language with a focus on simplicity

Truck interpreter is implemented as a tree walking interpreter with hand written recursive descent parser in Python without any external dependency.

Example

Program to print nth fibonacci number

/* function to calculate fibonacci number */
var fibonacci = fn(x) {
    if x <= 1 {
        return 1
    }

    return fibonacci(x - 1) + fibonacci(x - 2)
}

var n = num(input())
println(fibonacci(n))

More examples can be found at /examples.

Getting started

git clone http://github.com/tarptaeya/truck
cd truck
python3 truck/truck.py #[filename] or leave empty to run repl

Learn

Checkout LEARN.md to learn programming in truck.

Syntax highlighting

Syntax highlighting for vim is supported and associated files can be found in the vim directory of the project. Either copy the files yourself or execute install_vim.sh to automatically copy the vim files for you.

You can’t perform that action at this time.