u6a/man/u6ac.1

105 lines
2.4 KiB
Groff
Raw Normal View History

2022-02-14 15:23:02 +00:00
.TH "U6A" "1" "Jan 30, 2020" "0.1.1" "U6a User Manual"
2020-01-30 10:11:10 +00:00
.
.SH NAME
2020-10-10 19:31:31 +00:00
u6ac - Bytecode compiler for the Unlambda programming language
2020-01-30 10:11:10 +00:00
.
.SH SYNOPSIS
2020-10-10 19:31:31 +00:00
.B u6ac
.RI [ options ]
.I source-file
2020-01-30 10:11:10 +00:00
.
.SH DESCRIPTION
2020-10-10 19:31:31 +00:00
Read and compile Unlambda code from the given
.IR source-file ,
or
.B STDIN
if "-" is given.
2022-02-14 15:23:02 +00:00
Compilation result is saved in a special bytecode format, which can be executed
with
2020-10-10 19:31:31 +00:00
.BR u6a (1).
2020-01-30 10:11:10 +00:00
.
.SH OPTIONS
.TP
2020-10-10 19:31:31 +00:00
\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 .
2020-01-30 10:11:10 +00:00
.TP
2020-10-10 19:31:31 +00:00
\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".
2020-01-30 10:11:10 +00:00
.TP
2022-02-14 15:23:02 +00:00
\fB\-O\fR[\fIoptimization-level\fR]
2020-10-10 19:31:31 +00:00
Compile-time optimization level.
.BR \-O0 :
Turn off optimization.
.BR \-O1 (default):
2022-02-14 15:23:02 +00:00
Turn on basic optimizations, including constant folding & propagation,
dead code elimination, etc.
2020-01-30 10:11:10 +00:00
.TP
\fB\-\-syntax\-only\fR
2022-02-14 15:23:02 +00:00
Only check for lexical and syntactic correctness of the source file, and skips
bytecode generation.
2020-01-30 10:11:10 +00:00
.TP
2020-05-03 12:54:34 +00:00
\fB\-S\fR
Produce mnemonic pseudo-instructions instead of bytecode.
.TP
2020-01-30 10:11:10 +00:00
\fB\-v\fR, \fB\-\-verbose\fR
2020-10-10 19:31:31 +00:00
Print extra debug messages to
.BR STDOUT .
When this option is enabled,
.I out-file
should not be
.BR STDOUT .
2020-01-30 10:11:10 +00:00
.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:
2022-02-14 15:23:02 +00:00
All features of Unlambda 2.0 are supported, including I/O functions,
continuations and promises.
2020-01-30 10:11:10 +00:00
.TP
Comments:
2022-02-14 15:23:02 +00:00
Text in line comments is not restricted to ASCII only. UTF-8 format is also
supported.
2020-01-30 10:11:10 +00:00
.TP
Function names:
2020-10-10 19:31:31 +00:00
Charactor X in functions
.B .X
and
.B ?X
2022-02-14 15:23:02 +00:00
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.
2020-01-30 10:11:10 +00:00
.SS Code Size
2022-02-14 15:23:02 +00:00
Unlambda code size should not be larger than 4MiB (not counting comments and
whitespaces). You may change this limit in
2020-10-10 19:31:31 +00:00
.B defs.h
2020-10-10 20:12:16 +00:00
and rebuild U6a for larger code to compile.
2020-01-30 10:11:10 +00:00
.
.SH SEE ALSO
2020-10-10 19:31:31 +00:00
.BR u6a (1)
2020-01-30 10:11:10 +00:00
.
.SH COPYRIGHT
2020-10-10 19:31:31 +00:00
Copyright (c) 2020 CismonX <admin@cismon.net>
.PP
2022-02-14 15:23:02 +00:00
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.