NickelEval.jl
Julia bindings for the Nickel configuration language, using the official Nickel C API.
Evaluate Nickel code directly from Julia and get back native Julia types — no CLI, no intermediate files, no serialization overhead.
Features
Direct evaluation of Nickel expressions and files via the C API
Native type mapping — records become
Dict, arrays becomeVector, enums becomeNickelEnumTyped evaluation — request results as
Dict{String,Int},Vector{Float64},NamedTuple, etc.Export to JSON, TOML, YAML — serialize Nickel configurations to standard formats
File evaluation with imports — evaluate
.nclfiles that reference other Nickel files
Documentation
Installation
From the LouLouLibs Registry
using Pkg
Pkg.Registry.add(url="https://github.com/LouLouLibs/loulouJL")
Pkg.add("NickelEval")From GitHub
using Pkg
Pkg.add(url="https://github.com/LouLouLibs/NickelEval.jl")Pre-built native libraries are provided for macOS (Apple Silicon) and Linux (x86_64). On supported platforms, the library downloads automatically when first needed.
Building from Source
If the pre-built binary doesn't work on your system — or if no binary is available for your platform — you can build the Nickel C API library from source. This requires Rust.
using NickelEval
build_ffi()This clones the Nickel repository, compiles the C API library with cargo, and installs it into the package's deps/ directory. The FFI is re-initialized automatically — no Julia restart needed.
You can also trigger the build during package installation:
ENV["NICKELEVAL_BUILD_FFI"] = "true"
using Pkg
Pkg.build("NickelEval")Older Linux Systems (glibc Compatibility)
The pre-built Linux binary is compiled against a relatively recent version of glibc. On older distributions — CentOS 7, older Ubuntu LTS, or many HPC clusters — you may see an error like:
/lib64/libm.so.6: version `GLIBC_2.29' not foundThe fix is to build from source:
using NickelEval
build_ffi()This compiles Nickel against your system's glibc, producing a compatible binary. The only requirement is a working Rust toolchain (cargo), which can be installed without root access via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shAfter installing Rust, restart your Julia session and run build_ffi().