MCPcopy Index your code
hub / github.com/dylibso/chicory

github.com/dylibso/chicory @1.7.5

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.7.5 ↗ · + Follow
3,398 symbols 13,138 edges 336 files 225 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Chicory

<img width="200" src="https://github.com/dylibso/chicory/raw/1.7.5/chicory1.png">

Website | Getting started | Blog | Contributing

Interpreter Test Results Compiler Test Results WASI Test Results

Zulip

Chicory is a JVM native WebAssembly runtime. It allows you to run WebAssembly programs with zero native dependencies or JNI. Chicory can run Wasm anywhere that the JVM can go. It is designed with simplicity and safety in mind.

Reach out to us: let us know what you are building with Chicory. Join our team Zulip chat with this invite link.

Get started now with the official documentation

Why?

There are a number of mature Wasm runtimes to choose from to execute a Wasm module. To name a few v8, wasmtime, wasmer, wasmedge, wazero etc.

Although these can be great choices for running a Wasm application, embedding them into your existing Java application has some downsides. Because these runtimes are written in C/C++/Rust/etc, they must be distributed and run as native code. This causes two main friction points:

1. Distribution

If you're distributing a Java library (jar, war, etc), you must now distribute along with it a native object targeting the correct architecture and operating system. This matrix can become quite large. This eliminates a lot of the simplicity and original benefit of shipping Java code.

2. Runtime

At runtime, you must use FFI to execute the module. While there might be performance benefits to doing this for some modules, when you do, you're effectively escaping the safety and observability of the JVM. Having a pure JVM runtime means all your security and memory guarantees, and your tools, can stay in place.

Goals

  • Be as safe as possible
  • In that we are willing to sacrifice things like performance for safety and simplicity
  • Make it easy to run Wasm in any JVM environment without native code, including very restrictive environments.
  • Fully support the core Wasm spec
  • Make integration with Java (and other host languages) easy and idiomatic.

Non-Goals:

  • Be a standalone runtime
  • Be the fastest runtime
  • Be the right choice for every JVM project

Roadmap

Chicory development was started in September 2023. The following are the milestones we're aiming for. These are subject to change but represent our best guesses with current information. These are not necessarily sequential and some may be happening in parallel. Unless specified, any unchecked box is still not planned or started. If you have an interest in working on any of these please reach out in Zulip!

2023

  • [x] Wasm binary parser
  • [x] Simple bytecode interpreter
  • [x] Establish basic coding and testing patterns
  • [x] Generate JUnit tests from wasm test suite

2024

  • [x] Make all tests green with the interpreter (important for correctness)
  • [x] Implement validation logic (important for safety)
  • [x] Draft of the v1.0 API (important for stability and dx)
  • [x] Decouple interpreter and create separate compiler and interpreter "engines"
  • [x] Proof of concept AOT compiler (run some subset of modules)
  • [x] AOT engine passes all the same specs as interpreter (stretch goal)
  • [x] WASIp1 Support (including test gen)
  • Read more details in the documentation

2025

  • [x] SIMD Support
  • in the interpreter
  • [x] Tail Call
  • in the interpreter(and compiler**)
  • [x] Compiler out of experimental
  • [x] Exception Handling
  • [x] Threads Support
  • [x] Extended Constant Expressions

2026

  • [x] GC support
  • [x] Multi-Memory Support
  • [ ] Performance

On the press

Prior Art

Who uses Chicory?

Meet the Team

📅 Chicory Office Hours, every Tuesdays, 16:00–16:30 UTC (09:00–09:30 PT · 12:00–12:30 ET · 18:00–18:30 CET). The link will be shared in the Zulip chat each week. Let’s talk Chicory!

Extension points exported contracts — how you extend this code

ImportValue (Interface)
An external value is the runtime representation of an entity that can be imported. It is an address denoting eith [10 …
runtime/src/main/java/com/dylibso/chicory/runtime/ImportValue.java
Cache (Interface)
(no doc) [8 implementers]
compiler/src/main/java/com/dylibso/chicory/compiler/Cache.java
Failable (Interface)
(no doc) [4 implementers]
compiler-tests/src/test/java/com/dylibso/chicory/testing/InterpreterFallbackTest.java
Logger (Interface)
(no doc) [2 implementers]
log/src/main/java/com/dylibso/chicory/log/Logger.java
ParserListener (Interface)
(no doc) [1 implementers]
wasm/src/main/java/com/dylibso/chicory/wasm/ParserListener.java
WasmGcRef (Interface)
Marker interface for WasmGC heap objects (structs and arrays). [12 implementers]
runtime/src/main/java/com/dylibso/chicory/runtime/WasmGcRef.java
ClassCollector (Interface)
A class collector exposes methods to resolve class files from the classpath and collecting bytes representing classes. < [4 …
compiler/src/main/java/com/dylibso/chicory/compiler/internal/ClassCollector.java
MemAllocStrategy (Interface)
Strategy for allocating memory buffers. @deprecated Memory is now allocated by page (64KB each), so custom allocation [4 …
runtime/src/main/java/com/dylibso/chicory/runtime/alloc/MemAllocStrategy.java

Core symbols most depended-on inside this repo

pop
called by 539
runtime/src/main/java/com/dylibso/chicory/runtime/MStack.java
of
called by 356
wasm/src/main/java/com/dylibso/chicory/wasm/types/FunctionType.java
push
called by 342
runtime/src/main/java/com/dylibso/chicory/runtime/MStack.java
get
called by 318
compiler/src/main/java/com/dylibso/chicory/compiler/Cache.java
get
called by 253
runtime/src/main/java/com/dylibso/chicory/runtime/InterpreterMachine.java
apply
called by 226
runtime/src/main/java/com/dylibso/chicory/runtime/MemCopyWorkaround.java
wasiResult
called by 220
wasi/src/main/java/com/dylibso/chicory/wasi/WasiPreview1.java
intrinsic
called by 201
compiler/src/main/java/com/dylibso/chicory/compiler/internal/Emitters.java

Shape

Method 2,975
Class 342
Function 35
Interface 26
Enum 20

Languages

Java99%
Rust1%
Kotlin1%
C1%
TypeScript1%
Go1%

Modules by API surface

runtime/src/main/java/com/dylibso/chicory/runtime/InterpreterMachine.java268 symbols
compiler/src/main/java/com/dylibso/chicory/compiler/internal/Emitters.java218 symbols
compiler/src/main/java/com/dylibso/chicory/compiler/internal/Shaded.java145 symbols
runtime/src/main/java/com/dylibso/chicory/runtime/OpcodeImpl.java113 symbols
simd/src/main/java/com/dylibso/chicory/simd/SimdInterpreterMachine.java106 symbols
runtime/src/main/java/com/dylibso/chicory/runtime/ByteArrayMemory.java81 symbols
wasi/src/main/java/com/dylibso/chicory/wasi/WasiPreview1.java78 symbols
runtime/src/main/java/com/dylibso/chicory/runtime/Memory.java78 symbols
wasm/src/main/java/com/dylibso/chicory/wasm/Validator.java68 symbols
runtime/src/main/java/com/dylibso/chicory/runtime/Instance.java67 symbols
wasm/src/main/java/com/dylibso/chicory/wasm/Parser.java50 symbols
wasm/src/main/java/com/dylibso/chicory/wasm/types/ValType.java48 symbols

For agents

$ claude mcp add chicory \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact