MatthiasGrandl / Loungy

Loungy is a WIP launcher in the vein of Spotlight, Alfred, Raycast.
MIT License
1.44k stars 70 forks source link

Plugin support #3

Open srid opened 7 months ago

srid commented 7 months ago

Congrats on open sourcing what appears to be a viable open source alternative to Raycast!

Mostly as a learning/hobby project. It isn't (yet) intended to be used outside of experimentation. I got the idea while writing a Raycast plugin and getting frustrated with their limitations.

If you ever wish to take this beyond a personal hobby project, it would be great to add support for user-written plugins. How about Rust WASM (in addition to whatever friendlier way to write plugins)?

MatthiasGrandl commented 7 months ago

Jup for sure worth exploring. I definitely need more time to flesh out how things are going to work before thinking about making things more complicated by implementing a plugin system which would require some stable API...

uncenter commented 7 months ago

Wow yeah this is amazing. I'm new to Rust and wouldn't be of much help in developing a plugin system but I want to second that idea, there is definitely a lot of interest in moving away from Raycast for me and for many others!

srid commented 7 months ago

@MatthiasGrandl This quite looks interesting for wasm plugin support: https://extism.org/

arlyon commented 6 months ago

I would recommend instead just going for web assembly components. I have a project I have been hacking on to test them and you simply define an interface in their IDL (wit) and then use their bindgen tools to generate rust interfaces to implement.

https://github.com/arlyon/litehouse/blob/main/crates/plugin-macro/wit/plugin.wit

MatthiasGrandl commented 6 months ago

@arlyon do you have some recommended resources to read up on webassembly components? It does sound like a good fit.

arlyon commented 6 months ago

There is a bunch of scattered work but it is still quite new (though capable) so it takes a bit of digging sometimes. I want to stress it is very early days still but already quite functional.

The really nice thing with wit is being able to expose host apis to plugins (such as networking, the filesystem, or any other arbitrary functions). if you don't want to give a plugin network access it can't have it, and they are pretty lightweight since they can share the http stack with the host.

MatthiasGrandl commented 1 month ago

i started workng on this using webassembly components! It's quite a huge refactor, but I am optimistic that it will improve the code base a lot.

wiiznokes commented 1 month ago

Have you heard of https://github.com/pop-os/launcher. Just using stdout can be remarkably simple. Also, would the new plugin system allow to write custom frontend ?

MatthiasGrandl commented 1 month ago

@wiiznokes nope. it would just expose an API to build new views with existing components. Exposing a way to build custom components would be nice, but very hard (if not impossible) within the constraints of what's possible with webassembly components.

Tbh that's where Raycast has a huge advantage, being able import javascript/typescript modules with React components.

wiiznokes commented 1 month ago

Yeah, but sadly, I think it's close to impossible for rust to do this