"refactor" readme

This commit is contained in:
Jeremy Baxter 2023-08-01 17:57:24 +12:00
parent 6590351e48
commit 7a2db8166b

View file

@ -3,18 +3,18 @@
A featureful extension runtime for Lua 5.4, using POSIX APIs. A featureful extension runtime for Lua 5.4, using POSIX APIs.
Callisto is an extension to Lua that adds commonly-needed functions Callisto is an extension to Lua that adds commonly-needed functions
and features to the language, and includes a file library to manage and features to the language, and includes a file system library to
and manipulate files, a process library to find active processes and manage and manipulate files, a process library to find active processes
manipulate signals, a socket and networking library using LuaSocket, and manipulate signals, a socket and networking library using LuaSocket,
and a JSON manipulation library *among many more*. and a JSON manipulation library *among many more*.
It is a standalone runtime designed for people using Lua as a It is a standalone program designed for people using Lua as a
general scripting language, instead of using it embedded into general scripting language, instead of using it embedded into
another application. another application.
Before I made Callisto, I usually had to rely on three libraries: Before I made Callisto, I usually had to rely on three libraries:
luaposix for basic file manipulation and other routines, lua-cjson luaposix for basic file system manipulation and other routines,
for JSON parsing support and LuaSocket for networking. lua-cjson for JSON parsing support and LuaSocket for networking.
luaposix provides most of the necessary functions, but is luaposix provides most of the necessary functions, but is
generally aimed towards people who already know how to use generally aimed towards people who already know how to use
@ -24,10 +24,13 @@ First and foremost, Callisto tries to be:
- an all-in-one zero-dependencies library for Lua that includes - an all-in-one zero-dependencies library for Lua that includes
most features people would need, out of the box most features people would need, out of the box
- a library that works and integrates well with Lua and its - a library that works and integrates well with Lua and its
standard library, and is easy to use standard library, and is easy to use for those who have no
experience with C
Callisto only works on POSIX-compliant operating systems such as Callisto relies on APIs specified in the POSIX specification;
Linux and the BSDs. There is no plan for a Windows port. therefore it does not support operating systems that do not
implement these APIs (like Microsoft Windows), only ones that
do (like Linux and the BSDs).
## Dependencies ## Dependencies
@ -35,7 +38,8 @@ To build Callisto, you'll need nothing but a C compiler.
The default C compiler is *cc* which is usually a symbolic link The default C compiler is *cc* which is usually a symbolic link
to your system's default C compiler. This should be gcc on Linux, to your system's default C compiler. This should be gcc on Linux,
and clang on most of the BSDs. If *cc* doesn't exist on your system, and clang on most of the BSDs. If *cc* doesn't exist on your system,
change the `CC` variable in the Makefile to your desired C compiler. override it by adding `CC=cc` to `make`'s command like (replace `cc` with
the name of or the path to your C compiler)
**Callisto has zero runtime dependencies**, unless you built it with **Callisto has zero runtime dependencies**, unless you built it with
support for GNU libreadline. Lua 5.4 is statically linked in. support for GNU libreadline. Lua 5.4 is statically linked in.
@ -47,20 +51,18 @@ not hard to compile.
First, get the source code using one of the tarballs found in First, get the source code using one of the tarballs found in
the [Releases](https://github.com/jtbx/callisto/releases) page. the [Releases](https://github.com/jtbx/callisto/releases) page.
Untar it then run `make` to compile Callisto. The compiled Untar it then run `make` to compile Callisto.
executable will be named `csto`.
To install `csto` (the Callisto standalone executable) and Run `make install`as the root user in the source code directory
`libcallisto.so` (the Callisto shared library), run `make install` to install Callisto and its shared library.
as the root user in the source code directory.
## Usage ## Usage
The standalone Callisto interpreter is called `csto`. Running it The standalone Callisto interpreter is called `csto`. Running it
will start a REPL so you can execute chunks of code interactively. will start a REPL so you can execute chunks of code interactively.
csto works like the standalone Lua 5.4 interpreter. To run a file, csto works just like the standalone Lua 5.4 interpreter. To execute
run `csto <file>` where *<file>* is the name of the file you want a file, run `csto <file>` where *\<file\>* is the name of the file
to run. Alternatively, you can put `#!/usr/bin/env csto` at the top you want to run. Alternatively, you can put `#!/usr/bin/env csto` at
of your script, run `chmod +x` on it, and then you can run the script the top of your script, run `chmod +x` on it, and then you can run the
as if it was a standalone executable, for example `./yourscript.lua`. script as if it was a standalone executable, for example `./yourscript.lua`.