Re: [racket-users] Using Chez Scheme libraries with Racket CS?

2020-10-09 Thread primer
Great!  Thanks for the pointer to the docs.

On Friday, October 9, 2020 at 6:04:31 AM UTC-7 Matthew Flatt wrote:

> At Thu, 8 Oct 2020 22:38:04 -0700 (PDT), primer wrote:
> > 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?
>
> 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
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/ebf13112-638a-48f6-9c1a-9703c09abdean%40googlegroups.com.


Re: [racket-users] Using Chez Scheme libraries with Racket CS?

2020-10-09 Thread Matthew Flatt
At Thu, 8 Oct 2020 22:38:04 -0700 (PDT), primer wrote:
> 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?

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

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20201009070425.22d%40sirmail.smtps.cs.utah.edu.


[racket-users] Using Chez Scheme libraries with Racket CS?

2020-10-08 Thread primer
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?

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/92976a60-8304-45ef-a786-aabb29a1b0a1o%40googlegroups.com.