at this point only binary operators are implemented, unary are yet
to do.
getters and setters for native classes implemented with the names
@getter, and @setter (however the names or arity aren't validated
at the moment TODO:)
the function will create a fiber and execute the function, this is
a better abstracion for the host applicaion (createFiber, runFiber
are removed) and this will come in handy when it comes to execute
pocket functions inside a native function (it's required to
implement operator overloading).
this is necessare to make classes inherit from unknown
identifiers which are resolved at the runtime
and if we were to write the byte code to a file and run it, the globals
should be initialized at the runtime since there isn't any compile
time for them (pre compiled).
When parsing class and if there is an EOF it's not being marked
as an error which is a regression after the syntax error refactor
which is fixed.
Constructor of boolean class return C boolean instead of VAR_BOOL()
bug fixed
pkVar is removed and slots (like wren) are implemented for accessing or passing pocketlang values to C and vice versa. Yet all the slot related functions are callable at runtime (a fiber is associated with the VM) which needs to be refactored to allocate slots even if it's not runtime, to let users make use of the pocketlang values before or without running a function.
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.