* Re: Guile VM interpreter in GraalVM Truffle framework
2022-12-23 17:06 Guile VM interpreter in GraalVM Truffle framework Arvydas Silanskas
@ 2022-12-23 20:51 ` Maxime Devos
2022-12-24 0:42 ` Maxime Devos
2022-12-24 5:48 ` tomas
2022-12-24 13:10 ` Jean Abou Samra
1 sibling, 2 replies; 5+ messages in thread
From: Maxime Devos @ 2022-12-23 20:51 UTC (permalink / raw)
To: Arvydas Silanskas, guile-devel
[-- Attachment #1.1.1: Type: text/plain, Size: 1581 bytes --]
On 23-12-2022 18:06, Arvydas Silanskas wrote:
> Good day,
>
> I have aspirations to run scheme on graalvm's truffle framework. And on
> superficial research, it seems implementing a Guile VM bytecode
> interpreter could be easiest path. I just want to inquire, if someone
> already had similar ideas and in secrecy is working or planning to on
> this? If you're familiar with truffle (I'm not), any insights on "guile
> on graal" would also be welcome.
>
> Best regards
>
> Arvydas
Scheme has a notion of ephemerons and weak hash tables.
Java (last time I checked, which is quite some time ago) does not have a
notion of ephemerons. While it does have a notion of 'weak hash tables',
it is a different notion -- in the Scheme variant(*), the value is
neither a strong nor a weak reference, in the sense that if the key is
alive then the value is alive, but even if the value keeps a reference
to the key then the ephemeron (/ hash table entry) this does not imply
the key is alive when the ephemeron is alive (unlike if the key is weak
and the value is strong).
As (IIUC) GraalVM is a Java thing (and hence, no ephemerons),
consequently you can't implement (bug-free and without missing features)
Guile on top of GraalVM.
(*) Actually, Guile implements Java's kind of hash tables and doesn't
implement ephemerons, but that's a bug to be fixed with the new GC of
Guile that is being developed. At least, maybe the old hash tables are
kept, but IIUC we'll get access to the new kind of hash tables too.
Greetings,
Maxime.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Guile VM interpreter in GraalVM Truffle framework
2022-12-23 17:06 Guile VM interpreter in GraalVM Truffle framework Arvydas Silanskas
2022-12-23 20:51 ` Maxime Devos
@ 2022-12-24 13:10 ` Jean Abou Samra
1 sibling, 0 replies; 5+ messages in thread
From: Jean Abou Samra @ 2022-12-24 13:10 UTC (permalink / raw)
To: Arvydas Silanskas, guile-devel; +Cc: Maxime Devos, tomas
[-- Attachment #1.1: Type: text/plain, Size: 1059 bytes --]
Le 23/12/2022 à 18:06, Arvydas Silanskas a écrit :
> Good day,
>
> I have aspirations to run scheme on graalvm's truffle framework. And
> on superficial research, it seems implementing a Guile VM bytecode
> interpreter could be easiest path. I just want to inquire, if someone
> already had similar ideas and in secrecy is working or planning to on
> this? If you're familiar with truffle (I'm not), any insights on
> "guile on graal" would also be welcome.
I don't know anything about Truffle, but call/cc and delimited
continuations strike me as feature that could be hard to
implement on such a thing. At least, it seems so from
https://www.graalvm.org/latest/reference-manual/ruby/Compatibility/
On the other hand, upwards-only continuations, aka escape continuations,
which are just a different way to do exceptions, should be doable, so
you could probably ship a version of call/cc where the "cont" value in
(call/cc (lambda (cont) ...)) can only be used inside of the lambda.
Same for prompts.
Best,
Jean
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread