[gambit-list] Gambit-C 4.0 beta 14
Marc Feeley
feeley at iro.umontreal.ca
Fri Jul 15 02:41:26 EDT 2005
A new beta of Gambit-C 4.0 is now available in source form at this
address:
http://www.iro.umontreal.ca/~feeley/gambc40b14.tar.gz
Here's what's new:
- Binary serialization. The procedures object->u8vector and
u8vector->object implement binary serialization and deserialization.
The representation used is 2 to 3 times more compact than
text serialization. Moreover, these procedures are implemented
more efficiently, with tables, which makes binary serialization
and deserialization two orders of magnitude faster than text
serialization.
- Better conformance to the draft "R6RS Unicode data" SRFI. The range
of the character type has been extended to #x10FFFF. Each character
in a string now occupies 4 bytes of memory. The size of characters
can be changed by redefining the macro ___MAX_CHR in gambit.h and
recompiling the system. ___MAX_CHR can be 0xFF (1 byte per
character),
0xFFFF (2 bytes per character), or 0x10FFFF (4 bytes per character).
The syntax for characters, quoted strings and "here strings" proposed
in the SRFI have been implemented, and the old #\#x1234 syntax for
characters has been removed (you should now use #\u1234 instead).
- Improvements to the Gambit compiler. A minor modification to the
code generator has improved the register allocation. The inlining
of arithmetic procedures (+, -, *, ...) has been improved. For
example, the program
(define (triple x)
(* x 3))
(define (make-multiplier x)
(lambda (y)
(* x y)))
is expanded to
(define triple
(lambda (x)
(if (and (##eq? * '#<procedure #2 *>) (##fixnum? x))
(let ((temp (##fixnum.*? x 3))) (if temp temp (* x 3)))
(* x 3))))
(define make-multiplier
(lambda (x)
(lambda (y)
(if (and (##eq? * '#<procedure #2 *>) (and (##fixnum? y)
(##fixnum? x)))
(if (##fixnum.= y 0)
0
(let ((temp (if (##fixnum.= y -1)
(##fixnum.-? x)
(##fixnum.*? x y))))
(if temp temp (* x y))))
(* x y)))))
- Testing tables for equality. Tables can be compared for equality
using the equal? procedure. Two tables X and Y are considered
equal by equal? when they have the same weakness attributes, the same
key comparison procedure, the same hashing procedure, the same
length,
and for all the keys k in X, (equal? (table-ref X k) (table-ref Y
k)).
- Compiled scripts now behave the same as interpreted scripts. The
"main" procedure will be called automatically, the language will be
set according to the first line of the script, and the value returned
by the procedure "command-line" will be the list of command line
arguments after the script filename. Scripts can also be compiled
to an executable program.
- Process port fixes. Several problems with process ports have been
fixed,
in particular when pseudo-terminal: is #t. This makes it easy for
a Scheme program to interact with programs that were designed to be
used interactively. Here is an example:
> (define p (open-process
(list path: "/sw/bin/emacs"
arguments: '("-nw")
pseudo-terminal: #t)))
> (read-line p)
"\33[?1049h\33[?12;25h\33[?1h\33=\33[23;1H\33[?25l\33[7m----:---
F1 ..."
- Documentation checking. A script now checks that the documentation
is consistent with the behavior of the system. This has helped
uncover many inconsistencies. Unfortunately only a few of the
inconsistencies have been fixed at this point.
Marc
More information about the Gambit-list
mailing list