{"size": 1589, "ext": "scrbl", "max_stars_repo_path": "share/pkgs/racket-doc/scribblings/inside/inside.scrbl", "max_stars_repo_name": "takikawa/racket-ppa", "max_stars_repo_stars_event_min_datetime": "2018-07-29T04:13:52.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T16:11:17.000Z", "max_issues_repo_path": "share/pkgs/racket-doc/scribblings/inside/inside.scrbl", "max_issues_repo_name": "takikawa/racket-ppa", "max_issues_repo_issues_event_min_datetime": "2017-08-25T20:26:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T17:48:40.000Z", "max_forks_repo_path": "share/pkgs/racket-doc/scribblings/inside/inside.scrbl", "max_forks_repo_name": "takikawa/racket-ppa", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 10, "max_issues_count": 15, "max_forks_count": null, "avg_line_length": 37.8333333333, "max_line_length": 75, "alphanum_fraction": 0.7136563877}
#lang scribble/doc
@(require "utils.rkt")

@title[#:tag-prefix '(lib "scribblings/inside/inside.scrbl") 
       #:tag "top"]{Inside: Racket C API}

@author["Matthew Flatt"]

The Racket runtime system is responsible for the implementation of
primitive datatypes such as numbers and strings, the macro expansion
and compilation of Racket from source, the allocation and reclamation
of memory used during evaluation, and the scheduling of concurrent
threads and parallel tasks.

This manual describes the C interface of Racket's runtime system,
which varies depending on the implementation of Racket (see
@secref[#:doc '(lib "scribblings/guide/guide.scrbl")
"virtual-machines"]): the CS implementation of Racket has one
interface, while the BC (3m and CGC) implementation of Racket has
another.

The C interface is relevant to some degree when interacting with
foreign libraries as described in @other-manual['(lib
"scribblings/foreign/foreign.scrbl")]. Even though interactions with
foreign code are constructed in pure Racket using the
@racketmodname[ffi/unsafe] module, many details of representations,
memory management, and concurrency are described here. This manual
also describes embedding the Racket run-time system in larger programs
and extending Racket directly with C-implemented libraries.

@table-of-contents[]

@; ------------------------------------------------------------------------

@include-section["cs.scrbl"]
@include-section["bc.scrbl"]
@include-section["appendix.scrbl"]

@; ------------------------------------------------------------------------

@index-section[]
