Docs

0%

Loading...

Static preview:

Goal

Goal is the Go augmented language with support for two additional modes, in addition to standard Go:

    $ shell mode $ that operates like a standard command-line shell (e.g., bash), with space-separated elements and standard shell functionality including input / output redirection. Goal automatically detects most instances of shell mode based on the syntax of the line, but it can always be explicitly indicated with surrounding $s.

    # math mode # that supports Python-like concise mathematical expressions operating on tensor elements.

Here is an example of shell-mode mixing Go and shell code:

where Go-code is explicitly indicated by the {} braces.

Here is an example of math-mode:

You can also intermix math within Go code:

Goal can be used in an interpreted mode by using the yaegi Go interpreter (and can be used as your shell executable in a terminal), and it can also replace the standard go compiler in command-line mode, to build compiled executables using the extended Goal syntax.

A key design feature of Goal is that it always transpiles directly to Go in a purely syntactically driven way, so the output of Goal is pure Go code.

Goal can also be used in conjunction with gosl to build programs that transparently run on GPU hardware in addition to standard CPUs (as standard Go programs).

Goal pages