[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Scheme-reports] R7RS small in R6RS library



Hi list,

I've just started a project that attempt to implement R7RS small
libraries in R6RS library form.

https://github.com/okuoku/r7rs-bridge
tl;dr: Isn't there any project like this?

It is FAR FROM complete but I'd love to share my current experience here..

[Overall Summary]

(scheme base)
- Not every R6RS implementation has SRFI-6 style buffered ports
(OPEN-OUTPUT-STRING and OPEN-OUTPUT-BYTEVECTOR).
I'd emulated that using weak hashtable but some R6RS implementation
also lacks weak references..
So if you're R6RS implementer, i'd like to advice you to provide
SRFI-6 style buffered ports.

- There is no sound way to implement CHAR-READY? and U8-READY?. R6RS
doesn't have this,
and some OS interface like standard-C or many POSIX like OS cannot
implement them simple, reliable and efficient enough.
(e.g. for Linux, you have to use O_NONBLOCK for every port because
select() and its friends doesn't guarantee non-blockness of fd.)

- R6RS doesn't have PORT-OPEN?

- Thanks to 3rd ballot #83, we can import (rnrs) based libraries and
(scheme base) based libraries at once.
So I think providing (scheme base) library in R6RS is not so bad
solution for R6RS => R7RS migration if people desired.

- I'd just ignored IMPORT which exported from (scheme base). It's not
procedure/syntax nor aux-syntax of any (scheme base) syntax.

(scheme repl), (scheme load)
- Many psyntax-based implementation provides INTERACTION-ENVIRONMENT.
LOAD may be implemented by using it.

[Implementation Notes]

== Racket ==

Racket cannot treat files without #!lang or #!r6rs as R6RS library. So
I couldn't implement r7rs-bridge on Racket.
(Isn't there any workaround to make r6rs as a "default" language?)

== chibi-scheme ==

- CASE doesn't have => form.
- SYNTAX-RULES cannot expand SRFI-46 letrec sample. Is there any
difference between R7RS and SRFI-46?

== Chez scheme ==

Doesn't have get-environment-variables.

== Sagittarius ==

Provides R7RS SYNTAX-RULES but it has same difference as chibi-scheme.

== nmosh ==

nmosh provides interaction-environment, but doesn't provide immutable
environments.
So every EVAL can mutate the environment(violates R7RS).

-- oku

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports