I want to give users the ability to create their own plug-ins for my applications. My current approach is to have the users create script text files, have them saved in a folder, then call the file and compile it when selected by the user. However, I was wondering, could these be precompiled as an external file, and saved as a plug-in?
I would look at who your customers are and what other scripting languages they might already be using.
For instance Lightroom uses Lua, while most long time Mac users are used to Apple Script.
I realize that supporting either of these two languages isn’t as simple as Xojo Script, but adopting things closer to what the user may already be using, will increase the likelihood of 3rd party plugins for your application as it will be easier for your end users.
If you have a few hundred lines of code, it only takes a few milliseconds. Even my 25000 line script framework with many classes takes less than 1 second. You can always encrypt the saved plugin files if you want to obfuscate the source code.
My 25k line script is a “framework” designed to give a comprehensive interface to my application by end-user-written scripts. I prepend it in front of the user’s script before compiling it. The user doesn’t know it’s there.