Smelltastic
Member
Hey, I don't often post around here but have been playing around with Mafia/ASH for a few months; forgive me if this has come up before but I didn't find anything in a search. I wanted to check here for any thoughts on the feasibility/usefulness of this to see if a feature request would be a good idea.
Everybody and their mother, assuming she plays KoL and uses Mafia, is using zlib and heading up all their ASH with it. Since zlib pulls its vars from a file, every single time any script is run it has to load this and go through its initializations again and again. Static variables have been implemented per this post, but I don't think zlib or other libraries could use them effectively because every script that imports it is a separate instance.
What I was thinking would be useful is to have a specified library script that's loaded on startup and every script is loaded within its single context. Ideally the user could specify a script that also contains import lines, then for any script then called that includes an import of one of the globally loaded scripts, that import would be ignored in favor of the preloaded instance.
There would be the problem of still having to reload the library(ies) if a change is made, which might make depending on static variables a problem.. so possibly globally loaded libraries would need to just not be reloaded, and require a restart of Mafia to update. Or maybe not, and statics should be written to disk if they're going to be relied on like that anyhow.
Thoughts on this, or anything I'm not considering that'd make it a terrible idea?
Everybody and their mother, assuming she plays KoL and uses Mafia, is using zlib and heading up all their ASH with it. Since zlib pulls its vars from a file, every single time any script is run it has to load this and go through its initializations again and again. Static variables have been implemented per this post, but I don't think zlib or other libraries could use them effectively because every script that imports it is a separate instance.
What I was thinking would be useful is to have a specified library script that's loaded on startup and every script is loaded within its single context. Ideally the user could specify a script that also contains import lines, then for any script then called that includes an import of one of the globally loaded scripts, that import would be ignored in favor of the preloaded instance.
There would be the problem of still having to reload the library(ies) if a change is made, which might make depending on static variables a problem.. so possibly globally loaded libraries would need to just not be reloaded, and require a restart of Mafia to update. Or maybe not, and statics should be written to disk if they're going to be relied on like that anyhow.
Thoughts on this, or anything I'm not considering that'd make it a terrible idea?