Pure(1) Pure Manual Pure(1)NAMEpure - the Pure interpreter
SYNOPSISpure [options ...] [-x] script [args ...]
pure [options ...] [-b|-c|-i] [script ...] [-- args ...]
OPTIONS-b Batch mode (execute the given scripts and exit).
-c Batch compilation (compile the scripts to a native binary).
--ctags, --etags
Create a tags file in ctags (vi) or etags (emacs) format.
--disable=optname
Disable source option (conditional compilation).
--eager-jit
Enable eager JIT compilation. This requires LLVM 2.7 or later,
otherwise this flag will be ignored.
--enable=optname
Enable source option (conditional compilation).
--escape=char
Interactive commands are prefixed with the specified character.
Permitted prefixes are: !$%&*,:<>@\|.
-fPIC, -fpic
Create position-independent code (batch compilation).
-g Enable symbolic debugging.
--help, -h
Print help message and exit.
-i Interactive mode (read commands from stdin after sourcing the
given scripts, if any).
-Idirectory
Add a directory to be searched for included source scripts.
-Ldirectory
Add a directory to be searched for dynamic libraries.
-llibname
Library to be linked in batch compilation.
-mopt=val
Add llc machine options in batch compilation.
--main=name
Name of main entry point in batch compilation.
--noediting
Disable command-line editing.
--noprelude, -n
Do not load the prelude.
--norc Do not run the interactive startup files.
-ofilename
Output filename for batch compilation.
-q Quiet startup (suppresses sign-on message in interactive mode).
-Tfilename
Tags file to be written by --ctags or --etags.
--texmacs
Run Pure inside TeXmacs.
-u Do not strip unused functions in batch compilation.
-v[level]
Set verbosity level.
--version
Print version information and exit.
-w Enable compiler warnings about various dubious constructs and
backward compatibility issues.
-x Execute a script with the given command line arguments.
-- Stop option processing and pass the remaining command line argu‐
ments in the argv variable.
DESCRIPTION
Pure is a modern-style functional programming language based on term
rewriting. Pure programs are basically collections of equational rules
used to evaluate expressions in a symbolic fashion by reducing them to
normal form.
pure is the Pure interpreter. The interpreter has an LLVM backend which
JIT-compiles Pure programs to machine code, hence programs run blaz‐
ingly fast and interfacing to C modules is easy, while the interpreter
still provides a convenient, fully interactive environment for running
Pure scripts and evaluating expressions.
Basically, to run a Pure script with the interpreter, just specifiy the
filename of the script on the command line (optionally followed by
additional arguments to be passed to the script). You can also invoke
the interpreter without arguments, in which case it starts up in inter‐
active mode. Or you can compile one or more scripts to a native exe‐
cutable (as well as a number of other recognized LLVM and native code
formats) with the -c option (use -o to specify the output filename);
this requires that you have some parts of the LLVM toolchain (llc, opt)
as well as gcc installed. Last but not least, you can create a tags
file for use with emacs(1) or vi(1) with the --etags and --ctags
options.
The full Pure manual can be read inside the interpreter, by typing help
on the interpreter's command line. This requires w3m(1) to work. (You
can also set the name of another html browser to use with the PURE_HELP
or the BROWSER environment variable, or read the manual online at the
Pure website.)
FILES
a.out Default output filename for batch compilation (-c).
~/.pure_history
Interactive command history.
~/.purerc, .purerc, .pure
Interactive startup files. The latter is usually a dump from a
previous interactive session.
prelude.pure
Standard prelude. If available, this script is loaded before any
other definitions, unless -n was specified.
ENVIRONMENT
CC, CXX
C and C++ compiler used by the Pure batch compiler (pure -c) to
compile and link native executables. Defaults to gcc and g++,
respectively.
BROWSER
If the PURE_HELP variable is not set (see below), this specifies
a colon-separated list of browsers to try for reading the online
documentation. More information about the BROWSER variable can
be found at http://www.catb.org/~esr/BROWSER/.
PURELIB
Directory to search for library scripts, including the prelude.
If PURELIB is not set, it defaults to some location specified at
installation time.
PURE_EAGER_JIT
Enable eager JIT compilation (same as --eager-jit).
PURE_ESCAPE
If set, interactive commands are prefixed with the first charac‐
ter in the value of this variable (same as --escape). If the
variable is empty, or its first character is not a permitted
prefix, Pure reverts to the default of no prefix.
PURE_HELP
Browser to use to read online documentation in the interpreter.
By default, w3m(1) is used.
PURE_INCLUDE
Additional directories (in colon-separated format) to be
searched for included scripts.
PURE_LIBRARY
Additional directories (in colon-separated format) to be
searched for dynamic libraries.
PURE_MORE
Shell command to be used for paging through output of the show
command, when the interpreter runs in interactive mode.
PURE_LESS does the same for evaluation results printed by the
interpreter.
PURE_PS
Command prompt used in the interactive command loop ("> " by
default).
PURE_STACK
Maximum stack size in kilobytes (0 = unlimited). A reasonable
default is provided (currently this is always 8192K - 128K for
interpreter and runtime, which should work on most modern PCs).
If you're still getting segfaults due to stack overflow then
you'll either have to reduce this value or increase the actual
stack space available to programs.
LICENSE
LGPL V3 or later. See the accompanying COPYING file for details.
AUTHOR
Albert Graef <aggraef@gmail.com>, Dept. of Computer Music, Johannes
Gutenberg University of Mainz, Germany.
SEE ALSO
You can find the latest releases, as well as the complete manual and
the mailing list at the Pure website, http://purelang.bitbucket.org.
Pure September 2014 Pure(1)