[R6RS] Core/library split

Michael Sperber sperber at informatik.uni-tuebingen.de
Sun Aug 13 04:57:50 EDT 2006


These are (some of) my positions on the core/library split issue, in
preparation for Thursday's call.  Long note.  Sorry.

Core language vs. base libraries
================================

First off, I'm increasingly uncomfortable with the term "core
language" as it usually does suggest some "semantic core" as opposed
to something "minimally useful," which is what we've been doing.  A
semantic core will show up in the report as a basis for the formal
semantics, but I expect it won't be very useful as, say, a library one
could import.  I suggest the term "base language" or "base library"
for what we're doing.  I'll use "base library" for this note to
distinguish it from "core language." 

The term "base library" is still ambiguous, as Anton's proposal has
several libraries that fit the description.  I think there are too
many of them, and this has confused the discussion in the past, as I
now realize reading Anton's files more closely.  The one that I would
like to see as the "base library" is somewhere between Anton's
`r6rs-small' and `r6rs' libraries; rationale below.  The concept of
lumping everything R6RS into a "r6rs-big" library seems OK, but would
not be useful to me personally.  Base libraries other than those
confuse more than they help, I think.

The base library is different from the core language because some
features that are part of the semantic core we've decided to keep in
separate libraries.  Foremost, it's `set-car!' and `set-cdr!', but
there's also the exceptions and, depending on your point of view,
aspects of the conditions and records that creep in.  (For records,
it's mainly the ability to create new disjoint types which a base
without records doesn't give you directly.  Primitives raise
exceptions, so they need to be in there too, and some way to specify
the condition objects involved.  Also, what to do about `eval'?)

What the base language should be
================================

IMHO, the base language should have properties similar to R5RS, namely
a language that can be quickly explained and understood in its
entirety, and can be used to write sensible, complete if somewhat
academic programs.  (Side note: A number of people I've talked to
recently, including Martin Gasbichler and Jonathan Rees, are worried
this property is getting lost in the transition from R5RS and R6RS.  I
agree with them that it's important.)
R5RS fell down in this mostly because it didn't give the programmer
the ability to "signal an error," so this should be fixed by adding
`error' and `contract-violation' procedures.

As compared to Anton's list, there are the following changes:
- removed the parts that are in the read syntax, not the library
- set-car!/set-cdr! removed, as decided
- removed the direct access to conditions and exceptions (too
  much stuff and too heavyweight for easy explanation)
- added error, violation, contract-violation
- removed dynamic-wind and call/cc (issue; see below)
- added syntax-rules (issue; see below)

Two issues are immediately apparent:
- I've added syntax-rules, as define-syntax & friends have zero
  usefulness without them.  (Debatable; I could live with syntax-rules
  being in a separate library.)
- I've moved dynamic-wind and call/cc to a separate library.  This
  seems congruent with moving out but not deprecating
  set-car!/set-cdr!.  (Also no big deal for me personally.)

(I'm sure I made some errors writing the list, but I hope the basic
intentions are clear.)

-- 
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
-------------- next part --------------
((r6rs base)
  (* procedure)
  (+ procedure)
  (- procedure)
  (->exact procedure)
  (->inexact procedure)
  (/ procedure)
  (< procedure)
  (<= procedure)
  (= procedure)
  (> procedure)
  (>= procedure)
  (abs procedure)
  (acos procedure)
  (and syntax)
  (angle procedure)
  (append procedure)
  (apply procedure)
  (asin procedure)
  (atan procedure)
  (begin syntax)
  (boolean? procedure)
  (caar procedure)
  (cadr procedure)
  (call-with-values procedure)
  (car procedure)
  (case syntax)
  (cdddar procedure)
  (cddddr procedure)
  (cdr procedure)
  (ceiling procedure)
  (char->integer procedure)
  (char<=? procedure)
  (char<? procedure)
  (char=? procedure)
  (char>=? procedure)
  (char>? procedure)
  (char? procedure)
  (complex? procedure)
  (cond syntax)
  (condition procedure)
  (condition-has-type? procedure)
  (condition-ref procedure)
  (condition-type? procedure)
  (condition? procedure)
  (cons procedure)
  (contract-violation procedure)
  (cos procedure)
  (define syntax)
  (define-condition-type procedure)
  (define-syntax syntax)
  (denominator procedure)
  (div procedure)
  (div+mod procedure)
  (div0 procedure)
  (div0+mod0 procedure)
  (do syntax)
  (eof-object procedure)
  (eof-object? procedure)
  (eq? procedure)
  (equal? procedure)
  (eqv? procedure)      
  (error procedure)
  (even? procedure)
  (exact? procedure)
  (exp procedure)
  (expt procedure)
  (finite? procedure)
  (floor procedure)
  (for-each procedure)
  (gcd procedure)
  (guard procedure)
  (if syntax)
  (imag-part procedure)
  (inexact? procedure)
  (infinite? procedure)
  (integer->char procedure)
  (integer-valued? procedure)
  (integer? procedure)
  (lambda syntax)
  (lcm procedure)
  (length procedure)
  (let syntax)
  (let* syntax)
  (let*-values syntax)
  (let-syntax syntax)
  (let-values syntax)
  (letrec syntax)
  (letrec* syntax)
  (letrec-syntax syntax)
  (letrec-values syntax)
  (library syntax)
  (list procedure)
  (list->string procedure)
  (list->vector procedure)
  (list-ref procedure)
  (list-tail procedure)
  (list? procedure)
  (log procedure)
  (magnitude procedure)
  (make-polar procedure)
  (make-rectangular procedure)
  (make-string procedure)
  (make-vector procedure)
  (map procedure)
  (max procedure)
  (min procedure)
  (mod procedure)
  (mod0 procedure)
  (nan? procedure)
  (negative? procedure)
  (not procedure)
  (null? procedure)
  (number->string procedure)
  (number? procedure)
  (numerator procedure)
  (odd? procedure)
  (or syntax)
  (pair? procedure)
  (positive? procedure)
  (procedure? procedure)
  (quasiquote syntax)
  (quote syntax)
  (raise procedure)
  (raise-continuable procedure)
  (rational-valued? procedure)
  (rational? procedure)
  (rationalize procedure)
  (real->flonum procedure)
  (real-part procedure)
  (real-valued? procedure)
  (real? procedure)
  (reverse procedure)
  (round procedure)
  (set! syntax)
  (sin procedure)
  (sqrt procedure)
  (string procedure)
  (string->list procedure)
  (string->number procedure)
  (string->symbol procedure)
  (string-append procedure)
  (string-copy procedure)
  (string-fill! procedure)
  (string-length procedure)
  (string-ref procedure)
  (string-set! procedure)
  (string<=? procedure)
  (string<? procedure)
  (string=? procedure)
  (string>=? procedure)
  (string>? procedure)
  (string? procedure)
  (substring procedure)
  (symbol->string procedure)
  (symbol? procedure)
  (syntax-rules syntax)
  (tan procedure)
  (truncate procedure)
  (unspecified procedure)
  (values procedure)
  (vector procedure)
  (vector->list procedure)
  (vector-fill! procedure)
  (vector-length procedure)
  (vector-ref procedure)
  (vector-set! procedure)
  (vector? procedure)
  (violation procedure)
  (zero? procedure))


More information about the R6RS mailing list