Skip to content

janqx/quark-lang

Repository files navigation

The Narbe Script Language

Narbe is a small, dynamic, fast script language written in Go.

Features

  • REPL
  • Modules
  • Easy to embed into Go
  • Easy to read code

Usage

go get github.com/janqx/narbe/v1

Basic Example

// go run narbe/cli/main.go ./basic.nb

fmt := import("fmt")

fn each(seq, fn) {
    for i := 0; i < len(seq); i = i + 1 {
        fn(seq[i])
    }
}

fn sum(init, seq) {
    each(seq, fn(x) {
        init += x
    })
    return init
}

fmt.println(sum(0, [1, 2, 3]))   // output: 6
fmt.println(sum("", [1, 2, 3]))  // output: "123"

Benchmark

References

About

a simple script language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published