-
Notifications
You must be signed in to change notification settings - Fork 158
Embedding HashLink
Adrian Samoticha edited this page Jan 14, 2023
·
2 revisions
HashLink can be easily embedded into any application to provide very fast scripting capabilities.
It consists of separate parts:
-
libhl
is the HashLink runtime, that can be dynamically linked - HL boot, with its bytecode loader
code.c
, module initializermodule.c
, jit supportjit.c
, and (optional) debuggerdebugger.c
All of these are initialized and controlled by main.c
which does the following:
- parse command-line arguments
- load the
.hl
bytecode - initialize HL runtime
- allocate and initialize a module (jit the code)
- setup exception catching
- call module entry point (starts it)
- catch and print exceptions (if any)
You can see the full source for it here:
https://github.com/HaxeFoundation/hashlink/blob/master/src/main.c
You can read the C API Documentation for more details about how to integrate with your application.