aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pandoc/bold-code.lua9
-rw-r--r--Makefile3
-rw-r--r--tomo.166
-rw-r--r--tomo.1.md66
4 files changed, 143 insertions, 1 deletions
diff --git a/.pandoc/bold-code.lua b/.pandoc/bold-code.lua
new file mode 100644
index 00000000..02ed1891
--- /dev/null
+++ b/.pandoc/bold-code.lua
@@ -0,0 +1,9 @@
+-- Convert code to bold
+function Code(el)
+ return pandoc.Strong(el.text)
+end
+
+-- Convert code blocks to bold and indented
+function CodeBlock(el)
+ return pandoc.BlockQuote({pandoc.Para(pandoc.Strong(el.text))})
+end
diff --git a/Makefile b/Makefile
index cdc92a7e..d892d07b 100644
--- a/Makefile
+++ b/Makefile
@@ -58,12 +58,13 @@ clean:
%.1: %.1.md
pandoc --lua-filter=.pandoc/bold-code.lua -s $< -t man -o $@
-install: tomo libtomo.so
+install: tomo libtomo.so tomo.1
mkdir -p -m 755 "$(PREFIX)/man/man1" "$(PREFIX)/bin" "$(PREFIX)/include/tomo" "$(PREFIX)/lib" "$(PREFIX)/share/tomo/modules"
cp -v builtins/*.h "$(PREFIX)/include/tomo/"
cp -v libtomo.so "$(PREFIX)/lib/"
rm -f "$(PREFIX)/bin/tomo"
cp -v tomo "$(PREFIX)/bin/"
+ cp -v tomo.1 "$(PREFIX)/man/man1/"
uninstall:
rm -rvf "$(PREFIX)/bin/tomo" "$(PREFIX)/include/tomo" "$(PREFIX)/lib/libtomo.so" "$(PREFIX)/share/tomo"; \
diff --git a/tomo.1 b/tomo.1
new file mode 100644
index 00000000..08cdc390
--- /dev/null
+++ b/tomo.1
@@ -0,0 +1,66 @@
+.\" Automatically generated by Pandoc 3.1.8
+.\"
+.TH "TOMO" "1" "June 11, 2024" "" ""
+.SH NAME
+tomo - The programming language of tomorrow.
+.SH SYNOPSIS
+.TP
+Run the REPL:
+\f[B]tomo\f[R]
+.TP
+Run a program:
+\f[B]tomo\f[R] \f[I]program.tm\f[R] [[\f[B]--\f[R]] \f[I]args\&...\f[R]]
+.TP
+Transpile tomo files to C files:
+\f[B]tomo\f[R] \f[B]-t\f[R] \f[I]file1.tm\f[R] \f[I]file2.tm\f[R]\&...
+.TP
+Compile files to static object files:
+\f[B]tomo\f[R] \f[B]-c\f[R] \f[I]file1.tm\f[R] \f[I]file2.tm\f[R]\&...
+.TP
+Compile file to an executable:
+\f[B]tomo\f[R] \f[B]-e\f[R] \f[I]file1.tm\f[R]
+.TP
+Build a shared library:
+\f[B]tomo\f[R] \f[B]-s=\f[R]\f[I]mylib.1.2.3\f[R] \f[I]file1.tm\f[R]
+\f[I]file2.tm\f[R]\&...
+.SH DESCRIPTION
+Tomo is a programming language that is statically typed, compiled,
+small, and garbage-collected, with concise syntax and built-in support
+for high-performance, low-overhead datastructures.
+It compiles by first outputting C code, which is then compiled using a C
+compiler of your choice.
+.SH OPTIONS
+.TP
+\f[B]-h\f[R], \f[B]--help\f[R]
+Print the usage and exit.
+.TP
+\f[B]-t\f[R]
+Transpile the input files to C code without compiling them.
+.TP
+\f[B]-c\f[R]
+Compile the input files to static objects, rather than running them.
+.TP
+\f[B]-s=\f[R]\f[I]foo.1.2.3\f[R]
+Compile the input files to a shared object file,
+\f[B]libfoo.1.2.3.so\f[R], and shared header file,
+\f[B]libfoo.1.2.3.h\f[R].
+Also offer to install the resulting library.
+.SS ENVIRONMENT VARIABLES
+Some options can be configured by setting environment variables.
+.TP
+\f[B]VERBOSE=0|1|2\f[R]
+Set the verbosity level.
+.TP
+\f[B]CC=\f[R]\f[I]c-compiler\f[R]
+Set which C compiler is used.
+.TP
+\f[B]O=\f[R]\f[I]optimization-level\f[R]
+Set which optimization level is passed to the C compiler.
+Valid values are those accepted by your compiler\[cq]s \f[B]-O\f[R]
+flag.
+.TP
+\f[B]AUTOFMT=\f[R]\f[I]autoformatter\f[R]
+The program used to autoformat generated C code.
+Default: \f[B]indent -kr -l100 -nbbo -nut -sob\f[R]
+.SH AUTHORS
+Bruce Hill (\f[I]bruce\[at]bruce-hill.com\f[R]).
diff --git a/tomo.1.md b/tomo.1.md
new file mode 100644
index 00000000..6ff6ba7e
--- /dev/null
+++ b/tomo.1.md
@@ -0,0 +1,66 @@
+% TOMO(1)
+% Bruce Hill (*bruce@bruce-hill.com*)
+% June 11, 2024
+
+# NAME
+
+tomo - The programming language of tomorrow.
+
+# SYNOPSIS
+
+Run the REPL:
+: `tomo`
+
+Run a program:
+: `tomo` *program.tm* \[\[`--`\] *args...*\]
+
+Transpile tomo files to C files:
+: `tomo` `-t` *file1.tm* *file2.tm*...
+
+Compile files to static object files:
+: `tomo` `-c` *file1.tm* *file2.tm*...
+
+Compile file to an executable:
+: `tomo` `-e` *file1.tm*
+
+Build a shared library:
+: `tomo` `-s=`*mylib.1.2.3* *file1.tm* *file2.tm*...
+
+# DESCRIPTION
+
+Tomo is a programming language that is statically typed, compiled, small, and
+garbage-collected, with concise syntax and built-in support for
+high-performance, low-overhead datastructures. It compiles by first outputting
+C code, which is then compiled using a C compiler of your choice.
+
+# OPTIONS
+
+`-h`, `--help`
+: Print the usage and exit.
+
+`-t`
+: Transpile the input files to C code without compiling them.
+
+`-c`
+: Compile the input files to static objects, rather than running them.
+
+`-s=`*foo.1.2.3*
+: Compile the input files to a shared object file, `libfoo.1.2.3.so`, and shared
+header file, `libfoo.1.2.3.h`. Also offer to install the resulting library.
+
+## ENVIRONMENT VARIABLES
+
+Some options can be configured by setting environment variables.
+
+`VERBOSE=0|1|2`
+: Set the verbosity level.
+
+`CC=`*c-compiler*
+: Set which C compiler is used.
+
+`O=`*optimization-level*
+: Set which optimization level is passed to the C compiler. Valid values are
+ those accepted by your compiler's `-O` flag.
+
+`AUTOFMT=`*autoformatter*
+: The program used to autoformat generated C code. Default: `indent -kr -l100 -nbbo -nut -sob`