slope/slope.1

67 lines
4.0 KiB
Groff
Raw Permalink Normal View History

.TH "slope" 1 "20 AUG 2021" "" "General Operation Manual"
2021-08-11 22:45:31 +00:00
.SH NAME
\fBslope\fP - SLOum's Program Evaluator
.SH SYNOPSIS
.nf
.fam C
\fBslope\fP [\fIoptions\fP] [\fIscript\fP [\fIargs\fP]]
2021-08-11 22:45:31 +00:00
.fam T
.fi
.SH DESCRIPTION
\fBslope\fP is a small, but useful, s-expression based programming language interpreter for the Slope language. It is in the general language family of scheme/lisp, with api and implementation differences. It loads and executes Slope programs in the form of textual source code and can also be used interactively as a REPL.
2021-08-11 22:45:31 +00:00
.TP
The options, see below, passed to the interpreter are executed followed by the Slope program in the given script file. The args passed to the script are available as a list of strings held in the variable \fIsys-args\fP, available both within a script and via the REPL.
.TP
Interactive mode is accessed when no file is passed to the interpreter. In this mode \fBslope\fP prompts the user, reads lines from stdin, and executes them as they are read. If a line does not contain a complete statement a secondary prompt is displayed and lines are read until a complete statement is formed or a syntax error is found.
2021-08-11 22:45:31 +00:00
.SH OPTIONS
.TP
.B
\fB-h\fP
Display usage help and exit. Provides a list of all command line options with a short description and exits.
.TP
.B
\fB-v\fP
Prints the version information and exits.
.TP
.B
2021-08-25 22:02:54 +00:00
\fB-run [program]\fP
Runs the given program, passed in as a quoted string, and exits, printing any output as directed by the given program. If \fI--\fP is given as an argument to \fB-run\fP slope will read from stdin until EOF.
.TP
.B
\fB-L\fP
Preload the environment with the evaluated result of loading all Slope files in the slope-preload-directory, see \fIFILES\fP below, and then load the given script file or REPL session.
2021-08-25 22:02:54 +00:00
.TP
.B
2022-05-14 21:13:03 +00:00
\fB-debug\fP
Turns on debug mode, which will print a stack trace from the underlying runtime (golang) on panic. This is mostly useful for debugging the slope interpreter itself, and not so much for debugging slope code.
.TP
.B
\fB-install [filepath]\fP
Install the module pointed to by \fIfilepath\fP to the slope module path. \fB-install\fP will query if you want to proceed if the install would overwrite an existing module and will verify that the required module files are present. At the current release \fB-install\fP does \fInot\fP install further dependencies of modules or deal with submodules. For full module handling please see the separate application \fBslp\fP.
.SH FILES & SYSTEM VARS
2021-08-11 22:45:31 +00:00
\fBslope\fP source code files, by convention, have the file extension \fI.slo\fP.
.TP
\fBslope\fP recognizes two paths as meaningful when executing scripts:
.TP
The \fBslope\fP module path can be defined by setting the variable \fI$SLOPE_MOD_PATH\fP. If that variable is not defined \fBslope\fP will fall back to \fI$XDG_DATA_HOME/slope/modules\fP or \fI~/.local/share/slope/modules\fP. This is where \fBslope\fP will look for modules when the procedure \fIload-mod\fP is called.
.TP
Global/system-wide modules should be installed to \fI/usr/local/lib/slope/modules\fP. slope will always use a user-local module if one exists; if not then slope will search the global modules heirarchy.
.TP
The \fBslope\fP preload directory can be defined by setting the variable \fI$SLOPE_PRELOAD_DIR\fP. If that variable is not defined \fBslope\fP will fall back to \fI$XDG_DATA_HOME/slope/preload\fP or \fI~/.local/share/slope/preload\fP. This is where \fBslope\fP will look for files to evaluate when the \fI-L\fP flag is passed at runtime.
.TP
REPL session history is persistent in \fBslope\fP. The history file is located one directory up from the \fBslope\fP module directory (whatever that is set to) and named \fIslope-repl.history\fP, for example: \fI$SLOPE_MOD_PATH/../slope-repl.history\fP (using a fallback path for \fI$SLOPE_MOD_PATH\fP if needed.
2021-08-11 22:45:31 +00:00
.SH BUGS
There are bugs. Have fun!
.SH LINKS
\fBslope\fP maintains a presence in the following locations:
.TP
.B
Source Code Repository
2021-09-03 21:46:57 +00:00
https://git.rawtext.club/slope-lang/slope
2022-05-14 21:13:03 +00:00
.TP
.B
Homepage:
https://slope.colorfield.space
2021-08-11 22:45:31 +00:00
.SH AUTHORS
\fBslope\fP is developed by sloum