Skip to content
/ luci Public

Another dynamically-typed, lightweight programming language

Notifications You must be signed in to change notification settings

naegelejd/luci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luci

Luci is a procedural, dynamically-typed toy scripting language, implemented in C.

Luci's syntax is similar to that of C and Lua.

The Luci command-line interpreter includes a crude interactive mode, which allows for quick exploration of the language and its runtime facilities.

Luci is missing an incredible number of features, many of which are listed under TODO.

Luci's builtin types and functions are described in LANGUAGE.

Sample programs written in Luci are provided in the samples/ directory.

Build

To generate the necessary scanner and parser, you'll need flex (lex) and bison (yacc)

Both flex and bison are available via:

You'll also need cmake to generate the build system for your OS (Makefiles, VS Studio project, etc.)

Unix/MinGW build example:

mkdir build
cd build
cmake ..
make
make test

This generates the binary luci in build/bin.

The included tests can be executed using make test, which utilizes Cmake's CTest framework.

To generate the included source documentation, obtain doxygen 1.8.3, then run make doc.

Implementation

Luci code is parsed to form an abstract syntax tree, which is then compiled to Luci's bytecode representation, then executed by the virtual machine.

All types in Luci are implemented using a base LuciObject struct, which contains a pointer to a virtual method table. Each type implements its own static virtual method table.

LuciObject s are prevalent throughout Luci's implementation. The LuciList is probably the most widely used, as it is essentially a dynamically expandable list of pointers. Luci's virtual machine uses a LuciList for its internal stack.

Luci uses a crude, stop-the-world, mark-and-sweep garbage collector to allocate and manage memory. This allows for simpler implementation code (less memory management) as well as the ability to finalize objects.

References

About

Another dynamically-typed, lightweight programming language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published