[gambit-list] [ANN] Gambit v4.8.0 released

Marc Feeley feeley at iro.umontreal.ca
Mon Sep 28 12:32:50 EDT 2015


> On Sep 28, 2015, at 11:28 AM, Logiciel Gambit <gambit at iro.umontreal.ca> wrote:
> 
> Gambit v4.8.0 is now available.

I’m glad to announce the release of version 4.8.0 of Gambit.  This release brings two important changes to Gambit.

First, the system as a whole is now named Gambit instead of Gambit-C.  The name Gambit-C will refer specifically to the system when running on top of C, i.e. Gambit using the C code generator.  Many changes to user visible names have occurred, for example:

doc/gambit.pdf     instead of  doc/gambit-c.pdf
-lgambit           instead of  -lgambc
GAMBOPT            instead of  GAMBCOPT
GAMBCOMP_VERBOSE   instead of  GAMBC_CC_VERBOSE
bin/gambcomp-C     instead of  bin/gambc-cc
bin/gambdoc        instead of  bin/gambc-doc
~/.gambit_history  instead of  ~/.gambc_history

The second change is that the universal backend is now easier to use thanks to the implementation of a linker.  A full runtime library is not yet available, but code using the primitives known to the code generator can be compiled for JavaScript, Python, PHP and Java.  The gsc compiler must be called with the flags -target <language> -link -flat <file>.scm .  A sample use with various target languages is shown below.

The linker supports linking multiple files, but the runtime system doesn’t yet have the module sequencer, so only the first module linked is run.  If the files a.scm, b.scm and c.scm are linked, it is necessary to add at the end of a.scm the expression (begin (| b|) (| c|)) that will execute the modules b and c.  It is a kludge until the runtime system is more complete.

The universal backend should be considered in alpha status at this point.  Please report any issues if you experiment with it.

Marc


--------------------------------------------------
;; File: prog.scm

(declare
 (standard-bindings)
 (extended-bindings)
 (not safe)
 (fixnum)
 (block)
)

(define (fib n)

 (define (fib n)
   (if (< n 2)
       n
       (+ (fib (- n 1))
          (fib (- n 2)))))

 (fib n))

(println "start")

(define start (real-time-milliseconds))

(println (fib 35))

(define end (real-time-milliseconds))

(println (- end start))
--------------------------------------------------

% gsc -target js -link -flat prog.scm
% cat prog_.js prog.js > p.js
% node p.js
start
9227465
313
% gsc -target python -link -flat prog.scm
% python -c 'execfile("prog_.py");execfile("prog.py");'
start
9227465
13113
% gsc -target php -link -flat prog.scm
% cat prog_.php prog.php > p.php
% php p.php
start
9227465
21967
% gsc -target java -link -flat prog.scm
% javac prog_.java prog.java
% java prog_
start
9227465
73944




More information about the Gambit-list mailing list