NickelEval.jl

Julia FFI bindings for Nickel configuration language
Log | Files | Refs | README | LICENSE

commit 5fb0d2ad08c4966605ff5fd36ff84421de3399bd
parent a40d717997673b23bb7d957da5ab81ddabe0de73
Author: Erik Loualiche <eloualic@umn.edu>
Date:   Tue, 17 Mar 2026 22:36:48 -0500

Fix artifact sha256 hashes and bump to v0.5.1

All 4 platform sha256 hashes were stale after tarballs were re-packaged
during repo rename. Windows git-tree-sha1 also updated (binary content
changed). Updates README with native FFI and file evaluation docs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Diffstat:
MArtifacts.toml | 10+++++-----
MProject.toml | 2+-
MREADME.md | 26++++++++++++++++++++++++--
MTODO.md | 2+-
4 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/Artifacts.toml b/Artifacts.toml @@ -11,7 +11,7 @@ lazy = true [[libnickel_jl.download]] url = "https://github.com/LouLouLibs/NickelEval.jl/releases/download/v0.5.0/libnickel_jl-aarch64-apple-darwin.tar.gz" - sha256 = "9f6f6fb4336221a10d7445caf5abad4980e71c92d55bfdbf7a402fbd76cddaa1" + sha256 = "ee01809a7439404932665c5ecbca223d6366013b29441a2a528e5724b1237e35" # macOS Intel (x86_64) [[libnickel_jl]] @@ -22,7 +22,7 @@ lazy = true [[libnickel_jl.download]] url = "https://github.com/LouLouLibs/NickelEval.jl/releases/download/v0.5.0/libnickel_jl-x86_64-apple-darwin.tar.gz" - sha256 = "e2a93fe247286efa553c2e5ce5d2cce01fc591741b3ae730c12f708f6dfc9857" + sha256 = "53f68b6f1d45e7e9d9b295adee7fa6db4f6dd6d83dac80fea49734196ca21549" # Linux x86_64 [[libnickel_jl]] @@ -33,15 +33,15 @@ lazy = true [[libnickel_jl.download]] url = "https://github.com/LouLouLibs/NickelEval.jl/releases/download/v0.5.0/libnickel_jl-x86_64-linux-gnu.tar.gz" - sha256 = "2ca510ee4ac8df02ed04d510a00c8d986098fdc2a75af1bb6d3e7b16eff11aeb" + sha256 = "724737db98179cbf3950dbdfc2090e6af9286323ca468d0ddeee6aad60060411" # Windows x86_64 [[libnickel_jl]] arch = "x86_64" -git-tree-sha1 = "e412ae6fcf306a603a4ae17222f31746f2622045" +git-tree-sha1 = "b8ec9ea4b8f474f04ec3bdc010e1d96bce0b64f9" os = "windows" lazy = true [[libnickel_jl.download]] url = "https://github.com/LouLouLibs/NickelEval.jl/releases/download/v0.5.0/nickel_jl-x86_64-windows.tar.gz" - sha256 = "c1279f0b3fe202b366acf7a635f3c6da59704bab49470619e8f5d91267241fe7" + sha256 = "30feedd4e255e0b87499e2f99c37d454ccfa44bca89e02ba0e6900f326315e74" diff --git a/Project.toml b/Project.toml @@ -1,7 +1,7 @@ name = "NickelEval" uuid = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" authors = ["NickelJL Contributors"] -version = "0.5.0" +version = "0.5.1" [deps] Artifacts = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" diff --git a/README.md b/README.md @@ -166,11 +166,31 @@ For repeated evaluations, use the native FFI bindings (no subprocess overhead): # Check if FFI is available check_ffi_available() # => true/false -# Use FFI evaluation +# Native evaluation (recommended) - preserves integer vs float distinction +nickel_eval_native("42") # => 42::Int64 +nickel_eval_native("3.14") # => 3.14::Float64 +nickel_eval_native("{ x = 1 }") # => Dict("x" => 1) + +# JSON-based FFI evaluation - supports typed parsing nickel_eval_ffi("1 + 2") # => 3 nickel_eval_ffi("{ x = 1 }", Dict{String, Int}) # => Dict("x" => 1) ``` +### File Evaluation via FFI + +Evaluate `.ncl` files with full import support, no subprocess needed: + +```julia +# config.ncl: +# let shared = import "shared.ncl" in +# { name = shared.project_name, version = "1.0" } + +nickel_eval_file_native("config.ncl") +# => Dict{String, Any}("name" => "MyProject", "version" => "1.0") +``` + +Import paths are resolved relative to the file's directory. + ### Building FFI The FFI library requires Rust. To build: @@ -208,7 +228,9 @@ cp target/release/libnickel_jl.dylib ../../deps/ # macOS | Function | Description | |----------|-------------| -| `nickel_eval_ffi(code)` | FFI-based evaluation (faster) | +| `nickel_eval_native(code)` | Native FFI evaluation (preserves types) | +| `nickel_eval_file_native(path)` | Evaluate `.ncl` file via FFI with import support | +| `nickel_eval_ffi(code)` | JSON-based FFI evaluation | | `nickel_eval_ffi(code, T)` | FFI evaluation with type conversion | | `check_ffi_available()` | Check if FFI bindings are available | diff --git a/TODO.md b/TODO.md @@ -1,6 +1,6 @@ # NickelEval.jl - Status & TODOs -## Current Version: v0.4.0 +## Current Version: v0.5.1 ## Completed Features