The data structure that manages all data by converting it into a 32-bit ID for each fragment is one of Kawari's greatest features. Since the same ID is always given to the same data, various calculations at runtime are extremely fast, but the cost of reading the data is high (the cost of storing a single word is proportional to the search cost of std::map).
The Kawari data structure (dictionary) is a String-
In addition to a static global dictionary that is prepared for each Kawari engine, there are also dictionaries that are dynamically created and disposed of as so-called stack frames used for history references and temporary variables. In Kawari, this stack frame dictionary is called a "context."
In addition, once a string was ID'd, it was never deleted again up until Kawari 7, but Garbage Collection (GC) was introduced in Kawari 8. At the end of intermediate code evaluation, GC tests for IDs that have been deleted from the dictionary at least once during the evaluation. Because of the nature of equal data being the same ID, some IDs are referenced by more than one key, so all IDs to be deleted are checked to see if they are referenced by any other key.
wordcollection: Data IdentificationMost of the syntax commands are parsed at runtime and are therefore described in kawari_code.
KIS and so-called dialogues and words are treated in the same way as KIS intermediate code objects. Normal strings are "intermediate codes that return strings without side effects." KIS user functions are stored in ordinary entries with a special prefix in the function name. Therefore, although the dictionary notation and invocation methods are different, scripts and script scripts have the same storage format inside Hwashi.
kawari_code: Script, entry array callAlthough it is called a VM, it executes the syntax tree as is, so it is not a VM at all. The only thing the VM does is create and manage the context at the start of evaluation and when calling user functions. Even that consumes the native stack and calls it as is, so it can be said that the KIS stack is not properly managed.
TKawariEngine is the "Kawari Engine" object and is responsible for generating and managing other modules. Many of the KIS commands access Kawari functionality through Engine methods. If detailed control is required, obtain each module object from the Engine and manipulate it.
kawari_vm: Intermediate code execution