YAML rules, transformations, security and data — as a native C-ABI library, no services, no network

1single engine (same as the bridge, byte-exact)
17+languages & runtimes tested
5preserved platforms (macOS · Linux · Windows · Android · iOS)
0drivers or crypto libraries in your application
2consumption models: C-ABI and pure-Go package (no CGO)

The native-object model

Native object
dict · Map · Hash · Value · json
→
Binding (entity 2)
serializes + declares codec
→
C ABI
transform_codec()
→
Rules engine
YAML · 5G functions · Lua SDKs
⇄
Native object
dict · Map · Hash · Value · json

Your code passes its language's natural structure and gets one back. The binding serializes, declares the codec and reverses the trip — you never touch bytes.

3-entity architecture

1 · The library

Go+cgo source, generated C header, per-platform binaries preserved and tested (dist/<os>_<arch>)

2 · The bindings

Reusable modules using each runtime's NATIVE model: N-API, JNI, NIF, P/Invoke, Ruby extension, C-ABI — FFI as reference only

3 · The examples

Tested under the E1–E4 standard: resource preflight, checked calls, documented expected output, exit codes

Two consumption models

C-ABI (.so · .dylib · .dll)

For any language: netalchemy_init + transform_codec through each runtime's native binding. One library per platform, preserved under dist/.

Pure-Go package (no CGO)

github.com/netalchemy/libnetalchemy-go: a Go app imports the full engine — static binary, no .so, no C toolchain. Latency parity MEASURED against the CGO variant (15.07 vs 15.25 ms avg, 25K).

One engine, all your languages

CC++COBOLPythonNodeBunDenoJavaKotlinScalaBallerinaRustElixirC#SwiftDartPHPRubyLua/LuaJIT

Built wrappers, by language

Python

netalchemy.py 1.4.0 — stdlib ctypes, no build, no dependencies; resolves -14 with fetch_pending and raises NetAlchemyError with .code.

Node · Bun · Deno

N-API addon netalchemy.node: one binary serves all three runtimes — 6/6 desktop prebuilts.

Java · Kotlin · Scala · Ballerina

Single JVM binding over JNI (com.netalchemy.bridge) — two-stage loading.

C# / .NET

P/Invoke (NetAlchemyEngine) with native library resolver.

Elixir

NIF with dirty schedulers — transform/validate never block the BEAM.

Ruby

Native C extension (ext/netalchemy).

Rust

netalchemy crate — compile-time linking (build.rs + rpath), no dynamic loader.

C++

netalchemy.hpp header-only RAII, C++17, dependency-free.

Swift (macOS · iOS)

Native bridging header; on iOS it links the static XCFramework.

Dart · Flutter

netalchemy.dart — dart:ffi, the runtime's official interop.

Go

Pure import libnetalchemy-go: the engine as a package, no CGO, no .so.

C · COBOL

Direct C-ABI: generated C header / CALL from the core — proven with GnuCOBOL.

All resolve the library via the <os>_<arch> tag over lib/dist/; policy: the runtime's native model whenever it exists — FFI only as a reference alternative (PHP and Lua/LuaJIT use it in the examples).

What the rule does for your application

Transformation

Mappings, PCI masking, amounts, DST-aware dates, JSON/msgpack/YAML/ISO 8583 codecs per call

Security

SHA-256, HMAC, JOSE, base64, HOTP — verified by cryptographic cross-check against the host reference

Data

@DbFindRow over named connections; the driver is the db-sdk Go plugin — your app links no driver at all

Validation gate

The same rule as a business gate: 0 pass, 30 reject (including an output carrying _http_status >= 400, as the daemon reads it) — decisions without recompiling

Hardened C API (#11-#14, since 2026-09-29)

New codes

-11 invalid argument (NULL pointer, negative length, NULL codec) · -15 rule NULL, empty or not loaded, no fallback to global matching · -99 recovered Go panic: the host process stays alive. -10 still means “not initialized”.

Short buffer, no re-run

-14 keeps the result pending: netalchemy_required_len() gives the size and netalchemy_fetch_pending() copies it without running the rule again (-16 = nothing pending). One pending result per process.

Init like the daemon

netalchemy_init resolves params: and mounts packages:; a missing required env: variable returns -1. Each call carries its own request id and releases its state when done.

Python 1.4.0

On a -14 the binding asks required_len and fetches the pending result; NetAlchemyError.code + RETURN_CODES. With libraries lacking those exports it keeps the previous behavior.

Full return-code table: sdks/libnetalchemy/docs/REFERENCE_MANUAL.md §4.

One logger: your application's (since 2026-10-09)

Your logger is the logger

netalchemy_set_log_callback(fn, user): fn receives every line of the library, Go and Lua — level (10 TRACE … 60 FATAL), request id, module, origin (host or lua) and message — and the library writes nowhere else: no line comes out twice. A host that cannot take the call (PHP, OpenResty, JS FFI) reads them: netalchemy_set_log_queue(n) + netalchemy_fetch_log(buf, len), JSON Lines.

Any thread, one per process

It is called from the thread that logs, and the strings live only during the call (copy them). Set before init, the start-up lines arrive too; NULL removes it.

logging.file

Without a callback, the library's log goes to a rotated file (the config's logging: section: file, max_size_mb 10, max_files 5). The host process's stdout is never redirected; netalchemy_free closes the file.

In all 11 bindings

Each under its language's name and with its threading rule: JNI attaches the thread to the JVM, N-API delivers asynchronously on the JS thread, Elixir sends a message, Ruby and Dart queue and deliver on their own thread. netalchemy_ffi.js does not offer it (koffi deadlocks; bun:ffi runs after the strings are freed): use N-API or logging.file.

Details: sdks/libnetalchemy/docs/TUTORIAL_LIBNETALCHEMY.md level 3.6 and bindings/README.md “Logs”.

Proven integration into existing products

Kong · APISIX · OpenResty

A ~50-line LuaJIT plugin loads the .so: the gateway gains field-by-field transformation, validation with autoreply and rule-based decisioning.

Tyk

A rich-plugin gRPC extension runs the real engine — as the CGO/dlopen variant or imported as pure Go (engine_mode: native).

What the engine adds

Mappings, business gates (30/96), resolution and JSON · msgpack · YAML · ISO 8583 codecs per call — none supported natively by those products.

Published evidence

100K x 3 connection modes x 5 platforms matrix: 1,500,000 requests, 0 failures; latency on par with the leaders (Peristela lab, 2026-07).

From the mainframe to the pocket

Gateways

OpenResty · Kong · APISIX · Tyk · WSO2 load the engine (LuaJIT FFI or gRPC extension) — the use case that created the library, now proven with 1.5M requests

Legacy banking

A COBOL core uses the engine with a direct CALL — tested with GnuCOBOL, byte-equal to the rest

Android

Demo APK verified on emulator: arm64 .so (NDK) + same JVM binding + SDKs in assets

iOS

Static linkage (XCFramework) — executed inside the simulator; Swift binding identical to macOS

Engines by configuration

GopherLua (default, pure Go) · LuaJIT (-48% avg at c=200) · Lua 5.4/5.5 — identical verdicts guaranteed by the cross-engine contract test.