Coder Social home page Coder Social logo

c-pdk's People

Contributors

g4vi avatar nilslice avatar zshipko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

wasmlabx

c-pdk's Issues

Seperate ExtismPointer from handle

ExtismPointer can currently refers to three different things:

  • a pointer in extism memory
  • an offset in input memory
  • a pointer in extism memory to the start of data in a memory block

By introducing a new type ExtismHandle for the last item, the api can be made easier to use correctly.

  • Add new type to header ExtismHandle
  • Get all tests and examples running.
  • Update docs
  • Make extism length fast again.

PR: #18

Bloat when using the pdk in multiple files

It's nice having the extism pdk as a single header. However, the non-imported functions have to be declared static to avoid multiple definitions errors if the pdk is used in multiple c files. This could potentially lead to several copies of the pdk being present in the output wasm.

To keep the PDK as a single header library, but avoid building multiple implementations I think we should follow the model used by projects such as miniaudio.

Protect the implementations with a macro and require in one compilation unit:

#define EXTISM_IMPLEMENTATION
#include "extism-pdk.h"

In all other source files using the pdk, just #include "extism-pdk.h" as you did before.

header improvements

  • namespace IMPORT
  • extism_store take const void pointer instead
  • add extism_alloc_buf
  • rework / rethink extism_alloc_string
  • Improve ergonomics and safety of passing strings in general

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.