At Wed, 08 Jan 2020 12:10:24 +0100, Paulo Matos wrote:
> At the moment you cannot embed RacketCS using C.
> As you might have noticed
>
https://docs.racket-lang.org/inside/index.html
>
> only applies to CGC and 3m, not CS. Some work is needed to ensure this
> API (or a new one) works with RacketCS and I am sure this will be done
> one day but it hasn't happened yet.
>
> In terms of timelines or how much work is needed, Matthew is probably
> the person who can add more.
Racket CS will support embedding eventually. I expect that the C API
will be mostly Chez Scheme's C API and its allocation rules/conventions
--- which are completely different from the current Racket C API, but
simpler for most purposes.
The main work is sorting out a startup protocol and packaging a
library. Roughly, the packaging part means combining the Chez Scheme
kernel, the rktio library, and "boot.c"
https://github.com/racket/racket/blob/master/racket/src/cs/c/boot.c
into something reasonably convenient and consistent to link to, and
also sorting out header files. Embedding applications will need to
somehow deliver the Chez Scheme and Racket boot files to the "boot.c"
entry point (either as separate files or by adding them as an
ELF/Mach-O/PE section/resource). Finally, the current "boot.c" entry
point has lots of arguments, and they sometimes change:
https://github.com/racket/racket/blob/master/racket/src/cs/c/boot.h
So, a simpler and stable entry point is needed.
I'm not sure of the timeline, but not for v7.6, and not this week in
the development branch.