Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.
/ plugin-template Public archive

Sample project for building a Wipple interpreter plugin

Notifications You must be signed in to change notification settings

wipplelang/plugin-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wipple interpreter plugin template

You can use this repository as a template to create your own Wipple interpreter plugins, allowing you to define low-level functionality and access Rust and C code from Wipple.

Usage

  • Create your own repository from this template
  • Develop your plugin in src/lib.rs
  • Run build.sh to build a .wplplugin file

To use your plugin in a Wipple project, upload the generated plugin.zip somewhere and add it as a dependency to your project.wpl:

dependencies : {
    my-plugin : url "https://example.com/plugin.zip"
}

Alternatively, you can use the generated plugin.wplplugin directly using the plugin! function:

plugin! "path/to/plugin.wplplugin"

The plugin will be loaded directly into the current scope, so make sure to wrap it in a module if needed:

-- In src/lib.rs:
--
-- env.borrow_mut()
--     .set_variable("hello", Value::of(Text::new("Hello, world")));

plugin : {
    plugin! "path/to/plugin.wplplugin"
}

plugin hello -- Hello, world

About

Sample project for building a Wipple interpreter plugin

Resources

Stars

Watchers

Forks