[gambit-list] New back-ends

Marc Feeley feeley at iro.umontreal.ca
Wed May 23 15:35:13 EDT 2012


Two undergraduate students, Eric Thivierge and Vincent Foley, will be working on various Gambit compiler back-ends over the summer.

Vincent is working on a back-end for x86 and ARM.  Eric is working on a "universal" back-end which can generate code for high-level languages (such as JavaScript, Python, and PHP).

Release 4.6.6 of Gambit contains a very preliminary version of the universal back-end (file gsc/_t-univ.scm).  It is currently a proof of concept and only able to compile simple programs.  The JavaScript back-end is selected by passing the option "-target js" to gsc.  Here is a sample use:

% cat fib.scm
(declare
 (standard-bindings)
 (extended-bindings)
 (block)
 (inlining-limit 0)
 (not safe)
 (not interrupts-enabled)
)

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

(print (fib 30))
% gsc -c -target js fib.scm
% d8 fib.js
832040
% gsi fib.scm
832040

If you are interested in contributing to the development of these back-ends, please inform the mailing list and get in touch with Eric and Vincent so that the efforts can be coordinated.

Marc



More information about the Gambit-list mailing list