k/x/embed
n fa98c925b1 x/embed 2023-05-31 18:53:49 +03:00
..
a.c x/embed 2023-05-31 18:53:49 +03:00
a.py . 2022-05-02 14:21:13 +03:00
makefile fix static + example 2023-05-18 19:40:00 +01:00
readme.txt Add example of registering foreign functions into the REPL. Make link options easier to modify. 2022-09-12 09:11:44 +02:00

readme.txt

Running make in this directory will build and run an executable which embeds the K, interpretter,
installs a function and then calls that installed function.

To dynamically load foreign functions into the K repl, run make liba.so in this directory and run
the REPL with LD_PRELOAD set to that library.

Note for linux, you'll also need to make the
symbols in the REPL dynamic so they can be called from the library.  Add -rdynamic to the end of the
lopts file and rebuild the REPL.

If you're building a target other than the default you'll likely need to build a libk-<target>.so
for that target and adjust the makefile accordingly.