standalone scripting platform for Lua
Find a file
2023-08-10 11:02:43 +12:00
external Change 'ar rcu' to 'ar cr' 2023-07-18 12:56:02 +12:00
lua-5.4 Fix some ldoc mistakes 2023-07-30 10:05:16 +12:00
.editorconfig Add .editorconfig 2023-07-01 09:57:28 +12:00
.gitignore Add Nix flake 2023-08-03 12:36:30 +12:00
callisto.c Move fs.basename and fs.dirname into the path library, create errors.h 2023-08-10 08:14:05 +12:00
callisto.h Move fs.basename and fs.dirname into the path library, create errors.h 2023-08-10 08:14:05 +12:00
config.ld Add result to config.ld 2023-08-10 09:45:53 +12:00
config.mk Remove hard dependency on readline, split makefile config into config.mk 2023-07-18 12:38:03 +12:00
COPYING Add license file 2023-06-26 20:36:37 +12:00
csto.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
errors.h Move fs.basename and fs.dirname into the path library, create errors.h 2023-08-10 08:14:05 +12:00
flake.lock Update flake 2023-08-10 08:18:03 +12:00
flake.nix Improve flake 2023-08-03 17:02:17 +12:00
lcl.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
ldoc.css Minify CSS reset section 2023-07-18 10:14:46 +12:00
lenviron.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
lextra.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
lfs.c Move fs.basename and fs.dirname into the path library, create errors.h 2023-08-10 08:14:05 +12:00
ljson.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
lpath.c Move fs.basename and fs.dirname into the path library, create errors.h 2023-08-10 08:14:05 +12:00
lprocess.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
lsocket.c Rename lcallisto.h -> callisto.h 2023-07-24 12:31:21 +12:00
Makefile Move fs.basename and fs.dirname into the path library, create errors.h 2023-08-10 08:14:05 +12:00
README.md Improve readme 2023-08-10 11:02:43 +12:00
shell.nix Add ldoc to shell.nix 2023-07-23 12:46:42 +12:00
util.c Add credit to OpenBSD for strlcat and strlcpy 2023-07-01 09:53:08 +12:00
util.h Add byte and ubyte #defines in util.h 2023-07-09 21:16:53 +12:00

Callisto

A featureful extension runtime for Lua 5.4, using POSIX APIs.

Callisto is an extension to Lua that adds commonly-needed functions and features to the language, and includes a file system library to manage and manipulate files, a process library to find active processes and manipulate signals, a socket and networking library using LuaSocket, and a JSON manipulation library among many more.

It is a standalone program designed for people using Lua as a general scripting language, instead of using it embedded into another application.

Before I made Callisto, I usually had to rely on three libraries: luaposix for basic file system manipulation and other routines, lua-cjson for JSON parsing support and LuaSocket for networking.

luaposix provides most of the necessary functions, but is generally aimed towards people who already know how to use the POSIX APIs in C.

First and foremost, Callisto tries to be:

  • an all-in-one zero-dependencies library for Lua that includes most features people would need, out of the box
  • a library that works and integrates well with Lua and its standard library, and is easy to use for those who have no experience with C

Callisto relies on APIs specified in the POSIX specification; 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

To build Callisto, you'll need nothing but a C compiler. 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, and clang on most of the BSDs. If cc doesn't exist on your system, 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 support for GNU libreadline. Lua 5.4 is statically linked in.

Installation

Callisto is distributed as source-only, but it's not hard to compile.

First, get the source code using one of the tarballs found in the Releases page. Untar it then enter the directory with Callisto's source code.

After that, run

make

to compile Callisto and all its dependencies.

To install it, run make install as the root user in the source code directory to install Callisto and its shared library.

Usage

The standalone Callisto interpreter is called csto. Running it will start a REPL so you can execute chunks of code interactively.

csto works just like the standalone Lua 5.4 interpreter. To execute a file, run csto <file> where <file> is the name of the file you want to run. Alternatively, you can put #!/usr/bin/env csto at the top of your script, run chmod +x on it, and then you can run the script as if it was a standalone executable, for example ./yourscript.lua.