koka-lang / libmprompt

Robust multi-prompt delimited control and effect handlers in C/C++
MIT License
104 stars 11 forks source link

Rust Bindings #1

Open SchrodingerZhu opened 3 years ago

SchrodingerZhu commented 3 years ago

I have been working on schrodingerzhu/libmprompt-sys. The async_workers example is already working there.

Any idea on higher-level wrappers?

daanx commented 3 years ago

Ah very cool :-) and great to see it works! This is the advantage of libmprompt that it integrates at a deep level that should make it quite seamless to integrate.

The multi-prompt interface is rather low-level, it would be better to expose algebraic effect handlers on top of that -- you could probably bind to libmpeff instead ? and use lambdas or virtual methods for the operations in a handler? Would be very cool to build effect handlers this way in Rust -- although one probably needs something special for multi-shot resumptions.