Just like C, Gamma is designed to permit functional implementations with relatively good performance. The following is presented on the specification page, but I'll summarize it here:
g2i
, which works as a function and translates a source or header unit to an intermediate format, only performing syntactic and semantic checks;lg
, which works as an archiver and edits intermediate files by adding, replacing or removing functions, and on some platforms linking those files to shared libraries; andi2m
, which works like g2i
and transforms an intermediate format file into a target machine language (LLVM IR by default for now);libg
, which implements the functions of the Gamma standard declarations; andgrt
, which implements the runtime behavior of the Gamma language;ge
, which just executes a program in a similar way to ld.so
;gp
, which profiles a program; andgt
, which traces a program.g2i
: g2i h --comments < hdr.gh > hdr.t
g2i s math/blas.t < src.gs > src.p
lg
: mylib
with a BLAS implementation:
lg l mylib.p /usr/lib/libblas.so
mylib
from a BLAS implementation:
lg u mylib.p /usr/lib/libblas.so
foo
, bar
and baz
into qux
:
lg a qux.p -f foo.p -f bar.p -f baz.p
max: nmax(a: nmax, b: nmax)
to _max: nmax(a: nmax, b: nmax)
:
lg e qux.p -s 'max: nmax(a: nmax, b: nmax)=_max: nmax(a: nmax, b: nmax)'
max: nmax(a: nmax, b: nmax)
with the definition in foo
:
lg e qux.p -d 'max: nmax(a: nmax, b: nmax)' -f foo.p
max: nmax(a: nmax, b: nmax)
:
lg d qux.p 'max: nmax(a: nmax, b: nmax)'
i2m
: _start: n4()
):
i2m ELF:x < prog.p > prog
i2m ELF:s < foo.p > libfoo.so
max: nmax(a: nmax, b: nmax)
:
i2m ELF:s --inline='max: nmax(a: nmax, b: nmax)' < foo.p > libfoo.so
qux: n4()
:
i2m PE:exe -e 'qux: n4()' < foo.p > foo.dll
i2m PE:dll < foo.p > foo.dll