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
Afficher les réponses par date
Hey, Marc.
Very nice.
There is a problem on MacOS X 10.3.*, where OCRNL is not defined in <sys/termios.h>. This leads to the error:
[Bradley-Luciers-Computer:~/programs/gambc40b14] lucier% make making all in include making all in lib gcc -I../include -I. -no-cpp-precomp -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -DHAVE_CONFIG_H -D___PRIMAL -D___LIBRARY -D___GAMBCDIR="/pkgs/Gambit-C" -c os_io.c gcc: unrecognized option '-no-cpp-precomp' In file included from os.h:185, from os_base.h:8, from os_io.c:14: /usr/include/dlfcn.h:35:2: warning: #warning "You are using dlopen(), a legacy API. Please use the Mach-O dylib loading APIs if at all possible" os_io.c: In function 'setup_terminal_slave': os_io.c:4641: error: 'OCRNL' undeclared (first use in this function) os_io.c:4641: error: (Each undeclared identifier is reported only once os_io.c:4641: error: for each function it appears in.) make[1]: *** [os_io.o] Error 1 make: *** [all-recursive] Error 1
at the line
tios.c_oflag &= ~(OPOST | ONLCR | OCRNL);
<sys/termios.h > in MacOS X 10.4.* has the following block of definitions not in the 10.3.* version:
/* * The following block of features is unimplemented. Use of these flags in * programs will currently result in unexpected behaviour. * * - Begin unimplemented features */ #define OCRNL 0x00000010 /* map CR to NL on output */ #define ONOCR 0x00000020 /* no CR output at column 0 */ #define ONLRET 0x00000040 /* NL performs CR function */ #define OFILL 0x00000080 /* use fill characters for delay */ #define NLDLY 0x00000300 /* \n delay */ #define TABDLY 0x00000c00 /* horizontal tab delay */ #define CRDLY 0x00003000 /* \r delay */ #define FFDLY 0x00004000 /* form feed delay */ #define BSDLY 0x00008000 /* \b delay */ #define VTDLY 0x00010000 /* vertical tab delay */ #define OFDEL 0x00020000 /* fill is DEL, else NUL */
I don't know if you want to put in another configure test for this definition.
Brad