Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miniz for Extism

This repo shows how you can convert a normal C library to an Extism Plugin. miniz is a minimal compression library.

Try it out

  1. Fetch all submodules
git submodule update --init --recursive
  1. Download WASI SDK
cd dependencies/extism-pdk
./install-wasi-sdk.sh

This downloads WASI SDK to dependencies/extism-pdk/wasi-sdk.

  1. Build
cd plugin
mkdir build
cd build
cmake cmake -D CMAKE_C_COMPILER=$(pwd)/../../dependencies/extism-pdk/wasi-sdk/bin/clang ..
make

Now you should be able to find a miniz_extism.wasm in plugin/build.

  1. Test
cd host
go run .

You should get an output similar to this:

PS D:\x\wasm\miniz_extism\host> go run .
Original data: Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!
Original data len: 69
Compressed data len: 39
Decompressed data: Hello, World! Hello, World! Hello, World! Hello, World! Hello, World!

Demo

About

A small demo of how you can turn a C library into an Extism Plugin

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages