this post was submitted on 30 Jul 2023
10 points (100.0% liked)
Programming
13212 readers
1 users here now
All things programming and coding related. Subcommunity of Technology.
This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I would definitely be concerned about the performance in this case, unless you can do some kind of AoT compilation of the scripts being executed (at least in production builds, development builds probably can't do that if you need hot reloading). Unfortunately the execution time budget is really tight if you want to get frequent updates and decent frame times (although if the system in question runs parallel to the rest of your systems, for example, then it might have more time to operate with).
That being said, with the interpreter pre-compiling those scripts, performance could still be really good. Sharing memory would become less relevant since your scripts would now operate on more than whatever's in your component storages and could now, in theory, work with variables local to the system, assuming you're meaning that the interpreter is called ad-hoc basically and isn't the entirety of the system.
This is all in theory of course, in practice you'd need to find an interpreter that supports pre-compiling (or at least pre-optimizing in some form) all the scripts you'll want to run if you want to maximize performance.
That was my assumption. Basically, that interpreter would have to run small snippets here and there typically on an irregular base. Thanks for reminding, I should probably clarify that as well.