ChainForth.jl is an embedded virtual machine that helps you provide a highly secure but programmable, Turing-complete API layer at the edge of your Julia projects.

It is a simple Forth-like environment interpreted (in the future hopefully also JIT-ed) in Julia, which you can easily extend in native Julia to provide an API to the scripts, and which you can easily extend by specifying your DSL in ChainForth itself.

The following example shows the use of an ad-hoc query language created with ChainForth. The example defines the new word (function) Last7Days, that queries some historical data specifying aggregation and selection:

def Last7Days
    HISTORY 5 mins
        STARTAT now 7 days -
        ENDAT now
        FIELDS TimeStamp High

The syntax used in this DSL was defined in the language itself.

There is a super-minimal repl:

julia> using ChainForth

julia> ChainForth.repl()
ChainForth.jl v"0 dev":
: double 2 * ;
: quadruple double double ;
3 quadruple .
12 ok

Please read the source and the tests for more info.