bi0qaw / skript-three-features

A list of features/ideas for skript three
0 stars 0 forks source link

Variables #7

Open bi0qaw opened 4 years ago

bi0qaw commented 4 years ago

Variables should be easy to use/understand, add as little verbosity as possible, efficient and predictable.

I wrote down a couple of thoughts in variable.md. Feel free to add any comments here.

Note about efficiency/implementation: I think we can get away with just using LinkedHashMaps for variables. Maybe a wrapper is required that decides whether something should be stored as an array (list that only contains integer indices from 1 to length of list) or a hashmap (anything that is not an array) and when to convert the array to a hashmap (when an index outside of the array dimension is added).

APickledWalrus commented 4 years ago

Variables also are in need of an upgrade storage-system wise.

The current variable storage options should be improve. Better MySQL support is needed, and support for H2 storage would also be nice. YAML could be something to explore, as some users may find it easier to edit if needed then the current options.

bensku commented 4 years ago

LinkedHashMap is not great for huge lists, I would go (and did already go with Skript's variables rework) with a wrapper over real container types.

I'm not sure if storing variables in an SQL database is a good idea, because there is unlikely to be any schema we can use for it. A more efficient and reliable file-based storage backend is in works. Storing some variables in YAML/JSON files in a directory shouldn't be too hard either, and might be very useful.