LIL Little Interpreted Language

LIL (stands for Little Interpreted Language) is a small highly dynamic scripting language inspired by Tcl and unix shells. LIL has two implementations, one written in C, which consists of a pair of .c and .h files and one in Free Pascal, which consists of a single pas file (a unit). Also a Lazarus package for the latter is provided.

Contents

  • Downloads
  • Latest version
  • Older versions
  • WinLIL
  • LILGUI
  • API stability and compatibility
  • Documentation
  • Status
  • License
  • Downloads

    LIL is currently available as source code snapshots of both the C and the Free Pascal version combined in a single ZIP file. These snapshots are versioned using their release date. Note that the interpreter's reflect version command will report 0.1 regardless of date versioning. Both of these will change at some point in the future to provide proper versioned releases.

    Latest version

    The latest version of LIL is lil20211019.zip (162KB). This is an extract from my private Fossil repository (the files are mostly the same as the older archives, but this also includes a full changelog from the repository going back to 2010 and the LIL logo as an XCF image which can be opened with GIMP).

    Please note that 20190821 contains slightly altered behavior for line breaking during list parsing that could affect some scripts, especially with lists that contain code inside square brackets, however the previous behavior was completely broken (e.g. having multiple commands inside brackets in a list would merge all commands into a single one and if a semicolon was used for the multiple commands, the entire command wouldn't be parsed properly). Because of that i expect any reliance on the previous behavior to be accidental (and in practice i do not really expect any such script to even exist). Also in the same version a Bash script is introduced to check the differences between different executables by running the same scripts under both and comparing the results, which show that FPLIL contains a few incompatibilities with C LIL. At this moment FPLIL doesn't implement the changes mentioned so far - all these incompatibilities and changes will be fixed in a later release.

    Older versions

    Some older versions are also available in case you need them. LIL should be mostly backwards compatible (see below), but right now there is no promise for strict API or ABI compatibility.

    WinLIL

    If you are using Windows you can also download WinLIL, a small Windows-based environment with editor, console and extra graphics functions that can be used to experiment with LIL. It is self-contained in a single executable, including the LIL documentation.

    The latest version is WinLIL 1.5 (204KB) based on C LIL 20210703. Here is a screenshot of it in action. Also a small doodle program can be downloaded here and a screenshot seen here. This archive (45KB) contains the source code, but note that it uses the original Borland C++ Builder and to compile with a newer version (such as the free Community Edition) you'll need to recreate the project file and make a few modifications to the code.

    Older versions of WinLIL can be found in these files: winlil14.zip (1.4 binary), winlil20190821231511.zip (1.4 source), winlil13.zip (1.3 binary), winlil20190524200539.zip (1.3 source), winlil20170424.zip (binary), winlilsrc20161220.7z (source).

    LILGUI

    LILGUI is an experimental API specification for GUI applications that provide scripting functionality through LIL to expose a simple GUI API. It is mainly intended for creating embeddable GUIs (e.g. a panel in a sidebar) although it can also be used for popup windows and dialogs. Currently the only implementation for LILGUI is LazLILGUI, which is a component for Lazarus that uses LCL to provide the actual GUI functionality.

    The latest version of LILGUI files (which include the API spec, LazLILGUI and a couple of examples) can be downloaded here (85KB). A 64bit windows binary for LazLILGUI Notepad, a text editor that provides a sidebar to try out LILGUI code, can be downloaded here (1.3MB). Also you can see the screenshots of program in action under Windows, Linux and Mac OS X and also the Custom Control Example under Windows.

    API stability and compatibility

    Generally speaking, both the C and Free Pascal implementation APIs are stable for the most part. The C API was broken only once in middle 2010 when lil_command_t was renamed to lil_func_t and the C ABI for the Windows DLL is also backwards compatible since late 2010. The Free Pascal implementation has a less stable API but as Free Pascal itself does not support ABI stability, this is less of a concern.

    In the foreseeable future the C API should be stable, but i'd recommend against building a system-wide shared version of the library before a proper versioned release is made. Once a versioned release is made, both the API and ABI will remain stable for as long as it is technically possible.

    Script code should be backwards compatible even as new commands are introduced since scripts and host applications will redefine any conflicting functions anyway. The only time script code was broken was in 2012 when the multiline comments were introduced so any script that used a comment line like ##### was broken. This was addressed in a fix in 2014 that added a special check for such cases so that multiline comments can only start and end with two #s but not three or more (while this could have broken any script that used three or more #s to start and end multiline comments, the chances for such a script are very slim).

    Like with the C API, the script backwards compatibility currently is mostly stable, but minor changes (like the multiline comment changes mentioned above) might be made until a versioned release is made or fixes to the script behavior to be closer to what is described in the documentation or simply fix broken behavior. At that point no changes will be made that may affect backwards compatibility.

    LILGUI and LazLILGUI are more experimental and may see backwards incompatible changes in the future.

    Documentation

    Currently the only documentation is the (lengthy) readme.txt file that you can read here or as part of the archive containing the source code. At some point i'll write better formatted documentation. Free Pascal has its own API documentation readable here and also as a part of the archive containing the source code.

    The LILGUI API can be found here and the documentation for LazLILGUI can be found here. Both are also part of the LILGUI archive.

    Also an old LIL presentation can be found on SlideShare. Please note that the URLs in the presentation are not valid anymore.

    Status

    LIL is practically feature-complete and i do very little development of it. I do not plan on making it a big and bloated library that tries to provide everything - if anything, in the future i might add some conditionals to remove bits of the library for users who do not need, e.g, the string or list functions.

    Further work is mostly "around" LIL and not on the language itself: improving the documentation, writing a test suite (currently there are several examples which i run after making changes and almost half of them come from bug fixes, but i'd like somethnig more automated), fixing some issues with the Free Pascal implementation, adding more functions on the C API to access LIL's state, etc.

    License

    Both the C and Free Pascal implementations as well as WinLIL are licensed under the zlib license below:

    LIL - Little Interpreted Language
    Copyright (C) 2010-2021 Kostas Michalopoulos
    
    This software is provided 'as-is', without any express or implied
    warranty.  In no event will the authors be held liable for any damages
    arising from the use of this software.
    
    Permission is granted to anyone to use this software for any purpose,
    including commercial applications, and to alter it and redistribute it
    freely, subject to the following restrictions:
    
    1. The origin of this software must not be misrepresented; you must not
       claim that you wrote the original software. If you use this software
       in a product, an acknowledgment in the product documentation would be
       appreciated but is not required.
    2. Altered source versions must be plainly marked as such, and must not be
       misrepresented as being the original software.
    3. This notice may not be removed or altered from any source distribution.