Skip to content

Pallene Tracer is a mechanism and protocol for Lua C modules to have proper tracebacks

License

Notifications You must be signed in to change notification settings

pallene-lang/pallene-tracer

Repository files navigation

The Pallene Tracer

Pallene Tracer allows Lua libraries written in C to have proper function tracebacks, without changing a single code in Lua!

Pallene Tracer was created to address the need for function tracebacks in Pallene, an Ahead-of-Time compiled sister language to Lua. Pallene is intermediately compiled to C, hence protocols and mechanism used can be ported to broader Lua C libraries.

Note: Pallene Tracer is independent of Pallene but not vice versa.

Installing Pallene Tracer

Prerequisites

You need to have atleast Lua 5.4 installed in your system at any location.

Building

To build against /usr Lua prefix (system Lua), just simply run:

make

To build against local Lua with /usr/local prefix (or any prefix):

make LUA_PREFIX=/usr/local

Note: Default LUA_PREFIX is /usr.

Pallene Tracer sometime fails to build if Lua is built with address sanitizer (ASan) enabled. To get around the issue use:

make LDFLAGS=-lasan LUA_PREFIX=<preferred_prefix>

Installing

To install Pallene Tracer to /usr/local, simply run:

sudo make install

Pallene Tracer supplies a custom Lua frontend pt-lua and ptracer.h header (including source).

How to use Pallene Tracer

The developers manual on how Pallene Tracer works and used can be found in docs. Also feel free to look at the examples directory for further intuition.