Likely  0.5.0
An embeddable just-in-time Lisp for image recognition and heterogeneous computing.
Likely API

Welcome to the Likely API documentation! The Console-Interpreter-Compiler is written on top of this interface, so anything it can do you can do too!

Getting Started

Likely has a C API. Your project should #include <likely.h> and link against likely. Note that all symbols are prefixed with likely_ and follow a lowercase_underscore naming convention. CMake users may appreciate LikelyConfig.cmake provided in share/likely/.

Start reading Hello World JIT.

Reference Counting

All data structures in the Likely API are passed by pointer-to-reference-counted structs. This is done for several reasons, including:

As a result, end users should make use of the provided functions for retaining (shallow copying), and releasing (deleting) objects:

Struct Pointer Retain / Release
likely_matrix likely_mat
likely_abstract_syntax_tree likely_ast
likely_error likely_err
likely_environment likely_env
With the exception of Owned By, the calling application is assumed to take ownership of a funciton's return value and should release it when no longer needed.

The reference count is kept in a variable named ref_count which is incremented and decremented by calls to retain and release respectively. When the reference count is decremented to zero, any memory associated with the structure will be freed. Applications should not modify the ref_count variable directly.

As a special case, structures that live in constant memory or should persist for the lifetime of the application are assigned a ref_count equal to UINT32_MAX. In this case retain and release are no-ops.

Owned By

There are certain functions in the API which always return references to existing data. These functions will indicate which parameter the return value is Owned By in the documentation of the return value itself. In this case, the return value is guaranteed for the lifetime of the owning parameter. The calling application may explicitly retain an additional reference to the return value to extend its lifetime beyond that of the owning parameter.

In the case of Owned By, the calling application should not explicitly release the return value unless the calling application explicitly retained it earlier.

Thread Safety

All functions are marked one of: