unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* ANN: first draft of R7RS small language available
@ 2011-04-16  1:31 Alex Shinn
  2011-04-16  2:16 ` Noah Lavine
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Shinn @ 2011-04-16  1:31 UTC (permalink / raw)
  To: guile-devel

Apologies if you receive multiple copies of this message.

The first draft of the R7RS small language standard is now
available at:

http://trac.sacrideo.us/wg/attachment/wiki/WikiStart/r7rs-draft-1.pdf

This is a relatively small revision to the R5RS, adding many of
the most frequently requested features but keeping the overall
structure of the report the same, with a current count of 67
pages.  In the spirit of the older reports, many situations are
left as errors or unspecified, leaving room for implementations
to experiment with their own extensions.  The language is still
small enough to provide a very compact implementation of, and the
current development branch of Chibi-Scheme provides all of the
functionality of the draft (in some cases with different names or
modules, pending finalization of the standard).

The upcoming large language standard produced by WG2 will include
far more modules, and possibly provide more guarantees about the
behavior in currently unspecified situations.

Most importantly, we have added modules, allowing programmers to
share portable libraries with ease.  We hope implementors
consider the effort of supporting the new standard small compared
to that important benefit.  Keep in mind that nothing is
finalized yet, and at this stage we are seeking constructive
feedback.

The full list of changes up to this point follows.

* Modules have been added as a new program structure to improve
  encapsulation and sharing of code. Some existing and new
  identifiers have been factored out into separate modules.

* Exceptions can now be signalled explicitly with raise,
  raise-continuable or error, and can be handled with
  with-exception-handler and the guard syntax.

* New disjoint types supporting access to multiple fields can be
  generated with define-record-type.

* Parameter objects can be created with make-parameter, and
  dynamically rebound with parameterize.

* Blobs, homogeneous vectors of integers in the range [0..255],
  have been added as a new disjoint type.

* Ports can now be designated as binary or character ports, with
  new procedures for reading and writing binary data.

* String ports have been added as a way to write characters to
  and read characters from strings.

* Current-input-port and current-output-port are now parameter
  objects, along with the newly introduced current-error-port.

* Syntax-rules now recognizes as a wildcard, allows the ellipsis
  symbol to be specified explicitly instead of the default ...,
  allows template escapes with an ellipsis-prefixed list, and
  allows tail patterns to follow an ellipsis pattern.

* Syntax-error has been added as a way to signal immediate and
  more informative errors when a form is expanded.

* Internal define-syntax forms are now allowed preceding any
  internal defines.

* Letrec* has been added, and internal define specified in terms
  of it.

* Case now supports a => syntax analagous to cond.

* Case-lambda has been added to the base library as a way to
  dispatch on the number of arguments passed to a procedure.

* Positive and negative infinity and a NaN object have been added
  to the numeric tower as inexact values with the written
  representations +inf.0, -inf.0 and +nan.0, respectively.

* Map and for-each are now required to terminate on the shortest
  list when inputs have different length.

* Member and assoc now take an optional third argument for the
  equality predicate to use.

* Exact-integer? and exact-integer-sqrt have been added.

* Make-list, copy-list, list-set!, string-map, string-for-each,
  string->vector, copy-vector, vector-map, vector-for-each, and
  vector->string have been added to round out the sequence
  operations.

* The set of characters used is required to be consistent with
  the latest Unicode standard only in so far as the
  implementation supports Unicode.

* string-ni=? and related procedures have been added to compare
  strings as though they had gone through an
  implementation-defined normalization, without exposing the
  normalization.

* The case-folding behavior of the reader can now be explicitly
  controlled, with no folding as the default.

* The reader now recognizes the new comment syntax #; to skip the
  next datum, and allows nested block comments with #| ... |#.

* Data prefixed with reader labels #<n>= can be referenced with
  #<n># allowing for reading and writing of data with shared
  structure.

* Strings and symbols now allow mnemonic and numeric escape
  sequences, and the list of named characters has been extended.

* File-exists? and delete-file are available in the (scheme file)
  module.

* An interface to the system environment and command line is
  available in the (scheme process-context) module.

* Procedures for accessing the current time are available in
  the (scheme time) module.

* A complete set of integer division operators is available in
  the (scheme division) module.

* Transcript-on and transcript-off have been removed.

Thank you.

-- 
Alex Shinn, WG1 Chair



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ANN: first draft of R7RS small language available
  2011-04-16  1:31 ANN: first draft of R7RS small language available Alex Shinn
@ 2011-04-16  2:16 ` Noah Lavine
  2011-04-16  5:40   ` Alex Shinn
  0 siblings, 1 reply; 3+ messages in thread
From: Noah Lavine @ 2011-04-16  2:16 UTC (permalink / raw)
  To: Alex Shinn; +Cc: guile-devel

> Most importantly, we have added modules, allowing programmers to
> share portable libraries with ease.  We hope implementors
> consider the effort of supporting the new standard small compared
> to that important benefit.  Keep in mind that nothing is
> finalized yet, and at this stage we are seeking constructive
> feedback.

Congratulations! This is a great step forward for Scheme, especially
the module system.

I am unsure what forum you would like feedback in, so hope here will work well.

There were only two things that struck me as odd - first, the (scheme
process-context) module is quite dependent on a certain model of
executing processes that might not be true everywhere. It would seem
better to me if that were optional, so implementations could provide
it if it made sense and not otherwise. (For instance, embedded Schemes
might have no environment or command-line arguments. Scheme programs
run from a GUI might have an environment but no command-line
arguments.)

Second, the module form requires everything in a module to be inside
the s-expression defining the module, which seems non-ideal for people
who have to keep track of their nesting level. (Of course a good
editor will handle this for you, but it seems backwards to design a
programming language assuming that an editor will make it easier to
use.) This is unavoidable at a repl, but I think there should be a
facility for modules defined in files to have an s-expression at the
top defining the module which would be closed before the body of the
module. Perhaps if the first s-expression in a file is a module, then
the rest of the file could be an implicit (begin ...) form in the
module definition.

Thanks for all of your work on this
Noah Lavine



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ANN: first draft of R7RS small language available
  2011-04-16  2:16 ` Noah Lavine
@ 2011-04-16  5:40   ` Alex Shinn
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Shinn @ 2011-04-16  5:40 UTC (permalink / raw)
  To: Noah Lavine; +Cc: scheme-reports

On Sat, Apr 16, 2011 at 11:16 AM, Noah Lavine <noah.b.lavine@gmail.com> wrote:
>> Most importantly, we have added modules, allowing programmers to
>> share portable libraries with ease.  We hope implementors
>> consider the effort of supporting the new standard small compared
>> to that important benefit.  Keep in mind that nothing is
>> finalized yet, and at this stage we are seeking constructive
>> feedback.
>
> Congratulations! This is a great step forward for Scheme, especially
> the module system.

Thanks for the quick comments!

> I am unsure what forum you would like feedback in, so hope here will work well.
>
> There were only two things that struck me as odd - first, the (scheme
> process-context) module is quite dependent on a certain model of
> executing processes that might not be true everywhere. It would seem
> better to me if that were optional, so implementations could provide
> it if it made sense and not otherwise. (For instance, embedded Schemes
> might have no environment or command-line arguments. Scheme programs
> run from a GUI might have an environment but no command-line
> arguments.)

This is precisely the reason these procedures were put
in a separate module, because _all_ WG1 modules are
optional.

Likewise many embedded systems have no I/O, so
I/O operations are all in separate modules.

> Second, the module form requires everything in a module to be inside
> the s-expression defining the module, which seems non-ideal for people
> who have to keep track of their nesting level. (Of course a good
> editor will handle this for you, but it seems backwards to design a
> programming language assuming that an editor will make it easier to
> use.) This is unavoidable at a repl, but I think there should be a
> facility for modules defined in files to have an s-expression at the
> top defining the module which would be closed before the body of the
> module. Perhaps if the first s-expression in a file is a module, then
> the rest of the file could be an implicit (begin ...) form in the
> module definition.

This complaint is noted and was anticipated, but it's
very difficult for many implementations to support -
specifically those for which the module system is
implemented in terms of macros.

If you use `include' instead of `begin', keeping the
source in a separate file, you can remove the
additional nesting level.  This also has the advantage
that you can wrap existing R5RS code in a module
without modifying it, and makes it easier to automatically
translate an R7RS module definition into other
module systems, without losing the original
indentation and comments.

If you feel strongly about treating trailing expressions
as part of the module body, I recommend writing it
up as a SRFI and trying to get as many implementations
as possible to support it, at which point it could be
considered in future standards.

-- 
Alex



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-16  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-16  1:31 ANN: first draft of R7RS small language available Alex Shinn
2011-04-16  2:16 ` Noah Lavine
2011-04-16  5:40   ` Alex Shinn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).