As of this commit there is only one method in the entier pocketlang
thats List.append() have added (the reset is todo).
method searching algorithm should be optimized in the future by
sorting the methods according to their names and do a binary search
This commit adds the builtin types to the VM's builtin classes
buffer (however no methods were added to those classes) and a super
class parameter introduced while creating a new class.
this is a part of the class implementation. In this commit classes
and instances type were completely cleaned and prepared for a new
implementation. Native class registering mechanism were fully refactored
and made it much simpler.
a buffer of classes for primitive types added to PKVM, but they'll
not be initialized in this commit.
names buffer and constant pool of a module are now merged (just like
java's constant pool).
VM's core libraries and scirpt modules are merged into a single
map name modules.
creating a new module doesn't register it automatically anymore,
you need to call pkRegisterModule(...) each time.
newModule() function refactored with a simpler interface, we're not
setting path or registering globals anymore, the caller is
responsible for that.
inorder to support tcc, I need to remove some math functions that
tcc on windows doesn't support (v language is using openlibm).
This is temproarly and the math functions should be moved to it's
own math script module once the import system is refactored.
TCC build tested with the binary downloaded from --
https://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27-win64-bin.zip
(download link from the https://bellard.org/tcc/ website), and this
should be added to the CI workflow.
now it's easier to re-use cli modules into another hosting
application and a little python script have added to generate
native api to support native extension library.
The exprName function re-defined into a cleanner way, and now it's
possible to override builtin functions, this will come in handy
to introduce upvalues.
for nested functions the count of locals and the required stack size
are miss-calculated, ie. No new count wasn't started for inner functions
it makes the required stack size greater than or equal to it's enclosing
functions stack size.
The name script is missleading as it only refering to the scripts
(the files that contain the statements) where as it could also
be the native module objects containing collection of native
functions.
After this commit, native functions can also have set owner module
and it won't be as confusing as before.
Since the functions and classes will be moved to the constants buffer
rather than having their own (function buffer and class buffer) the
rename is essential, and to make the refactoring process easier all the
intermediate steps are done with its own pr.
It's just the types that were added and only object creation
and garbage collection of that types are implemented, the
reset of the implementation is not part of this commit.