Skip to content

Native libraries, linked at build time

How Elide uses Static JNI and Native Image substitutions to link native transports, AWS-LC and codecs into one executable shared by its guest languages.

On this page

Interactive tour: Native libraries, linked at build timeInteractive tour: Native libraries, linked at build time

Learn more

Elide ships native transport, cryptography and codecs in one executable. Guest languages share that foundation, combining their application logic with native libraries for networking and data processing.

Ship the native stack in one executable

On Linux and Apple Silicon, Elide links Netty’s native transports and TLS bindings into Native Image as static archives. The managed engine and Rust services ship together in one deployment artifact.[1][2]

Linux supplies epoll and io_uring; macOS supplies kqueue. AWS-LC provides TLS cryptography, while Elide’s Rust services supply zstd, brotli and gzip codecs.[2][3]

Native dependencies become part of the executable’s build, bringing their integration into the same validation and packaging process as the rest of the runtime.

Catch missing bindings before deployment

Elide registers static JNI libraries and their Java-facing methods. Native Image references the corresponding symbols, and the linker checks required definitions while assembling the executable.[1]

This moves native binding resolution into the build. The resulting executable carries the selected native components with it.

Optimize across compilation units

Elide configures ThinLTO for Native Image’s native compiler and Cargo’s final link. Compatible LLVM bitcode lets the linker inline and optimize across compilation units, extending optimization beyond individual source files.[2][4]

Let native libraries serve guest application code

The shared stack creates a direct division of work for servers: native transport and TLS handle connections; host-side HTTP framing turns incoming data into requests; guest code supplies the application handler.

In this design, application code handles a Request and returns a Response. The runtime retains the handler and invokes it through the realm’s event loop. Guest languages focus on application behavior while sharing the transport and cryptography beneath them.[5]

Embed the engine behind the CLI

Elide exposes a native entrypoint driven by a versioned Cap’n Proto record. CLI and embedded hosts use the same interface, so the engine can serve both command-line tools and larger host applications.[6]

Hosts can manage multiple Native Image isolates. Collector selection also follows the workload: Serial keeps memory overhead low for smaller applications, while G1 targets sustained server throughput.[6][7]

Sources

  1. Elide static native library integration and Netty archive integration — static JNI registration and linking.
  2. Elide native build configuration — native components and compiler configuration.
  3. Netty native transports, AWS-LC, and Elide Rust dependencies — networking, cryptography and codecs.
  4. LLVM ThinLTO — optimization across compatible bitcode inputs.
  5. Elide HTTP server — request dispatch and retained application handlers.
  6. Elide native entrypoint — engine invocation and isolate creation.
  7. Native Image memory management — collector selection and workload trade-offs.

Was this page helpful?