1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-28 19:19:53 +00:00
janet/janet.1

86 lines
2.7 KiB
Groff
Raw Normal View History

2018-11-18 14:35:41 +00:00
.TH JANET 1
.SH NAME
2019-01-21 21:04:47 +00:00
janet \- run the Janet language abstract machine
2018-11-18 14:35:41 +00:00
.SH SYNOPSIS
.B janet
[\fB\-hvsrp\fR]
[\fB\-e\fR \fIJANET SOURCE\fR]
[\fB\-\-\fR]
2019-01-21 21:04:47 +00:00
.IR script
.IR args ...
2018-11-18 14:35:41 +00:00
.SH DESCRIPTION
Janet is a functional and imperative programming language and bytecode interpreter.
2018-11-18 14:35:41 +00:00
It is a modern lisp, but lists are replaced by other data structures with better utility
and performance (arrays, tables, structs, tuples). The language also bridging bridging
to native code written in C, meta-programming with macros, and bytecode assembly.
There is a repl for trying out the language, as well as the ability to run script files.
2019-01-21 21:04:47 +00:00
This client program is separate from the core runtime, so Janet could be embedded
into other programs. Try Janet in your browser at https://Janet-lang.org.
2018-11-18 14:35:41 +00:00
2019-01-21 21:04:47 +00:00
Implemented in mostly standard C99, Janet runs on Windows, Linux and macOS.
2018-11-18 14:35:41 +00:00
The few features that are not standard C99 (dynamic library loading, compiler
specific optimizations), are fairly straight forward. Janet can be easily ported to
2018-11-18 14:35:41 +00:00
most new platforms.
.SH DOCUMENTATION
For more complete API documentation, run a REPL (Read Eval Print Loop), and use the doc macro to
see documentation on individual bindings.
.SH OPTIONS
.TP
.BR \-h
Shows the usage text and exits immediately.
.TP
.BR \-v
Shows the version text and exits immediately.
.TP
.BR \-s
Read raw input from stdin and forgo prompt history and other readline-like features.
.TP
.BR \-q
2019-01-16 17:34:01 +00:00
Quiet output. Don't print a repl prompt or expression results to stdout.
2018-11-18 14:35:41 +00:00
.TP
.BR \-r
2019-01-21 21:04:47 +00:00
Open a REPL (Read Eval Print Loop) after executing all sources. By default, if Janet is called with no
2018-11-18 14:35:41 +00:00
arguments, a REPL is opened.
.TP
.BR \-p
2019-01-21 21:04:47 +00:00
Turn on the persistent flag. By default, when Janet is executing commands from a file and encounters an error,
it will immediately exit after printing the error message. In persistent mode, Janet will keep executing commands
2018-11-18 14:35:41 +00:00
after an error. Persistent mode can be good for debugging and testing.
.TP
.BR \-e
2019-01-21 21:04:47 +00:00
Execute a string of Janet source. Source code is executed in the order it is encountered, so earlier
2018-11-18 14:35:41 +00:00
arguments are executed before later ones.
2019-01-21 21:04:47 +00:00
.TP
.BR \-l
Load a Janet file before running a script or repl. Multiple files can be loaded
in this manner, and exports from each file will be made available to the script
or repl.
2018-11-18 14:35:41 +00:00
.TP
.BR \-\-
Stop parsing command line arguments. All arguments after this one will be considered file names.
.SH ENVIRONMENT
.B JANET_PATH
.RS
2019-01-21 21:04:47 +00:00
The location to look for Janet libraries. This is the only environment variable Janet needs to
find native and source code modules. If no JANET_PATH is set, Janet will look in
/usr/local/lib/Janet for modules.
To make Janet search multiple locations, modify the module.paths
array in Janet.
2018-11-18 14:35:41 +00:00
.RE
.SH AUTHOR
Written by Calvin Rose <calsrose@gmail.com>