► |  | raco: Racket Command-Line Tools

1 | raco make: Compiling Source to Bytecode
2 | raco exe: Creating Stand-Alone Executables
3 | raco distribute: Sharing Stand-Alone Executables
4 | raco planet: Automatic Package Distribution
5 | raco pkg: Package Management
6 | raco setup: Installation Management
7 | raco decompile: Decompiling Bytecode
8 | raco demod: Demodularizing Programs
9 | raco link: Library Collection Links
10 | raco pack: Packing Library Collections
11 | raco unpack: Unpacking Library Collections
12 | raco ctool: Working with C Code
13 | raco test: Run tests
14 | raco docs: Documentation Search
15 | raco expand: Macro Expansion
16 | raco scribble: Building Documentation
17 | Adding a raco Command
18 | Installation Configuration and Search Paths

▼ | 12 | raco ctool: Working with C Code

12.1 | Compiling and Linking C Extensions
12.2 | Embedding Modules via C
12.3 | API for Raw Compilation

top ← prev up next →

#### 12.2`` Embedding Modules via C

The --c-mods mode for raco ctool takes a set of Racket modules and generates a C source file that can be used as part of program that embeds the Racket run-time system. See Embedding Racket into a Program in Inside: Racket C API for an explanation of embedding programs.

The generated source file embeds the specified modules, and it defines a declare_modules function that puts the module declarations into a namespace. Thus, using the output of raco ctool --c-mods, a program can embed Racket with a set of modules so that it does not need a "collects" directory to load modules at run time.

top ← prev up next →