From 0726de34ff0b2765d32c064809ced9fae996bd51 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Thu, 24 Jan 2019 10:16:24 -0500 Subject: [PATCH] Add description of embedding to README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 5068b8a5..da95e482 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ Janet makes a good system scripting language, or a language to embed in other pr * REPL * Parsing Expression Grammars built in to the core library * 300+ functions and macros in the core library +* Embedding Janet in other programs * Interactive environment with detailed stack traces ## Documentation @@ -108,6 +109,18 @@ Options are: $ ``` +## Embedding + +The C API for Janet is not yet documented but coming soon. + +Janet can be embedded in a host program very easily. There is a make target `make amalg` +which creates the file `build/janet.c`, which is a single C file that contains all the source +to Janet. This file, along with `src/include/janet/janet.h` can dragged into any C project +and compiled into the project. Janet should be compiled with `-std=c99` on most compilers, and +will need to be linked to the math library, `-lm`, and the dynamic linker, `-ldl`, if one wants +to be able to load dynamic modules. If there is no need for dynamic modules, add the define +`-DJANET_NO_DYNAMIC_MODULES` to the compiler options. + ## Compiling and Running Janet only uses Make and batch files to compile on Posix and windows