Goal is an embeddable
array programming language
with a bytecode interpreter, written in Go. The command line
interpreter can execute scripts or run in interactive mode.
For installation, see the
README.md
file in the
project’s repository.
You can also
try Goal on the browser.
You might be interested in the
EPUB version
of the present documentation.
Moreover, you can follow these
README instructions
to build the documentation from sources and deploy it
locally to avoid depending on a network connection.
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 and mutable variables (but no mutable values).
You can read about Goal’s origins and influences in the Origins section of the FAQ. If you already know about the K language, you might want to read the Differences from K chapter.
Goal’s main distinctive features among array languages can be summarized as follows:
Dictionaries and table functionality (similar to most K dialects)
Atomic strings:
"ab" "bc"="bc" → 0 1
Unicode-aware string primitives:
_"AB" "Π" → "ab" "π"
Perl-like quoting constructs and string interpolation:
qq/$var\n or ${var}/
and
rq#raw strings#
Format strings:
"%.2g"$1 4%3 → "0.33" "1.3"
Dedicated regular expression syntax:
rx/\s+/
Embeddable and extensible in Go
Goal also has support for standard features like I/O, CSV, JSON, and time handling.
Goal shines the most in common scripting tasks, like handling columnar data or text processing. Goal is also suitable for exploratory programming.
The next chapter gives a tour of Goal’s features and showcases the language in a couple of practical examples.