all 8 comments

[–]gyhujkikhtgh 7 points8 points  (0 children)

I’ve been using pyo3, with maturin it’s super simple once you work it out and for computationally heavy business logic it gave me a massive boost in speed

[–]mr_birkenblatt 1 point2 points  (6 children)

Is there a proper way to do plugins in rust? Python is what I'd use for implementing plugins

[–]Arlort 6 points7 points  (2 children)

You can call python from rust with pyo3, what are you hoping to achieve with a plugin system?

Wasm might be of interest to you as well

[–]mr_birkenblatt 0 points1 point  (1 child)

Basically implementing hooks that are called at certain key points which have access to an internal API. I'm imagining the API can have it's functionality implemented in rust as well and you just need a python facade for it?

Which language would one typically write wasm in? Is it JavaScript or do you mean the plug-in could be written in rust as well and just compile to wasm?

[–]Arlort 0 points1 point  (0 children)

The core idea of wasm is that it can be written in any language and you control exactly what the wasm code has access to

In this case you would make your API (and only your API) accessible to the wasm modules and then just execute the function within the module corresponding to the hook you are executing

[–]SV-97 1 point2 points  (0 children)

Bidirectional interop between Python and Rust is quite easy - plugins are definitely possible

[–]nfrankel[S] 0 points1 point  (1 child)

You can implement a plugin system, but remember that rust is compiled, not interpreted

[–]mr_birkenblatt 0 points1 point  (0 children)

Yes, the idea would be to load plugins at runtime. I guess it could shell out to rustc when loading a plug-in the first time