-
Notifications
You must be signed in to change notification settings - Fork 160
Embedding HashLink
Nicolas Cannasse edited this page Dec 7, 2017
·
3 revisions
HashLink can be easily embedded into any application to provide very fast scripting capabilities.
It consists in 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 initalized and control by main.c
which does the following:
- parse commandline 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 exception (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 you application.