u6a/man/u6ac.1

105 lines
2.4 KiB
Groff

.TH "U6A" "1" "Jan 30, 2020" "0.1.1" "U6a User Manual"
.
.SH NAME
u6ac - Bytecode compiler for the Unlambda programming language
.
.SH SYNOPSIS
.B u6ac
.RI [ options ]
.I source-file
.
.SH DESCRIPTION
Read and compile Unlambda code from the given
.IR source-file ,
or
.B STDIN
if "-" is given.
Compilation result is saved in a special bytecode format, which can be executed
with
.BR u6a (1).
.
.SH OPTIONS
.TP
\fB\-o\fR, \fB\-\-output\fR=\fIout-file\fR
Save compiled bytecode to
.IR out-file ,
defaults to
.I source-file
name with ".bc" (".bc.dump" if
.B \-S
option is enabled) suffix, or
.B STDOUT
if the source file is read from
.BR STDIN .
.TP
\fB\-\-add\-prefix\fR[=\fIprefix-string\fR]
Add
.I prefix-string
to the beginning of
.IR out-file .
Defaults to "#!/usr/bin/env u6a\\n".
.TP
\fB\-O\fR[\fIoptimization-level\fR]
Compile-time optimization level.
.BR \-O0 :
Turn off optimization.
.BR \-O1 (default):
Turn on basic optimizations, including constant folding & propagation,
dead code elimination, etc.
.TP
\fB\-\-syntax\-only\fR
Only check for lexical and syntactic correctness of the source file, and skips
bytecode generation.
.TP
\fB\-S\fR
Produce mnemonic pseudo-instructions instead of bytecode.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print extra debug messages to
.BR STDOUT .
When this option is enabled,
.I out-file
should not be
.BR STDOUT .
.TP
\fB\-H\fR, \fB\-\-help\fR
Prints help message, then exit.
.TP
\fB\-V\fR, \fB\-\-version\fR
Prints version number, then exit.
.
.SH NOTES
.SS Unlambda
.TP
Language features:
All features of Unlambda 2.0 are supported, including I/O functions,
continuations and promises.
.TP
Comments:
Text in line comments is not restricted to ASCII only. UTF-8 format is also
supported.
.TP
Function names:
Charactor X in functions
.B .X
and
.B ?X
must be printable ASCII or "\\n" (beware if you are using Windows-style
newlines), and are case-sensitive. Other builtin function names are
case-insensitive.
.SS Code Size
Unlambda code size should not be larger than 4MiB (not counting comments and
whitespaces). You may change this limit in
.B defs.h
and rebuild U6a for larger code to compile.
.
.SH SEE ALSO
.BR u6a (1)
.
.SH COPYRIGHT
Copyright (c) 2020 CismonX <admin@cismon.net>
.PP
Copying and distribution of this file, with or without modification, are
permitted in any medium without royalty, provided the copyright notice and
this notice are preserved. This file is offered as-is, without any warranty.