[CM] R7RS support
mike at eggheadgames.com
mike at eggheadgames.com
Mon Jan 17 15:01:51 PST 2022
Thanks Iain, great observations and info. Yes, we’ve read s7.html many
times and will continue to do so. There’s a lot of great info there!
(We’ve found many of the included scm files are also good sources
too.)
FYI, we’re looking at adopting R7RS more as a future-proofing strategy
than “we need every single feature and exact compatibility”. Having
successfully shipped some basic functionality on iOS as a
proof-of-concept, we’re stepping back and tweaking our development
environment & tooling. Currently we’re attempting to run our code with
Guile and its R7RS libraries, in part to take advantage of the nice
tooling in Geiser in Emacs. The goal is to have our integration & unit
tests run in both s7 and Guile (and/or other R7RS-compatible Schemes)
with minimal shim layers. If we can keep the ease of embedding, small
size and performance of s7 for mobile while doing this, then dare I say
we’ll have our cake and eat it too? :)
Cheers, Michael
On 17 Jan 2022, at 23:52, Iain Duncan wrote:
> Hi Rudolf, Bill would be the person to address this better than me,
> but I
> think the Egghead team should read through the s7.html page pretty
> closely
> to see if s7 is a good fit. It's pretty clear in there that there is
> *limited* R7RS compatibility, but that s7 is not R7RS and nor is that
> a
> stated goal. For example, s7 does not do macros with syntax-case or
> syntax-rules, but uses CL style macros. If R7RS is what you need, you
> might
> be better off with an implementation that makes that a goal, such as
> Chibi.
> I use s7 embedded in audio programs, which shares a fair bit of domain
> space with games, and I personally chose s7 because the performance
> and
> ease of embedding made up for that, but YMMV!
>
> HTH
> iain
>
> On Mon, Jan 17, 2022 at 7:36 AM Rudolf Adamkovič <salutis at me.com>
> wrote:
>
>> Hi there!
>>
>> At Egghead Games, we would like to use Scheme for in-app scripting.
>> We
>> wired up s7 and SQLite to kick things off, but s7 support for R7RS
>> does
>> not seem to work. Below, I include some examples to illustrate my
>> point.
>>
>> A basic example from the R7RS standard, page 54, …
>>
>> (with-exception-handler
>> (lambda (x)
>> (display "something went wrong\n"))
>> (lambda ()
>> (+ 1 (raise ’an-error))))
>>
>> … results in:
>>
>>> Error: catch error handler should accept two arguments: #<lambda
>>> (x)>
>>
>> The simplest library …
>>
>> (load "r7rs.scm")
>> (define-library (some lib)
>> (export some-proc)
>> (import (scheme base)
>> (scheme r5rs))
>> (begin
>> (define (some-proc x)
>> (display x))))
>>
>> … results in:
>>
>>> Error: symbol->value first argument, {gensym}-1, is a macro but
>>> should
>>> be a symbol (define-macro ({gensym}-1 . names)...
>>
>> We picked s7 because the website says …
>>
>>> I believe it is compatible with r5rs and r7r
>>
>> … but per a quick grep, there seem to exist no tests for
>> define-library
>> or with-exception-handler.
>>
>> Any ideas?
>>
>> Rudy
>> --
>> "Logic is a science of the necessary laws of thought, without which
>> no
>> employment of the understanding and the reason takes place." --
>> Immanuel
>> Kant, 1785
>>
>> Rudolf Adamkovič <salutis at me.com> [he/him]
>> Studenohorská 25
>> 84103 Bratislava
>> Slovakia
>>
>> _______________________________________________
>> Cmdist mailing list
>> Cmdist at ccrma.stanford.edu
>> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
>>
> _______________________________________________
> Cmdist mailing list
> Cmdist at ccrma.stanford.edu
> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20220118/f373f46d/attachment.html>
More information about the Cmdist
mailing list