DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

How do I create a desktop app that easily allow plugins?

Of course, the desktop app will be open sourced; but I don't want people to have to recompile, just to easily write a plugin.

An idea of mine is to use Deno (~15 MB) or NW.js (~100 MB) (and not sure about Electron), so that it can easily pick up the JavaScript code in a selected directory, and run on the fly, without compiling.

Python would be another idea, but I am not exactly sure how to...

Is there a better idea?

Top comments (4)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

I actually realized that at least Golang (via Otto) and Java (via Nashorn / GraalVM) can also parse JavaScript on the fly. Python is much less supported.

Of course, if I use Java, I can also parse JAR or JVM bytecode on the fly.

As for how I can make it, I can see two ways,

  • Serialized data (maybe JSON)
  • Hooks
 
patarapolw profile image
Pacharapol Withayasakpunt

I actually realized that Deno allows not only browser-compatible Javascript, but also Rust plugins.

Though, I don't feel it is production ready yet.

Collapse
 
vonheikemen profile image
Heiker

I feel like lua is good for that kind of thing, and it's seriously lightweight like 1MB light.

Collapse
 
zdev1official profile image
ZDev1Official

Use electron