It's not impossible. We've done this right in the beginning, before Simba ever went public. You could compile scripts to .exe's. The reason we dropped it back then was to have backwards compatibility and because interpreting is a lot user friendlier.
That said, the main reason we don't have this is security and maintainability.
The benefits of binaries are:
- Can run standalone.
- Possibly more simple to use.
Downsides:
- Not easy to validate code for safety.
- Not dynamic. This is important. Now, if there is a SRL update, you'll simply let Simba update your SRL. You click run and you're using the latest SRL. This isn't the case with your executable. You'll have to rebuild it. Note that obviously the interpreter rebuilds SRL too, but it does this every time you run the script. IOW, every script update, every SRL update, you'll have to rebuild the .exe.
- External dependencies could be annoying.
- Architecture dependent. (Not really an issue)
Note that I currently assumed that you meant just having a button ``Convert script to exe''. This also means you'll be using Simba's interpreter in the .exe.
You can do this in some way, Sythe did it once with a very nasty hack. (He basically just included the scar binary in his .exe)
Perhaps we can create a tool that will create a .exe, use the right simba libraries and add the interpreter to it.
There's another possibility, though… If you would use a proper compiler like FPC, you'd have these advantages:
- Speed
- Access to a lot of extra units and libraries.
But this would mean you can't use SRL in it's current form.
But you can use Simba!Simba due to it's open sourceness already gives you the ability to directly use all the features / units we have built in your own executables. I've already created some small executable tools that use exactly this. So essentially, you can already create binaries with Simba. If I recall correctly SPS uses the Simba units as well, for example. But this area could use a lot more documentation and is quite useless for runescape purposes since you can't use SRL with it.