Using Chez Scheme libraries with Racket CS?

244 views
Skip to first unread message

primer

unread,
Oct 9, 2020, 1:38:04 AM10/9/20
to Racket Users
I'm new to Racket and have not yet played with Racket CS.  My question is whether the Chez Scheme libraries are available.  For example, is it possible to do something like (require chezscheme) and then use (fork-thread ...) to create a native thread?

Matthew Flatt

unread,
Oct 9, 2020, 9:04:31 AM10/9/20
to primer, Racket Users
Yes and no.

Yes: The `ffi/unsafe/vm` library provides access to Chez Scheme's
`eval`, so you can use `(vm-eval '(fork-thread ...))`. Even more
directly, you can use the `ffi/unsafe/os-thread` library to create a
Chez Scheme thread.

No: Accessing Chez Scheme directly is unsafe, because you can break
Racket invariants, and there are some limitations on using Chez Scheme
functions in Racket and vice versa. See `vm-primitive` for more
information.


Matthew

primer

unread,
Oct 9, 2020, 10:21:31 AM10/9/20
to Racket Users
Great!  Thanks for the pointer to the docs.
Reply all
Reply to author
Forward
0 new messages