newenclave / pico

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Very simple and small interpreted language implemented with python

Supports

numbers, strings, arrays, tables, functions as first class citizens

    let a = [1, 2, 3, "end"]
    let b = 200
    let sum = fn(x, y) { x + y }
    let c = sum(1000, b)
    let s = "This is a string"
    let t = {true: "True", false: "False"}

Also it supports built-in functions

    let s = "Hello, world!"
    print("String length is", len(s))

Here len and print are built-in functions

Fibonacci (of course)

    let fib = fn( n ) {
        let impl = fn( a, b, n ) {
            if(n > 0) {
                impl( b, a + b, n -1 )
            } else {
                a
            }
        }
        impl(0, 1, n)
    }
    print(fib(100))

About

License:MIT License


Languages

Language:Python 100.0%