Home

Awesome

Mirror closed because of 2FA, now only at https://codeberg.org/anaseto/goal

Goal

pkg.go.dev godocs.io

Goal is an embeddable array programming language with a bytecode interpreter, written in Go. It provides both a command line intepreter (that can be used in the REPL), and a library interface. The core features are mostly there and tested, so Goal is usable both for writing useful short scripts and playing with the REPL. User testing and bug reports are welcome!

Like in most array programming languages, Goal's builtins vectorize operations on immutable arrays, and encourage a functional style for control and data transformations, supported by a simple dynamic type system with little abstraction, and mutable variables (but no mutable values).

It's main distinctive features are as follows:

If this list is not enough to satisfy your curiosity, have a look at the why section of the FAQ. You can also read the Credits.md to know about main inspiration sources for the language. Last, but not least, there are some implementation notes too.

Install

To install the command line interpreter, first do the following:

Then you can build the intepreter with:

go install ./cmd/goal

Alternatively, you may type go build -o /path/to/bin/goal ./cmd/goal to put the resulting binary in a custom location in your $PATH.

The goal command should now be available. Type goal --help for command-line usage.

Typing just goal opens the REPL. For a better experience using the REPL (to get typical keyboard shortcuts), you can install the readline wrapper rlwrap program (available as a package in most systems), and then use instead rlwrap goal.

Links

Documentation

In addition to the work-in-progress documentation website, you might be interested in the Changelog changes between releases. The REPL help is also available in text form here at docs/help.txt.

Examples

A few short examples can be found in the examples and testdata/scripts directory. Because the latter are used for testing, they come along an expected result after a /RESULT: comment.

Also, various code generation scripts in the toplevel scripts directory are written in Goal.