Skip to content

A Quarkus extension to easily integrate Chicory(WASM runtime) in your applications

License

Notifications You must be signed in to change notification settings

quarkiverse/quarkus-chicory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quarkus Chicory

Version

Overview

Quarkus Chicory integrates the Chicory WebAssembly runtime with Quarkus, enabling seamless execution of WebAssembly modules within Java applications.

The extension provides environment-aware WebAssembly module management through CDI injection, with automatic optimization for development, production, and native image deployments.

A QR code generation quick demo!

Key Features

  • Injectable WebAssembly Context - Access WASM context via CDI with @Inject and @Named
  • Environment-Optimized Execution - Automatic selection of interpreter, runtime compiler, or build-time compilation based on execution context
  • Multi-Module Support - Configure and manage multiple independent WASM modules
  • Build-Time Code Generation - Build-time compilation of WASM to JVM bytecode for optimal performance
  • Live Reload - Automatic module recompilation in development mode when WASM files change
  • WASI Support - Integrates Chicory WebAssembly System Interface implementation
  • Native Image Compatible - First-class support for GraalVM native images

Quick Start

Add the extension to your project:

<dependency>
    <groupId>io.quarkiverse.chicory</groupId>
    <artifactId>quarkus-chicory</artifactId>
    <version>${quarkus-chicory.version}</version>
</dependency>

Configure a WASM module in application.properties:

quarkus.chicory.modules.my-module.wasm-file=src/main/resources/my-module.wasm

Inject and use in your application:

@Inject
@Named("my-module")
WasmQuarkusContext wasmContext;

@PostConstruct
void init() {
    Instance instance = Instance.builder(wasmContext.getWasmModule())
        .withMachineFactory(wasmContext.getMachineFactory())
        .build();

    ExportFunction add = instance.export("add");
    long[] result = add.apply(40, 2);
}

Documentation

For comprehensive documentation, configuration options, and advanced usage examples, see the full documentation.

Contributing

Contributions are welcome! Please refer to the Quarkiverse contribution guidelines for more information.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

A Quarkus extension to easily integrate Chicory(WASM runtime) in your applications

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •