Kalibri is squirrel fork which adds some improvements and features into the language
Features:
- Full unicode support. No wchars. Now you can rid of _SC("") and write code calmly without thinking about encoding. Squirrel itself converts it to
wchar_t
when interacting with Windows os and back tochar
when it finishes doing this, so unicode will work properly. - Scrat tools to bind symbols to the language.
- New
import
operator which allows you to import libraries
Uses C++ 17
Import operator:
You can use the new import
keyword to import modules:
import "mymodule"
What import
will do:
- Tries to load
mymodule
nut script file. Ifmymodule
nut script successfully loaded, executes the script and merges (if stackbase table is roottable) or replaces (if you use syntax likemod <- import "mymodule"
) root ormod
table with table with global variables, declared inmymodule
file. - Tries to load
mymodule.nut
script file. If successfully loaded, does the same as in first item. - Tries to load
mymodule.dll
. If successfully loaded, tries to loadsqmodule_load
function. If successfully loaded, calls thesqmodule_load()
.
In other situations throws error.
-
import
"folder/subfolder/module" - (?)
import
"folder/subfolder" (import all files in folder) - (?)
from
"folder/subfolder/module"import
symbol - stack dump from script
- module destruction
- write some sample libraries
- write tests for dll importing
- (?) export only specific table from
.nut
script module by globalreturn
operator - (?) export whole file root table if there is no global
return
- handle recursive import
- (?) manual module deload like
deimport
or something like that
(?) - I'm not sure if it's worth adding this