pocketlang/tests/native
Thakee Nathees bb588e9470 native interface refactored into slots.
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.
2022-04-24 09:56:27 +05:30
..
example1.c native interface refactored into slots. 2022-04-24 09:56:27 +05:30
example2.c error pretty print (print lines) implemented 2022-04-22 17:51:17 +05:30
README.md math module moved to cli/modules 2022-04-22 07:04:09 +05:30

Example on how to integrate pocket VM with in your application.

  • Including this example this repository contains several examples on how to integrate pocket VM with your application

    • These examples (currently 2 examples)
    • The cli/ application
    • The docs/try/main.c web assembly version of pocketlang
  • To integrate pocket VM in you project:

    • Just drag and drop the src/ directory in your project
    • Add all C files in the directory with your source files
    • Add src/include to the include path
    • Compile

example1.c - Contains how to pass values between pocket VM and C

gcc example1.c -o example1 ../../src/*.c -I../../src/include -lm

example2.c - Contains how to create your own custom native type in C

gcc example2.c -o example2 ../../src/*.c -I../../src/include -lm