<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://dynamo.iro.umontreal.ca/wiki/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php?title=Special:Contributions/Bjlucier&amp;feed=atom&amp;limit=50&amp;target=Bjlucier&amp;year=&amp;month=</id>
		<title>Gambit wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://dynamo.iro.umontreal.ca/~gambit/wiki/index.php?title=Special:Contributions/Bjlucier&amp;feed=atom&amp;limit=50&amp;target=Bjlucier&amp;year=&amp;month="/>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Special:Contributions/Bjlucier"/>
		<updated>2013-05-20T17:05:40Z</updated>
		<subtitle>From Gambit wiki</subtitle>
		<generator>MediaWiki 1.16.4</generator>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2012-11-30T20:51:43Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Math */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
In case you find that a link to an external repository linked to from this page doesn't work anymore, please try to retrieve the latest version of the repo and upload it here, by a) contacting the author directly, b) enquiring for it on the mailing list, and/or c) trying to get it from archive.org.&lt;br /&gt;
&lt;br /&gt;
==Gambit packages==&lt;br /&gt;
These packages are in the present form created to run atop Gambit directly. They can generally easily be ported to any module system of choice.&lt;br /&gt;
===SRFI===&lt;br /&gt;
#'''SRFI-pack''': Many SRFIs ported to Gambit&lt;br /&gt;
#: Author: Guillaume Germain&lt;br /&gt;
#: Package: [[media:Srfi-pack-0.1.tar.gz|Srfi-pack-0.1.tar.gz]]&lt;br /&gt;
#: README: [[media:Srfi-pack-0.1-README.txt|Srfi-pack-0.1-README.txt]]&lt;br /&gt;
#'''SRFI-1''': SRFI-1 ported to Gambit&lt;br /&gt;
#: Author: Olin Shivers; ported by Bradley Lucier&lt;br /&gt;
#: Package [[media:Srfi1.scm|Srfi1.scm]]&lt;br /&gt;
#: Note: I did not extend map to allow list arguments of different lengths&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
# '''Alexpander''': A syntax-rules expander with support for DSSSL #!optional #!key and #!rest arguments.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Alexpander-r1.tgz|Alexpander-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Module systems===&lt;br /&gt;
# '''Black Hole''': Module system, stable. Package handling features are in beta phase. Primary page at [[Black Hole]].&lt;br /&gt;
#: Package: (git repo) [https://github.com/pereckerdal/blackhole https://github.com/pereckerdal/blackhole]&lt;br /&gt;
#: Mirror for convenience, non-syntactictower Black Hole with bundled libs: [[media:2012-11-28-bh-non-syntactictower+bundled-libs.tar.gz|2012-11-28-bh-non-syntactictower+bundled-libs.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having single inheritance instead of multiple inheritance and a compile-time, not a run-time, MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Website: http://www.math.purdue.edu/~lucier/software/Meroon/&lt;br /&gt;
#: Package: [[media:MeroonV3-2012Jan20.tar.bz2|MeroonV3-2012Jan20.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
# '''Random numbers''': High-quality random number generation. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=random http://snow.iro.umontreal.ca/?viewpkg=random]&lt;br /&gt;
# '''GUROBI FFI''': This is a FFI that includes the most necessary commands for operating GUROBI from GAMBIT.&lt;br /&gt;
#: Author: Magnus Andersson&lt;br /&gt;
#: Package: [https://github.com/angelrussher/gurobi-ffi https://github.com/angelrussher/gurobi-ffi]&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
# '''AES''' Message encryption and decryption based on the AES symmetric cipher. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=aes http://snow.iro.umontreal.ca/?viewpkg=aes]&lt;br /&gt;
# '''Cert''' Management of digital certificates, message signing and verification. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=cert http://snow.iro.umontreal.ca/?viewpkg=cert]&lt;br /&gt;
# '''RSA''' Message encryption and decryption based on the RSA asymmetric cipher. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=rsa http://snow.iro.umontreal.ca/?viewpkg=rsa]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ===Networking=== --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information. For a more developed version w UTF8 support pls contact the ml.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r3.tgz|Cairo-r3.tgz]] (old: [[media:Cairo-r2.tgz|Cairo-r2.tgz]])&lt;br /&gt;
# '''GLEW''': A wrapper for GLEW which provides all OpenGL functionality through version 2.1 and manages access to vendor extensions&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:Glew.tar.gz|glew.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
# '''mpg123''': A wrapper for the libmpg123 mpeg decoding library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:mpg.tar.gz|mpg.tar.gz]]&lt;br /&gt;
# '''OpenAL''': A wrapper for the OpenAL audio output library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:openAL.tar.gz|openAL.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Networking===&lt;br /&gt;
# '''gamsock''': Full socket library compatible with Scsh's socket API.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Package: [[media:gamsock-r1.tar.gz|gamsock-r1.tar.gz]]&lt;br /&gt;
#: Git: https://github.com/bitwize/gamsock&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
# '''repltest''': Small example which embeds a remotely accessible REPL into a standalone C program.&lt;br /&gt;
#: Web: https://mercure.iro.umontreal.ca/pipermail/gambit-list/2010-June/004500.html&lt;br /&gt;
#: Package: [[media:Repltest-20100604.tgz‎|Repltest-20100604.tgz‎]]&lt;br /&gt;
# '''objc-utility-macros''': Utility macros to help wrap Objective-C methods.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Package: [[media:objc-utility-macros.scm‎|objc-utility-macros.scm]]&lt;br /&gt;
# '''Sort''': Richard O'Keefe's sorting procedures for lists and vectors.  Four times as fast as other sort.&lt;br /&gt;
#: Author: Richard O'Keefe&lt;br /&gt;
#: Package: [[media:Sort-okeefe.tgz|Sort-okeefe.tgz]]&lt;br /&gt;
# '''Digest''': Computation of message digests (CRC32, MD5, SHA-1, ...). Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=digest http://snow.iro.umontreal.ca/?viewpkg=digest]&lt;br /&gt;
# '''Red-black tree''' implementation, Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=rbtree http://snow.iro.umontreal.ca/?viewpkg=rbtree]&lt;br /&gt;
# '''Unicode''': Unicode handling library 1.0, does string upper-/lowercasing and case insensitive comparison with Unicode character support. Essentially completes Gambit's support for the functionality described in [http://srfi.schemers.org/srfi-75/srfi-75.html SRFI 75: Unicode].&lt;br /&gt;
#: Author: Mikael More, Florian Loitsch&lt;br /&gt;
#: Package: [[media:Unicode.tar.gz|Unicode.tar.gz]] repo: [https://github.com/m-i-k-a-e-l/gambit-unicode https://github.com/m-i-k-a-e-l/gambit-unicode]&lt;br /&gt;
# '''Glass Table''': Interactive Development Environment. A REPL that lets you save your work.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Repo: https://github.com/bitwize/glasstable&lt;br /&gt;
#: Package: [[media:glasstable-0.1.tar.gz|glasstable-0.1.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
==Gambit Black Hole packages==&lt;br /&gt;
These packages are in their present form created to run on Gambit using the Black Hole module system. They can generally easily be made to run on Gambit directly as well. For more info see [[Black Hole]].&lt;br /&gt;
===SRFI===&lt;br /&gt;
# '''SRFIs package'''&lt;br /&gt;
#: Package: (git repo) [https://github.com/pereckerdal/srfi https://github.com/pereckerdal/srfi]&lt;br /&gt;
&lt;br /&gt;
===Networking===&lt;br /&gt;
# '''Sack''': Web server and HTTP client. BH module. [https://github.com/pereckerdal/sack https://github.com/pereckerdal/sack]&lt;br /&gt;
For convenience, mirror readily set up for non-syntactictower Black Hole: [[media:2012-11-28-sack-current-for-BH-non-syntactictower.tar.gz|2012-11-28-sack-current-for-BH-non-syntactictower.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Mishmash of various utils''': xml&amp;lt;-&amp;gt;sxml, pregexp, digest, base64, uuid, fifo mailbox, rbtree, exception-handling, let-optionals and more. sxpath also available. These packages will be split out to individual packages. Ask on mailing list for updates.&lt;br /&gt;
#: Package: (git repo) https://github.com/pereckerdal/std&lt;br /&gt;
&lt;br /&gt;
==Documents==&lt;br /&gt;
===Scheme books===&lt;br /&gt;
# '''An Introduction to Scheme and its Implementation''': A pretty good book on how to learn Scheme, for people with a background in general programming languages.&lt;br /&gt;
#: Author: Paul R. Wilson&lt;br /&gt;
#: Package: [[media:An_Introduction_to_Scheme_and_its_Implementation.tar.gz|An_Introduction_to_Scheme_and_its_Implementation.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Compiling_Gambit_software_for_different_target_environments</id>
		<title>Compiling Gambit software for different target environments</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Compiling_Gambit_software_for_different_target_environments"/>
				<updated>2012-04-14T00:39:09Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== How to build GUI apps for Win32 ===&lt;br /&gt;
The misc\vcexpress.bat file, used as described in INSTALL, both found in the source repo file are good sources of inspiration on how to build Gambit apps using MSVC.&lt;br /&gt;
&lt;br /&gt;
Here's a good GUI example app for win32, call it test.scm:&lt;br /&gt;
&lt;br /&gt;
:(c-declare &amp;quot;#include &amp;lt;windows.h&amp;gt;&amp;quot;)&lt;br /&gt;
:(define message-box (c-lambda (UTF-8-string) void &amp;quot;MessageBox(0,___arg1,\&amp;quot;Dbg\&amp;quot;,0);&amp;quot;))&lt;br /&gt;
:(message-box &amp;quot;Hi!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
In order to compile it, first run misc\vcexpress to get lib\libgambc.lib . Then do:&lt;br /&gt;
&lt;br /&gt;
:C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall&lt;br /&gt;
:gsc -link test&lt;br /&gt;
:cl.exe -Fetest.exe -nologo -Oityb1 -MT -D_CRT_SECURE_NO_DEPRECATE -c -I&amp;quot;C:\gambc-v4_3_2-devel\include&amp;quot; -I&amp;quot;C:\gambc-v4_3_2-devel\lib&amp;quot; -D___SINGLE_HOST -D_WINDOWS &amp;quot;test_.c&amp;quot; &amp;quot;test.c&amp;quot;&lt;br /&gt;
:cl -Fetest.exe test.obj test_.obj C:\gambc-v4_3_2-devel\lib\libgambc.lib Kernel32.Lib User32.Lib Gdi32.Lib WS2_32.Lib /link /subsystem:windows&lt;br /&gt;
&lt;br /&gt;
Voila! The key recipe in here is to pass -D_WINDOWS to cl.exe, and /subsystem:windows to link.exe .&lt;br /&gt;
&lt;br /&gt;
Upon any (display) (force-output) you do, a console window will be allocated. This can be remedied by doing (current-output-port (open-dummy)) (current-input-port (open-dummy)) though.&lt;br /&gt;
&lt;br /&gt;
Pass -dr:- to force the app open a console.&lt;br /&gt;
&lt;br /&gt;
For more info see the ml thread around [https://mercure.iro.umontreal.ca/pipermail/gambit-list/2012-April/005879.html here].&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Compiling_Gambit_software_for_different_target_environments</id>
		<title>Compiling Gambit software for different target environments</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Compiling_Gambit_software_for_different_target_environments"/>
				<updated>2012-04-14T00:38:49Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== How to build GUI apps for Win32 ===&lt;br /&gt;
The misc\vcexpress.bat file, used as described in INSTALL, both found in the source repo file are good sources of inspiration on how to build Gambit apps using MSVC.&lt;br /&gt;
&lt;br /&gt;
Here's a good GUI example app for win32, call it test.scm:&lt;br /&gt;
&lt;br /&gt;
:(c-declare &amp;quot;#include &amp;lt;windows.h&amp;gt;&amp;quot;)&lt;br /&gt;
:(define message-box (c-lambda (UTF-8-string) void &amp;quot;MessageBox(0,___arg1,\&amp;quot;Dbg\&amp;quot;,0);&amp;quot;))&lt;br /&gt;
:(message-box &amp;quot;Hi!&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
In order to compile it, first run misc\vcexpress to get lib\libgambc.lib . Then do:&lt;br /&gt;
&lt;br /&gt;
:C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall&lt;br /&gt;
:gsc -link test&lt;br /&gt;
:cl.exe -Fetest.exe -nologo -Oityb1 -MT -D_CRT_SECURE_NO_DEPRECATE -c -I&amp;quot;C:\gambc-v4_3_2-devel\include&amp;quot; -I&amp;quot;C:\gambc-v4_3_2-devel\lib&amp;quot; -D___SINGLE_HOST -D_WINDOWS &amp;quot;test_.c&amp;quot; &amp;quot;test.c&amp;quot;&lt;br /&gt;
:cl -Fetest.exe test.obj test_.obj C:\gambc-v4_3_2-devel\lib\libgambc.lib Kernel32.Lib User32.Lib Gdi32.Lib WS2_32.Lib /link /subsystem:windows&lt;br /&gt;
&lt;br /&gt;
Voila. The key recipe in here is to pass -D_WINDOWS to cl.exe, and /subsystem:windows to link.exe .&lt;br /&gt;
&lt;br /&gt;
Upon any (display) (force-output) you do, a console window will be allocated. This can be remedied by doing (current-output-port (open-dummy)) (current-input-port (open-dummy)) though.&lt;br /&gt;
&lt;br /&gt;
Pass -dr:- to force the app open a console.&lt;br /&gt;
&lt;br /&gt;
For more info see the ml thread around [https://mercure.iro.umontreal.ca/pipermail/gambit-list/2012-April/005879.html here].&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2012-01-20T22:21:00Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Object Systems */  Update Meroon&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
In case you find that a link to an external repository linked to from this page doesn't work anymore, please try to retrieve the latest version of the repo and upload it here, by a) contacting the author directly, b) enquiring for it on the mailing list, and/or c) trying to get it from archive.org.&lt;br /&gt;
&lt;br /&gt;
==Gambit packages==&lt;br /&gt;
These packages are in the present form created to run atop Gambit directly. They can generally easily be ported to any module system of choice.&lt;br /&gt;
===SRFI===&lt;br /&gt;
#'''SRFI-pack''': Many SRFIs ported to Gambit&lt;br /&gt;
#: Author: Guillaume Germain&lt;br /&gt;
#: Package: [[media:Srfi-pack-0.1.tar.gz|Srfi-pack-0.1.tar.gz]]&lt;br /&gt;
#: README: [[media:Srfi-pack-0.1-README.txt|Srfi-pack-0.1-README.txt]]&lt;br /&gt;
#'''SRFI-1''': SRFI-1 ported to Gambit&lt;br /&gt;
#: Author: Olin Shivers; ported by Bradley Lucier&lt;br /&gt;
#: Package [[media:Srfi1.scm|Srfi1.scm]]&lt;br /&gt;
#: Note: I did not extend map to allow list arguments of different lengths&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
# '''Alexpander''': A syntax-rules expander with support for DSSSL #!optional #!key and #!rest arguments.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Alexpander-r1.tgz|Alexpander-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Module systems===&lt;br /&gt;
# '''Black Hole''': Module system, stable. Package handling features are in beta phase. Primary page at [[Black Hole]].&lt;br /&gt;
#: Package: (git repo) [https://github.com/pereckerdal/blackhole https://github.com/pereckerdal/blackhole]&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having single inheritance instead of multiple inheritance and a compile-time, not a run-time, MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Website: http://www.math.purdue.edu/~lucier/software/Meroon/&lt;br /&gt;
#: Package: [[media:MeroonV3-2012Jan20.tar.bz2|MeroonV3-2012Jan20.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
#: '''Random numbers''': High-quality random number generation. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=random http://snow.iro.umontreal.ca/?viewpkg=random]&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
# '''AES''' Message encryption and decryption based on the AES symmetric cipher. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=aes http://snow.iro.umontreal.ca/?viewpkg=aes]&lt;br /&gt;
# '''Cert''' Management of digital certificates, message signing and verification. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=cert http://snow.iro.umontreal.ca/?viewpkg=cert]&lt;br /&gt;
# '''RSA''' Message encryption and decryption based on the RSA asymmetric cipher. Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=rsa http://snow.iro.umontreal.ca/?viewpkg=rsa]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ===Networking=== --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r3.tgz|Cairo-r3.tgz]] (old: [[media:Cairo-r2.tgz|Cairo-r2.tgz]])&lt;br /&gt;
# '''GLEW''': A wrapper for GLEW which provides all OpenGL functionality through version 2.1 and manages access to vendor extensions&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:Glew.tar.gz|glew.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
# '''mpg123''': A wrapper for the libmpg123 mpeg decoding library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:mpg.tar.gz|mpg.tar.gz]]&lt;br /&gt;
# '''OpenAL''': A wrapper for the OpenAL audio output library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:openAL.tar.gz|openAL.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
# '''repltest''': Small example which embeds a remotely accessible REPL into a standalone C program.&lt;br /&gt;
#: Web: https://mercure.iro.umontreal.ca/pipermail/gambit-list/2010-June/004500.html&lt;br /&gt;
#: Package: [[media:Repltest-20100604.tgz‎|Repltest-20100604.tgz‎]]&lt;br /&gt;
# '''objc-utility-macros''': Utility macros to help wrap Objective-C methods.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Package: [[media:objc-utility-macros.scm‎|objc-utility-macros.scm]]&lt;br /&gt;
# '''Sort''': Richard O'Keefe's sorting procedures for lists and vectors.  Four times as fast as other sort.&lt;br /&gt;
#: Author: Richard O'Keefe&lt;br /&gt;
#: Package: [[media:Sort-okeefe.tgz|Sort-okeefe.tgz]]&lt;br /&gt;
# '''Digest''': Computation of message digests (CRC32, MD5, SHA-1, ...). Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=digest http://snow.iro.umontreal.ca/?viewpkg=digest]&lt;br /&gt;
# '''Red-black tree''' implementation, Snow package.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [http://snow.iro.umontreal.ca/?viewpkg=rbtree http://snow.iro.umontreal.ca/?viewpkg=rbtree]&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
==Gambit Black Hole packages==&lt;br /&gt;
These packages are in their present form created to run on Gambit using the Black Hole module system. They can generally easily be made to run on Gambit directly as well. For more info see [[Black Hole]].&lt;br /&gt;
===SRFI===&lt;br /&gt;
# '''SRFIs package'''&lt;br /&gt;
#: Package: (git repo) [https://github.com/pereckerdal/srfi https://github.com/pereckerdal/srfi]&lt;br /&gt;
&lt;br /&gt;
===Networking===&lt;br /&gt;
# '''Sack''': Web server and HTTP client. BH module. [https://github.com/pereckerdal/sack https://github.com/pereckerdal/sack]&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Mishmash of various utils''': xml&amp;lt;-&amp;gt;sxml, pregexp, digest, base64, uuid, fifo mailbox, rbtree, exception-handling, let-optionals and more. sxpath also available. These packages will be split out to individual packages. Ask on mailing list for updates.&lt;br /&gt;
#: Package: (git repo) https://github.com/pereckerdal/std&lt;br /&gt;
&lt;br /&gt;
==Documents==&lt;br /&gt;
===Scheme books===&lt;br /&gt;
# '''An Introduction to Scheme and its Implementation''': A pretty good book on how to learn Scheme, for people with a background in general programming languages.&lt;br /&gt;
#: Author: Paul R. Wilson&lt;br /&gt;
#: Package: [[media:An_Introduction_to_Scheme_and_its_Implementation.tar.gz|An_Introduction_to_Scheme_and_its_Implementation.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:MeroonV3-2012Jan20.tar.bz2</id>
		<title>File:MeroonV3-2012Jan20.tar.bz2</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:MeroonV3-2012Jan20.tar.bz2"/>
				<updated>2012-01-20T22:19:09Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Meroon object system.

Moved some macros from instance.gsc to macinst.gsc to allow build with meroon-safer-object defined.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Meroon object system.&lt;br /&gt;
&lt;br /&gt;
Moved some macros from instance.gsc to macinst.gsc to allow build with meroon-safer-object defined.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2011-11-10T01:22:22Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Utilities */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
==Packages==&lt;br /&gt;
===SRFI===&lt;br /&gt;
#'''SRFI-pack''': Many SRFIs ported to Gambit&lt;br /&gt;
#: Author: Guillaume Germain&lt;br /&gt;
#: Package: [[media:Srfi-pack-0.1.tar.gz|Srfi-pack-0.1.tar.gz]]&lt;br /&gt;
#: README: [[media:Srfi-pack-0.1-README.txt|Srfi-pack-0.1-README.txt]]&lt;br /&gt;
#'''SRFI-1''': SRFI-1 ported to Gambit&lt;br /&gt;
#: Author: Olin Shivers; ported by Bradley Lucier&lt;br /&gt;
#: Package [[media:Srfi1.scm|Srfi1.scm]]&lt;br /&gt;
#: Note: I did not extend map to allow list arguments of different lengths&lt;br /&gt;
&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having single inheritance instead of multiple inheritance and a compile-time, not a run-time, MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Website: http://www.math.purdue.edu/~lucier/software/Meroon/&lt;br /&gt;
#: Package: [[media:MeroonV3-2008Mar01.tar.bz2‎|MeroonV3-2008Mar01.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
# '''mpg123''': A wrapper for the libmpg123 mpeg decoding library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:mpg.tar.gz|mpg.tar.gz]]&lt;br /&gt;
# '''OpenAL''': A wrapper for the OpenAL audio output library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:openAL.tar.gz|openAL.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r3.tgz|Cairo-r3.tgz]] (old: [[media:Cairo-r2.tgz|Cairo-r2.tgz]])&lt;br /&gt;
# '''GLEW''': A wrapper for GLEW which provides all OpenGL functionality through version 2.1 and manages access to vendor extensions&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:Glew.tar.gz|glew.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
# '''Alexpander''': A syntax-rules expander with support for DSSSL #!optional #!key and #!rest arguments.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Alexpander-r1.tgz|Alexpander-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
# '''repltest''': Small example which embeds a remotely accessible REPL into a standalone C program.&lt;br /&gt;
#: Web: https://mercure.iro.umontreal.ca/pipermail/gambit-list/2010-June/004500.html&lt;br /&gt;
#: Package: [[media:Repltest-20100604.tgz‎|Repltest-20100604.tgz‎]]&lt;br /&gt;
# '''objc-utility-macros''': Utility macros to help wrap Objective-C methods.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Package: [[media:objc-utility-macros.scm‎|objc-utility-macros.scm]]&lt;br /&gt;
# '''Sort''': Richard O'Keefe's sorting procedures for lists and vectors.  Four times as fast as other sort.&lt;br /&gt;
#: Author: Richard O'Keefe&lt;br /&gt;
#: Package: [[media:Sort-okeefe.tgz|Sort-okeefe.tgz]]&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
# '''An Introduction to Scheme and its Implementation''': A pretty good book on how to learn Scheme, for people with a background in general programming languages.&lt;br /&gt;
#: Author: Paul R. Wilson&lt;br /&gt;
#: Package: [[media:An_Introduction_to_Scheme_and_its_Implementation.tar.gz|An_Introduction_to_Scheme_and_its_Implementation.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2011-11-09T23:32:52Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Utilities */ Add Richard O'Keefe's sort routines.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
==Packages==&lt;br /&gt;
===SRFI===&lt;br /&gt;
#'''SRFI-pack''': Many SRFIs ported to Gambit&lt;br /&gt;
#: Author: Guillaume Germain&lt;br /&gt;
#: Package: [[media:Srfi-pack-0.1.tar.gz|Srfi-pack-0.1.tar.gz]]&lt;br /&gt;
#: README: [[media:Srfi-pack-0.1-README.txt|Srfi-pack-0.1-README.txt]]&lt;br /&gt;
#'''SRFI-1''': SRFI-1 ported to Gambit&lt;br /&gt;
#: Author: Olin Shivers; ported by Bradley Lucier&lt;br /&gt;
#: Package [[media:Srfi1.scm|Srfi1.scm]]&lt;br /&gt;
#: Note: I did not extend map to allow list arguments of different lengths&lt;br /&gt;
&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having single inheritance instead of multiple inheritance and a compile-time, not a run-time, MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Website: http://www.math.purdue.edu/~lucier/software/Meroon/&lt;br /&gt;
#: Package: [[media:MeroonV3-2008Mar01.tar.bz2‎|MeroonV3-2008Mar01.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
# '''mpg123''': A wrapper for the libmpg123 mpeg decoding library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:mpg.tar.gz|mpg.tar.gz]]&lt;br /&gt;
# '''OpenAL''': A wrapper for the OpenAL audio output library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:openAL.tar.gz|openAL.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r3.tgz|Cairo-r3.tgz]] (old: [[media:Cairo-r2.tgz|Cairo-r2.tgz]])&lt;br /&gt;
# '''GLEW''': A wrapper for GLEW which provides all OpenGL functionality through version 2.1 and manages access to vendor extensions&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:Glew.tar.gz|glew.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
# '''Alexpander''': A syntax-rules expander with support for DSSSL #!optional #!key and #!rest arguments.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Alexpander-r1.tgz|Alexpander-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
# '''repltest''': Small example which embeds a remotely accessible REPL into a standalone C program.&lt;br /&gt;
#: Web: https://mercure.iro.umontreal.ca/pipermail/gambit-list/2010-June/004500.html&lt;br /&gt;
#: Package: [[media:Repltest-20100604.tgz‎|Repltest-20100604.tgz‎]]&lt;br /&gt;
# '''objc-utility-macros''': Utility macros to help wrap Objective-C methods.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Package: [[media:objc-utility-macros.scm‎|objc-utility-macros.scm]]&lt;br /&gt;
# '''Sort''': Richard O'Keefe's sorting procedures for lists and vectors.  Four times faster than the other sort.&lt;br /&gt;
#: Author: Richard O'Keefe&lt;br /&gt;
#: Package: [[media:Sort-okeefe.tgz|Sort-okeefe.tgz]]&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Documents ==&lt;br /&gt;
# '''An Introduction to Scheme and its Implementation''': A pretty good book on how to learn Scheme, for people with a background in general programming languages.&lt;br /&gt;
#: Author: Paul R. Wilson&lt;br /&gt;
#: Package: [[media:An_Introduction_to_Scheme_and_its_Implementation.tar.gz|An_Introduction_to_Scheme_and_its_Implementation.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:Sort-okeefe.tgz</id>
		<title>File:Sort-okeefe.tgz</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:Sort-okeefe.tgz"/>
				<updated>2011-11-09T23:30:14Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Richard O'Keefe's sort program.  Four times faster than the other sort.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Richard O'Keefe's sort program.  Four times faster than the other sort.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2011-04-19T01:57:44Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* SRFI */ Added SRFI-1 implementation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
==Packages==&lt;br /&gt;
===SRFI===&lt;br /&gt;
#'''SRFI-pack''': Many SRFIs ported to Gambit&lt;br /&gt;
#: Author: Guillaume Germain&lt;br /&gt;
#: Package: [[media:Srfi-pack-0.1.tar.gz|Srfi-pack-0.1.tar.gz]]&lt;br /&gt;
#: README: [[media:Srfi-pack-0.1-README.txt|Srfi-pack-0.1-README.txt]]&lt;br /&gt;
#'''SRFI-1''': SRFI-1 ported to Gambit&lt;br /&gt;
#: Author: Olin Shivers; ported by Bradley Lucier&lt;br /&gt;
#: Package [[media:Srfi1.scm|Srfi1.scm]]&lt;br /&gt;
#: Note: I did not extend map to allow list arguments of different lengths&lt;br /&gt;
&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having single inheritance instead of multiple inheritance and a compile-time, not a run-time, MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Website: http://www.math.purdue.edu/~lucier/software/Meroon/&lt;br /&gt;
#: Package: [[media:MeroonV3-2008Mar01.tar.bz2‎|MeroonV3-2008Mar01.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
# '''mpg123''': A wrapper for the libmpg123 mpeg decoding library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:mpg.tar.gz|mpg.tar.gz]]&lt;br /&gt;
# '''OpenAL''': A wrapper for the OpenAL audio output library&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:openAL.tar.gz|openAL.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r3.tgz|Cairo-r3.tgz]] (old: [[media:Cairo-r2.tgz|Cairo-r2.tgz]])&lt;br /&gt;
# '''GLEW''': A wrapper for GLEW which provides all OpenGL functionality through version 2.1 and manages access to vendor extensions&lt;br /&gt;
#: Author: Fred LeMaster&lt;br /&gt;
#: Package: [[media:Glew.tar.gz|glew.tar.gz]]&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
# '''Alexpander''': A syntax-rules expander with support for DSSSL #!optional #!key and #!rest arguments.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Alexpander-r1.tgz|Alexpander-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
# '''repltest''': Small example which embeds a remotely accessible REPL into a standalone C program.&lt;br /&gt;
#: Web: https://mercure.iro.umontreal.ca/pipermail/gambit-list/2010-June/004500.html&lt;br /&gt;
#: Package: [[media:Repltest-20100604.tgz‎|Repltest-20100604.tgz‎]]&lt;br /&gt;
# '''objc-utility-macros''': Utility macros to help wrap Objective-C methods.&lt;br /&gt;
#: Author: Jeffrey T. Read&lt;br /&gt;
#: Package: [[media:objc-utility-macros.scm‎|objc-utility-macros.scm]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:Srfi1.scm</id>
		<title>File:Srfi1.scm</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:Srfi1.scm"/>
				<updated>2011-04-19T01:53:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: SRFI-1 (list procedures) mildly modified for gambit, and we don't modify map to allow lists of different lengths (an incompatibility).&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;SRFI-1 (list procedures) mildly modified for gambit, and we don't modify map to allow lists of different lengths (an incompatibility).&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page"/>
				<updated>2009-11-07T02:48:42Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Undo revision 2341 by Veronicamyers (Talk) SPAM&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
The Gambit Scheme system is a complete, portable, efficient and reliable implementation&lt;br /&gt;
of the [[Scheme | Scheme programming language]].&lt;br /&gt;
&lt;br /&gt;
This web site is intended for users of the Gambit Scheme system.  It is a place where various&lt;br /&gt;
resources are collected and where users can exchange information related to Gambit.&lt;br /&gt;
&lt;br /&gt;
'''Download latest release (v4.5.3):'''&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/source/gambc-v4_5_3-devel.tgz Development Sources],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/prebuilt/gambc-v4_5_3-macosx-intel32.dmg Mac OS X installer (for Intel 32)],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.5/prebuilt/gambc-v4_5_3-windows-mingw.exe Windows installer]&lt;br /&gt;
(for other releases see the [[distributions]]).&lt;br /&gt;
&lt;br /&gt;
==What's Gambit?==&lt;br /&gt;
&lt;br /&gt;
Gambit consists of two main programs: '''gsi''', the Gambit Scheme interpreter, and '''gsc''', the Gambit Scheme compiler.&lt;br /&gt;
The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time.  Interpreted code and compiled code can be freely mixed.&lt;br /&gt;
&lt;br /&gt;
Gambit-C is a version of the Gambit programming system in which the&lt;br /&gt;
compiler generates portable C code.  The main features of Gambit-C are:&lt;br /&gt;
&lt;br /&gt;
* '''Conformance.'''  The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards and implements all optional features.  Tail calls and first class continuations conform to the Scheme semantics.  The full numeric tower is implemented, including: arbitrary precision integers (bignums), rationals, inexact reals (floating point numbers), and complex numbers.  Several extensions to Scheme are provided, including: lightweight threads, a foreign-function interface (FFI), and extended I/O capabilities (Unicode, networking, subprocesses, ...).&lt;br /&gt;
* '''Portability.'''  Because the system is mostly written in Scheme and the compiler generates portable C code, it is easy to port the system as well as programs compiled with it to any platform with a decent C or C++ compiler.  There is no reliance on a particular C compiler, although the system can take advantage of some '''gcc'''-specific constructs.  The C code generated is oblivious to the endianness and word size of the target environment (32 and 64 bit architectures are currently supported).&lt;br /&gt;
* '''Performance.'''  The compiler includes several powerful program transformations such as user procedure inlining, partial-evaluation, and lambda-lifting.  With appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs.  Programs containing no declarations are also optimized without compromising the Scheme semantics by speculatively inlining predefined procedures (see the [[benchmarks]] page for a comparison with other Scheme implementations and other languages).  Thanks to an efficient implementation of continuations, the thread system is very efficient and can support millions of concurrent threads.  The bignum library uses sophisticated algorithms that are in some cases asymptotically faster than those of GMP (GNU Multiple Precision Arithmetic Library). [Note: With the release of GMP 4.3.0 in April 2009, this claim is no longer true; see the [[benchmarks]] page for some crude comparisons on large integers.]&lt;br /&gt;
* '''Reliability.'''  Stable releases typically have very few bugs.  Bug tracking is done with [http://www.bugzilla.org/ bugzilla].  Gambit-C has been used to develop large-scale real-world software in academic and commercial settings.&lt;br /&gt;
&lt;br /&gt;
==Getting Gambit==&lt;br /&gt;
&lt;br /&gt;
Gambit is available as prebuilt and source code [[distributions]].  There are prebuilt distributions for Mac OS X, Microsoft Windows, and other operating systems.  The source code distributions must be compiled with a C or C++ compiler.  The latest sources are available in the [[Source code repository | source code repository]]. It can be accessed using&lt;br /&gt;
the [http://git.or.cz/ git] distributed version control system.&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Documentation]] is available.&lt;br /&gt;
&lt;br /&gt;
==Support==&lt;br /&gt;
&lt;br /&gt;
Come chat with us in the #gambit channel on [http://www.mibbit.com Freenode IRC].&lt;br /&gt;
&lt;br /&gt;
==Contributing==&lt;br /&gt;
&lt;br /&gt;
Learn [[how to contribute]] to Gambit's development.&lt;br /&gt;
&lt;br /&gt;
===Reporting bugs===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/bugzilla/ Gambit bugzilla]&lt;br /&gt;
&lt;br /&gt;
===Source repository===&lt;br /&gt;
&lt;br /&gt;
[[Source code repository | Gambit Git repo]]&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
&lt;br /&gt;
Gambit is Copyright &amp;amp;copy; 1994-2008 by Marc Feeley.&lt;br /&gt;
It is released under a dual LGPL and Apache 2 license. You&lt;br /&gt;
can choose whichever license you prefer:&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/copyleft/lesser.html LGPL version 2.1 license]&lt;br /&gt;
* [http://www.apache.org/licenses/LICENSE-2.0.html Apache version 2.0 license]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2009-10-09T03:06:13Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Object Systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
==Packages==&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having single inheritance instead of multiple inheritance and a compile-time, not a run-time, MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Package: [[media:MeroonV3-2008Mar01.tar.bz2‎|MeroonV3-2008Mar01.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r2.tgz|Cairo-r2.tgz]] (old: [[media:Cairo-r1.tgz|Cairo-r1.tgz]])&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:MeroonV3-2008Mar01.tar.bz2</id>
		<title>File:MeroonV3-2008Mar01.tar.bz2</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:MeroonV3-2008Mar01.tar.bz2"/>
				<updated>2009-10-08T20:24:59Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: This is a test of uploading bz2 files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a test of uploading bz2 files&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2009-10-08T19:41:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Object Systems */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
==Packages==&lt;br /&gt;
===Physics===&lt;br /&gt;
#'''Ising''': Computer simulations of the Ising model of spins using the Metropolis algorithm or the Wolff algorithm.&lt;br /&gt;
#: Author: Marijn Schouten&lt;br /&gt;
#: Package: [[media:ising-20090315.scm]]&lt;br /&gt;
&lt;br /&gt;
===Math===&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/blas&lt;br /&gt;
# '''LAPACK''': Thin wrapper for higher-level linear algebra routines for the Gambit Scheme system.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/lapack&lt;br /&gt;
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/fftw3&lt;br /&gt;
&lt;br /&gt;
===Object Systems===&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops34.tgz|oops34.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;br /&gt;
# '''class.scm''': A simple CLOS-like object system written with a balance of performance, usability and runtime heap consumption. Comes bundled with a test suite which shows exemple of how the system can be used. Also can be used easily in a repl with (include &amp;quot;class.scm&amp;quot;). &lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: (web page/git repo) http://github.com/sthilaid/class/tree/master&lt;br /&gt;
# '''Meroon''': CLOS-like object system for Scheme.&lt;br /&gt;
#: Author: Christian Queinnec, now semi-maintained by Brad Lucier.  Licensed under the [http://opensource.franz.com/preamble.html Lisp Lesser General Public Licence].  Differs from CLOS in (among many other things) having only single inheritance and a compile-time MOP.  Can be compiled to be relatively fast code.  Would benefit from being reorganized in a &amp;quot;layered&amp;quot; style more appropriate for current ideas of Scheme modules.&lt;br /&gt;
#: Package: [[media:MeroonV3-2008Mar01.tgz‎|MeroonV3-2008Mar01.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Graphics===&lt;br /&gt;
# '''Octave''': A simple plotting interface using octave (2.x) and gnuplot.&lt;br /&gt;
#: Author: Pierre-Alexandre Fournier&lt;br /&gt;
#: Package: (web page) http://carretechnologies.com/scheme/octave/&lt;br /&gt;
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]&lt;br /&gt;
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]&lt;br /&gt;
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]&lt;br /&gt;
# '''Cairo''': Bindings for cairo graphics.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:Cairo-r2.tgz|Cairo-r2.tgz]] (old: [[media:Cairo-r1.tgz|Cairo-r1.tgz]])&lt;br /&gt;
&lt;br /&gt;
===SQL===&lt;br /&gt;
# '''MySQL FFI''': FFI for mysql.  Unsure about thread-safety, and needs more work&lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/&lt;br /&gt;
# '''MySQL''': Socket level client for mysql. Supports dynamic SQL and now prepared statements. Also includes a SQL abstraction layer. This [http://andrewwhaley.blogspot.com/2009/04/gambit-mysql-client-02.html blog post] has more information.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: [[media:Gambit-mysql.zip|Gambit-mysql.zip]]&lt;br /&gt;
# '''SQLite3''': a minimalistic interface to SQLite3.&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]&lt;br /&gt;
# '''Postgresql''': A socket level client for Postgresql&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]&lt;br /&gt;
&lt;br /&gt;
===Parsing===&lt;br /&gt;
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C&lt;br /&gt;
#: Author: Kirill Lisovsky (updated by Dominique Boucher)&lt;br /&gt;
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]&lt;br /&gt;
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])&lt;br /&gt;
&lt;br /&gt;
=== Language ===&lt;br /&gt;
# '''Gambit on LLVM''': Experimental partial back-end for Gambit using LLVM&lt;br /&gt;
#: Authors: Arnaud Bergeron and Mathieu Larose&lt;br /&gt;
#: Package: [[media:Gambit-LLVM.tgz|Gambit-LLVM.tgz]]&lt;br /&gt;
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler&lt;br /&gt;
#: Author: Marc Feeley and Catherine Gaudron&lt;br /&gt;
#: Package: [[media:Jss-r2.tgz|Jss-r2.tgz]] (old: [[media:Jss-r1.tgz|Jss-r1.tgz]])&lt;br /&gt;
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. &lt;br /&gt;
#: Maintainer: Arthur Smyles&lt;br /&gt;
#: Package: (web page) http://smyles.com/projects/r6gambit/&lt;br /&gt;
# '''PICOBIT''': Very compact Scheme compiler and virtual machine suitable for microcontrollers.&lt;br /&gt;
#: Author: Marc Feeley and Vincent St-Amour&lt;br /&gt;
#: Package: (web page) http://repo.or.cz/w/picobit.git&lt;br /&gt;
&lt;br /&gt;
=== FFI ===&lt;br /&gt;
# '''ffi-related-modules''': various modules dealing with the FFI, and their dependencies (chjmodules, but someone might turn them to using bare namespaces or so; read the Readme file at the below URL)&lt;br /&gt;
#: Author: Christian Jaeger&lt;br /&gt;
#: Package: (web page/git repo) http://scheme.ch/gambit/preview/ffi-related-modules/&lt;br /&gt;
&lt;br /&gt;
===Utilities===&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Bunny Test''': A simple unit testing framework.  &lt;br /&gt;
#: Author: Jonathan Arkell&lt;br /&gt;
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/&lt;br /&gt;
# '''GetOpts''': A syntactic form (let-opts) to parse command line options&lt;br /&gt;
#: Author: Marco Benelli&lt;br /&gt;
#: Package: [[media:GetOpts-r1.tgz|GetOpts-r1.tgz]]&lt;br /&gt;
# '''Etags''': Script that generates Emacs TAGS files from Scheme files, and recognizes nested definitions.&lt;br /&gt;
#: Author: Vincent St-Amour&lt;br /&gt;
#: Package: http://www-etud.iro.umontreal.ca/~stamourv/etags.scm&lt;br /&gt;
# '''Win-control''': Library for controlling Internet Explorer and other Windows applications for scripting or automating testing.&lt;br /&gt;
#: Author: Andrew Whaley&lt;br /&gt;
#: Package: http://code.google.com/p/win-control&lt;br /&gt;
&lt;br /&gt;
=== Full Applications ===&lt;br /&gt;
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.&lt;br /&gt;
#: Author: David St-Hilaire&lt;br /&gt;
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]&lt;br /&gt;
# '''Web Server''': a web server with sessions cookies and server pages.&lt;br /&gt;
#: Author: Francesco Bracchi&lt;br /&gt;
#: Package: [[media:WebServer-r2.tgz|WebServer-r2.tgz]] (old: [[media:WebServer-r1.tgz|WebServer-r1.tgz]])&lt;br /&gt;
#: Git: http://git.berlios.de/cgi-bin/gitweb.cgi?p=futhark;a=summary&lt;br /&gt;
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]&lt;br /&gt;
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games&lt;br /&gt;
#: Author: Joel J. Adamson &lt;br /&gt;
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html&lt;br /&gt;
# '''Genetic Canvas''': A polygon-based image renderer using genetic algorithms.&lt;br /&gt;
#: Author: James Long&lt;br /&gt;
#: Web: http://jlongster.com/blog/2009/05/25/mona-lisa-genetically-drawn-scheme/&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:MeroonV3-2008Mar01.tgz</id>
		<title>File:MeroonV3-2008Mar01.tgz</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:MeroonV3-2008Mar01.tgz"/>
				<updated>2009-10-08T19:32:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Meroon object system, with fixnum specializations.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Meroon object system, with fixnum specializations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks</id>
		<title>Benchmarks</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks"/>
				<updated>2009-06-20T18:03:06Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Some simple operations on large bignums */ If you want to benchmark Gambit, it helps not to use a version of gcc that is known not to optimize Gambit-generated code well&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gambit benchmarks==&lt;br /&gt;
&lt;br /&gt;
Marc Feeley has put together a collection of benchmarks, called the [[Gambit benchmarks]].  The performance of Gambit is compared to a number of other Scheme implementations on that page.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;Programming Language Shootout&amp;quot; benchmarks==&lt;br /&gt;
&lt;br /&gt;
The [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] compares various computer languages by benchmarking similar algorithms to a number of small problems in a number of language implementations.  Here are a number of Gambit implementations of the programs in the [[programming language shootout]].  Please feel free to propose improvements before they're submitted.&lt;br /&gt;
&lt;br /&gt;
==Some simple operations on large bignums==&lt;br /&gt;
&lt;br /&gt;
In a talk Paul Zimmermann defined &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;(expt 3 2095903)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 1183294)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(expt 11 1920505)&amp;lt;/tt&amp;gt;, respectively, (presumably because &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have roughly a million decimal digits, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has roughly 2 million digits) and timed &amp;lt;tt&amp;gt;(* a b)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(quotient c a)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(integer-sqrt c)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(gcd a b)&amp;lt;/tt&amp;gt;.  With&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
heine:~/Desktop&amp;gt; gsi -v&lt;br /&gt;
v4.4.4 20090618172941 x86_64-unknown-linux-gnu &amp;quot;./configure --enable-single-host --enable-multiple-versions&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
running on the machine&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
on Ubuntu 9.04 with FSF gcc-4.2.4 (and adding back -fmove-loop-invariants), we find the times&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    157 ms real time&lt;br /&gt;
    156 ms cpu time (144 user, 12 system)&lt;br /&gt;
    3 collections accounting for 2 ms real time (0 user, 0 system)&lt;br /&gt;
    26078656 bytes allocated&lt;br /&gt;
    4314 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    710 ms real time&lt;br /&gt;
    704 ms cpu time (668 user, 36 system)&lt;br /&gt;
    9 collections accounting for 11 ms real time (8 user, 0 system)&lt;br /&gt;
    130659840 bytes allocated&lt;br /&gt;
    19660 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    698 ms real time&lt;br /&gt;
    692 ms cpu time (656 user, 36 system)&lt;br /&gt;
    21 collections accounting for 12 ms real time (4 user, 8 system)&lt;br /&gt;
    160630392 bytes allocated&lt;br /&gt;
    6332 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    10167 ms real time&lt;br /&gt;
    10137 ms cpu time (10105 user, 32 system)&lt;br /&gt;
    810 collections accounting for 302 ms real time (320 user, 8 system)&lt;br /&gt;
    5055362984 bytes allocated&lt;br /&gt;
    10450 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With GMP 4.2.4 (compiled with the default system compiler gcc-4.3.3), these same operations take 44ms, 220ms, 168ms, and 6052ms, respectively; with GMP 4.3.1 they take 20ms, 88ms, 68ms, and 524ms, respectively.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; are replaced by &amp;lt;tt&amp;gt;(expt 3 20959032)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 11832946)&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;(expt 11 19205051)&amp;lt;/tt&amp;gt;, respectively, so &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have about 10,000,000 decimal digits and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has about 20 million decimal digits, then the Gambit times are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    1421 ms real time&lt;br /&gt;
    1416 ms cpu time (1288 user, 128 system)&lt;br /&gt;
    3 collections accounting for 18 ms real time (0 user, 16 system)&lt;br /&gt;
    209714208 bytes allocated&lt;br /&gt;
    51312 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    6300 ms real time&lt;br /&gt;
    6292 ms cpu time (5988 user, 304 system)&lt;br /&gt;
    8 collections accounting for 48 ms real time (8 user, 48 system)&lt;br /&gt;
    1061819368 bytes allocated&lt;br /&gt;
    121357 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    6596 ms real time&lt;br /&gt;
    6596 ms cpu time (6536 user, 60 system)&lt;br /&gt;
    22 collections accounting for 23 ms real time (0 user, 16 system)&lt;br /&gt;
    1291581376 bytes allocated&lt;br /&gt;
    22536 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    123296 ms real time&lt;br /&gt;
    123256 ms cpu time (123156 user, 100 system)&lt;br /&gt;
    1152 collections accounting for 529 ms real time (492 user, 16 system)&lt;br /&gt;
    53377146424 bytes allocated&lt;br /&gt;
    37776 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The GMP 4.2.4 times are 680ms, 3852ms, 3180ms, and 1008696ms, respectively; the GMP 4.3.1 times are 260ms, 1544ms, 1268ms, and 9992ms, respectively.&lt;br /&gt;
&lt;br /&gt;
So, after the release of GMP 4.3.0 in April, 2009, GMP is decisively faster than Gambit (and Gambit is no longer a reproof to the permanent claim on GMP's home page that GMP is the &amp;quot;fastest bignum library on the planet!&amp;quot;).  Some of the changes that went into GMP 4.3.0 are&lt;br /&gt;
&lt;br /&gt;
Speedups:&lt;br /&gt;
&lt;br /&gt;
* Vastly improved assembly code for x86-64 processors from AMD and Intel.&lt;br /&gt;
* Major improvements also for many other processor families, such as Alpha, PowerPC, and Itanium.&lt;br /&gt;
* New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase gcd code.&lt;br /&gt;
* The multiply FFT code has been slightly improved.&lt;br /&gt;
* Balanced multiplication now uses 4-way Toom in addition to schoolbook, Karatsuba, 3-way Toom, and FFT.&lt;br /&gt;
* Unbalanced multiplication has been vastly improved.&lt;br /&gt;
* Improved schoolbook division by means of faster quotient approximation.&lt;br /&gt;
* Several new algorithms for division and mod by single limbs, giving many-fold speedups.&lt;br /&gt;
* Improved nth root computations.&lt;br /&gt;
* The mpz_nextprime function uses sieving and is much faster.&lt;br /&gt;
* Countless minor tweaks.&lt;br /&gt;
&lt;br /&gt;
Niels Möller introduced the new gcd algorithm; it was based on an algorithm of Schönhage that was never published but was reverse engineered by Brad Lucier for Gambit (after some hints from Schönhage in e-mail) in January 2004. In 2005 Lucier told Möller (who was working on a Schönhage-type gcd algorithm for GMP) about Schönhage's algorithm, and Möller integrated it into GMP's HGCD framework for gcd calculations (and got two publications out of it, too!).  Now that it is actually part of released GMP, GMP's bignum code beats Gambit's bignum code for all relevant bignum operations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks</id>
		<title>Benchmarks</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks"/>
				<updated>2009-06-19T05:01:00Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Some simple operations on large bignums */ Spell Paul Zimmermann's name correctly (sorry!)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gambit benchmarks==&lt;br /&gt;
&lt;br /&gt;
Marc Feeley has put together a collection of benchmarks, called the [[Gambit benchmarks]].  The performance of Gambit is compared to a number of other Scheme implementations on that page.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;Programming Language Shootout&amp;quot; benchmarks==&lt;br /&gt;
&lt;br /&gt;
The [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] compares various computer languages by benchmarking similar algorithms to a number of small problems in a number of language implementations.  Here are a number of Gambit implementations of the programs in the [[programming language shootout]].  Please feel free to propose improvements before they're submitted.&lt;br /&gt;
&lt;br /&gt;
==Some simple operations on large bignums==&lt;br /&gt;
&lt;br /&gt;
In a talk Paul Zimmermann defined &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;(expt 3 2095903)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 1183294)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(expt 11 1920505)&amp;lt;/tt&amp;gt;, respectively, (presumably because &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have roughly a million decimal digits, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has roughly 2 million digits) and timed &amp;lt;tt&amp;gt;(* a b)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(quotient c a)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(integer-sqrt c)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(gcd a b)&amp;lt;/tt&amp;gt;.  With&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
heine:~/Desktop&amp;gt; gsi -v&lt;br /&gt;
v4.4.4 20090618172941 x86_64-unknown-linux-gnu &amp;quot;./configure --enable-single-host --enable-multiple-versions&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
running on the machine&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
on Ubuntu 9.04 with gcc-4.3.3, we find the times&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    183 ms real time&lt;br /&gt;
    180 ms cpu time (172 user, 8 system)&lt;br /&gt;
    3 collections accounting for 2 ms real time (0 user, 0 system)&lt;br /&gt;
    26078656 bytes allocated&lt;br /&gt;
    4313 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    808 ms real time&lt;br /&gt;
    808 ms cpu time (756 user, 52 system)&lt;br /&gt;
    9 collections accounting for 11 ms real time (4 user, 8 system)&lt;br /&gt;
    130659840 bytes allocated&lt;br /&gt;
    19657 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    805 ms real time&lt;br /&gt;
    804 ms cpu time (796 user, 8 system)&lt;br /&gt;
    21 collections accounting for 12 ms real time (12 user, 4 system)&lt;br /&gt;
    160630136 bytes allocated&lt;br /&gt;
    6131 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    11353 ms real time&lt;br /&gt;
    11353 ms cpu time (11325 user, 28 system)&lt;br /&gt;
    810 collections accounting for 304 ms real time (284 user, 4 system)&lt;br /&gt;
    5055362984 bytes allocated&lt;br /&gt;
    10674 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With GMP 4.2.4, these same operations take 44ms, 220ms, 168ms, and 6052ms, respectively; with GMP 4.3.1 they take 20ms, 88ms, 68ms, and 524ms, respectively.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; are replaced by &amp;lt;tt&amp;gt;(expt 3 20959032)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 11832946)&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;(expt 11 19205051)&amp;lt;/tt&amp;gt;, respectively, so &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have about 10,000,000 decimal digits and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has about 20 million decimal digits, then the Gambit times are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))                  &lt;br /&gt;
(time (* a b))&lt;br /&gt;
    1579 ms real time&lt;br /&gt;
    1572 ms cpu time (1452 user, 120 system)&lt;br /&gt;
    3 collections accounting for 18 ms real time (0 user, 16 system)&lt;br /&gt;
    209714208 bytes allocated&lt;br /&gt;
    51308 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))           &lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    7132 ms real time&lt;br /&gt;
    7124 ms cpu time (6772 user, 352 system)&lt;br /&gt;
    11 collections accounting for 66 ms real time (8 user, 68 system)&lt;br /&gt;
    1061819624 bytes allocated&lt;br /&gt;
    161607 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))         &lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    7565 ms real time&lt;br /&gt;
    7528 ms cpu time (7420 user, 108 system)&lt;br /&gt;
    20 collections accounting for 34 ms real time (4 user, 24 system)&lt;br /&gt;
    1291585184 bytes allocated&lt;br /&gt;
    44122 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))                &lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    138545 ms real time&lt;br /&gt;
    138441 ms cpu time (138149 user, 292 system)&lt;br /&gt;
    1152 collections accounting for 542 ms real time (532 user, 20 system)&lt;br /&gt;
    53377143992 bytes allocated&lt;br /&gt;
    42407 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The GMP 4.2.4 times are 680ms, 3852ms, 3180ms, and 1008696ms, respectively; the GMP 4.3.1 times are 260ms, 1544ms, 1268ms, and 9992ms, respectively.&lt;br /&gt;
&lt;br /&gt;
So, after the release of GMP 4.3.0 in April, 2009, GMP is decisively faster than Gambit (and Gambit is no longer a reproof to the permanent claim on GMP's home page that GMP is the &amp;quot;fastest bignum library on the planet!&amp;quot;).  Some of the changes that went into GMP 4.3.0 are&lt;br /&gt;
&lt;br /&gt;
Speedups:&lt;br /&gt;
&lt;br /&gt;
* Vastly improved assembly code for x86-64 processors from AMD and Intel.&lt;br /&gt;
* Major improvements also for many other processor families, such as Alpha, PowerPC, and Itanium.&lt;br /&gt;
* New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase gcd code.&lt;br /&gt;
* The multiply FFT code has been slightly improved.&lt;br /&gt;
* Balanced multiplication now uses 4-way Toom in addition to schoolbook, Karatsuba, 3-way Toom, and FFT.&lt;br /&gt;
* Unbalanced multiplication has been vastly improved.&lt;br /&gt;
* Improved schoolbook division by means of faster quotient approximation.&lt;br /&gt;
* Several new algorithms for division and mod by single limbs, giving many-fold speedups.&lt;br /&gt;
* Improved nth root computations.&lt;br /&gt;
* The mpz_nextprime function uses sieving and is much faster.&lt;br /&gt;
* Countless minor tweaks.&lt;br /&gt;
&lt;br /&gt;
Niels Möller introduced the new gcd algorithm; it was based on an algorithm of Schönhage that was never published but was reverse engineered by Brad Lucier for Gambit (after some hints from Schönhage in e-mail) in January 2004. In 2005 Lucier told Möller (who was working on a Schönhage-type gcd algorithm for GMP) about Schönhage's algorithm, and Möller integrated it into GMP's HGCD framework for gcd calculations (and got two publications out of it, too!).  Now that it is actually part of released GMP, GMP's bignum code beats Gambit's bignum code for all relevant bignum operations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks</id>
		<title>Benchmarks</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks"/>
				<updated>2009-06-18T23:58:37Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Some simple operations on large bignums */  Add times for GMP 4.2.4 and correct one time for GMP 4.3.1.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gambit benchmarks==&lt;br /&gt;
&lt;br /&gt;
Marc Feeley has put together a collection of benchmarks, called the [[Gambit benchmarks]].  The performance of Gambit is compared to a number of other Scheme implementations on that page.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;Programming Language Shootout&amp;quot; benchmarks==&lt;br /&gt;
&lt;br /&gt;
The [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] compares various computer languages by benchmarking similar algorithms to a number of small problems in a number of language implementations.  Here are a number of Gambit implementations of the programs in the [[programming language shootout]].  Please feel free to propose improvements before they're submitted.&lt;br /&gt;
&lt;br /&gt;
==Some simple operations on large bignums==&lt;br /&gt;
&lt;br /&gt;
In a talk Paul Zimmerman defined &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;(expt 3 2095903)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 1183294)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(expt 11 1920505)&amp;lt;/tt&amp;gt;, respectively, (presumably because &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have roughly a million decimal digits, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has roughly 2 million digits) and timed &amp;lt;tt&amp;gt;(* a b)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(quotient c a)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(integer-sqrt c)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(gcd a b)&amp;lt;/tt&amp;gt;.  With&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
heine:~/Desktop&amp;gt; gsi -v&lt;br /&gt;
v4.4.4 20090618172941 x86_64-unknown-linux-gnu &amp;quot;./configure --enable-single-host --enable-multiple-versions&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
running on the machine&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
on Ubuntu 9.04 with gcc-4.3.3, we find the times&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    183 ms real time&lt;br /&gt;
    180 ms cpu time (172 user, 8 system)&lt;br /&gt;
    3 collections accounting for 2 ms real time (0 user, 0 system)&lt;br /&gt;
    26078656 bytes allocated&lt;br /&gt;
    4313 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    808 ms real time&lt;br /&gt;
    808 ms cpu time (756 user, 52 system)&lt;br /&gt;
    9 collections accounting for 11 ms real time (4 user, 8 system)&lt;br /&gt;
    130659840 bytes allocated&lt;br /&gt;
    19657 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    805 ms real time&lt;br /&gt;
    804 ms cpu time (796 user, 8 system)&lt;br /&gt;
    21 collections accounting for 12 ms real time (12 user, 4 system)&lt;br /&gt;
    160630136 bytes allocated&lt;br /&gt;
    6131 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    11353 ms real time&lt;br /&gt;
    11353 ms cpu time (11325 user, 28 system)&lt;br /&gt;
    810 collections accounting for 304 ms real time (284 user, 4 system)&lt;br /&gt;
    5055362984 bytes allocated&lt;br /&gt;
    10674 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With GMP 4.2.4, these same operations take 44ms, 220ms, 168ms, and 6052ms, respectively; with GMP 4.3.1 they take 20ms, 88ms, 68ms, and 524ms, respectively.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; are replaced by &amp;lt;tt&amp;gt;(expt 3 20959032)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 11832946)&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;(expt 11 19205051)&amp;lt;/tt&amp;gt;, respectively, so &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have about 10,000,000 decimal digits and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has about 20 million decimal digits, then the Gambit times are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))                  &lt;br /&gt;
(time (* a b))&lt;br /&gt;
    1579 ms real time&lt;br /&gt;
    1572 ms cpu time (1452 user, 120 system)&lt;br /&gt;
    3 collections accounting for 18 ms real time (0 user, 16 system)&lt;br /&gt;
    209714208 bytes allocated&lt;br /&gt;
    51308 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))           &lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    7132 ms real time&lt;br /&gt;
    7124 ms cpu time (6772 user, 352 system)&lt;br /&gt;
    11 collections accounting for 66 ms real time (8 user, 68 system)&lt;br /&gt;
    1061819624 bytes allocated&lt;br /&gt;
    161607 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))         &lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    7565 ms real time&lt;br /&gt;
    7528 ms cpu time (7420 user, 108 system)&lt;br /&gt;
    20 collections accounting for 34 ms real time (4 user, 24 system)&lt;br /&gt;
    1291585184 bytes allocated&lt;br /&gt;
    44122 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))                &lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    138545 ms real time&lt;br /&gt;
    138441 ms cpu time (138149 user, 292 system)&lt;br /&gt;
    1152 collections accounting for 542 ms real time (532 user, 20 system)&lt;br /&gt;
    53377143992 bytes allocated&lt;br /&gt;
    42407 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The GMP 4.2.4 times are 680ms, 3852ms, 3180ms, and 1008696ms, respectively; the GMP 4.3.1 times are 260ms, 1544ms, 1268ms, and 9992ms, respectively.&lt;br /&gt;
&lt;br /&gt;
So, after the release of GMP 4.3.0 in April, 2009, GMP is decisively faster than Gambit (and Gambit is no longer a reproof to the permanent claim on GMP's home page that GMP is the &amp;quot;fastest bignum library on the planet!&amp;quot;).  Some of the changes that went into GMP 4.3.0 are&lt;br /&gt;
&lt;br /&gt;
Speedups:&lt;br /&gt;
&lt;br /&gt;
* Vastly improved assembly code for x86-64 processors from AMD and Intel.&lt;br /&gt;
* Major improvements also for many other processor families, such as Alpha, PowerPC, and Itanium.&lt;br /&gt;
* New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase gcd code.&lt;br /&gt;
* The multiply FFT code has been slightly improved.&lt;br /&gt;
* Balanced multiplication now uses 4-way Toom in addition to schoolbook, Karatsuba, 3-way Toom, and FFT.&lt;br /&gt;
* Unbalanced multiplication has been vastly improved.&lt;br /&gt;
* Improved schoolbook division by means of faster quotient approximation.&lt;br /&gt;
* Several new algorithms for division and mod by single limbs, giving many-fold speedups.&lt;br /&gt;
* Improved nth root computations.&lt;br /&gt;
* The mpz_nextprime function uses sieving and is much faster.&lt;br /&gt;
* Countless minor tweaks.&lt;br /&gt;
&lt;br /&gt;
Niels Möller introduced the new gcd algorithm; it was based on an algorithm of Schönhage that was never published but was reverse engineered by Brad Lucier for Gambit (after some hints from Schönhage in e-mail) in January 2004. In 2005 Lucier told Möller (who was working on a Schönhage-type gcd algorithm for GMP) about Schönhage's algorithm, and Möller integrated it into GMP's HGCD framework for gcd calculations (and got two publications out of it, too!).  Now that it is actually part of released GMP, GMP's bignum code beats Gambit's bignum code for all relevant bignum operations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks</id>
		<title>Benchmarks</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks"/>
				<updated>2009-06-18T22:13:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Some simple operations on large bignums */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gambit benchmarks==&lt;br /&gt;
&lt;br /&gt;
Marc Feeley has put together a collection of benchmarks, called the [[Gambit benchmarks]].  The performance of Gambit is compared to a number of other Scheme implementations on that page.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;Programming Language Shootout&amp;quot; benchmarks==&lt;br /&gt;
&lt;br /&gt;
The [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] compares various computer languages by benchmarking similar algorithms to a number of small problems in a number of language implementations.  Here are a number of Gambit implementations of the programs in the [[programming language shootout]].  Please feel free to propose improvements before they're submitted.&lt;br /&gt;
&lt;br /&gt;
==Some simple operations on large bignums==&lt;br /&gt;
&lt;br /&gt;
In a talk Paul Zimmerman defined &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;(expt 3 2095903)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 1183294)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(expt 11 1920505)&amp;lt;/tt&amp;gt;, respectively, (presumably because &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have roughly a million decimal digits, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has roughly 2 million digits) and timed &amp;lt;tt&amp;gt;(* a b)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(quotient c a)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(integer-sqrt c)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(gcd a b)&amp;lt;/tt&amp;gt;.  With&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
heine:~/Desktop&amp;gt; gsi -v&lt;br /&gt;
v4.4.4 20090618172941 x86_64-unknown-linux-gnu &amp;quot;./configure --enable-single-host --enable-multiple-versions&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
running on the machine&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
on Ubuntu 9.04 with gcc-4.3.3, we find the times&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    183 ms real time&lt;br /&gt;
    180 ms cpu time (172 user, 8 system)&lt;br /&gt;
    3 collections accounting for 2 ms real time (0 user, 0 system)&lt;br /&gt;
    26078656 bytes allocated&lt;br /&gt;
    4313 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    808 ms real time&lt;br /&gt;
    808 ms cpu time (756 user, 52 system)&lt;br /&gt;
    9 collections accounting for 11 ms real time (4 user, 8 system)&lt;br /&gt;
    130659840 bytes allocated&lt;br /&gt;
    19657 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    805 ms real time&lt;br /&gt;
    804 ms cpu time (796 user, 8 system)&lt;br /&gt;
    21 collections accounting for 12 ms real time (12 user, 4 system)&lt;br /&gt;
    160630136 bytes allocated&lt;br /&gt;
    6131 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    11353 ms real time&lt;br /&gt;
    11353 ms cpu time (11325 user, 28 system)&lt;br /&gt;
    810 collections accounting for 304 ms real time (284 user, 4 system)&lt;br /&gt;
    5055362984 bytes allocated&lt;br /&gt;
    10674 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With gmp-4.3.1 these same operations take 20ms, 88ms, 68ms, and 524ms, respectively.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; are replaced by &amp;lt;tt&amp;gt;(expt 3 20959032)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 11832946)&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;(expt 11 19205051)&amp;lt;/tt&amp;gt;, respectively, so &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have about 10,000,000 decimal digits and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has about 20 million decimal digits, then the Gambit times are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))                  &lt;br /&gt;
(time (* a b))&lt;br /&gt;
    1579 ms real time&lt;br /&gt;
    1572 ms cpu time (1452 user, 120 system)&lt;br /&gt;
    3 collections accounting for 18 ms real time (0 user, 16 system)&lt;br /&gt;
    209714208 bytes allocated&lt;br /&gt;
    51308 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))           &lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    7132 ms real time&lt;br /&gt;
    7124 ms cpu time (6772 user, 352 system)&lt;br /&gt;
    11 collections accounting for 66 ms real time (8 user, 68 system)&lt;br /&gt;
    1061819624 bytes allocated&lt;br /&gt;
    161607 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))         &lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    7565 ms real time&lt;br /&gt;
    7528 ms cpu time (7420 user, 108 system)&lt;br /&gt;
    20 collections accounting for 34 ms real time (4 user, 24 system)&lt;br /&gt;
    1291585184 bytes allocated&lt;br /&gt;
    44122 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))                &lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    138545 ms real time&lt;br /&gt;
    138441 ms cpu time (138149 user, 292 system)&lt;br /&gt;
    1152 collections accounting for 542 ms real time (532 user, 20 system)&lt;br /&gt;
    53377143992 bytes allocated&lt;br /&gt;
    42407 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and the GMP 4.3.1 times are 26ms, 1544ms, 1268ms, and 9992ms, respectively.&lt;br /&gt;
&lt;br /&gt;
So, after the release of GMP 4.3.0 in April, 2009, GMP is decisively faster than Gambit (and Gambit is no longer a reproof to the permanent claim on GMP's home page that GMP is the &amp;quot;fastest bignum library on the planet!&amp;quot;).  Some of the changes that went into GMP 4.3.0 are&lt;br /&gt;
&lt;br /&gt;
Speedups:&lt;br /&gt;
&lt;br /&gt;
* Vastly improved assembly code for x86-64 processors from AMD and Intel.&lt;br /&gt;
* Major improvements also for many other processor families, such as Alpha, PowerPC, and Itanium.&lt;br /&gt;
* New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase gcd code.&lt;br /&gt;
* The multiply FFT code has been slightly improved.&lt;br /&gt;
* Balanced multiplication now uses 4-way Toom in addition to schoolbook, Karatsuba, 3-way Toom, and FFT.&lt;br /&gt;
* Unbalanced multiplication has been vastly improved.&lt;br /&gt;
* Improved schoolbook division by means of faster quotient approximation.&lt;br /&gt;
* Several new algorithms for division and mod by single limbs, giving many-fold speedups.&lt;br /&gt;
* Improved nth root computations.&lt;br /&gt;
* The mpz_nextprime function uses sieving and is much faster.&lt;br /&gt;
* Countless minor tweaks.&lt;br /&gt;
&lt;br /&gt;
Niels Möller introduced the new gcd algorithm; it was based on an algorithm of Schönhage that was never published but was reverse engineered by Brad Lucier for Gambit (after some hints from Schönhage in e-mail) in January 2004. In 2005 Lucier told Möller (who was working on a Schönhage-type gcd algorithm for GMP) about Schönhage's algorithm, and Möller integrated it into GMP's HGCD framework for gcd calculations (and got two publications out of it, too!).  Now that it is actually part of released GMP, GMP's bignum code beats Gambit's bignum code for all relevant bignum operations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page"/>
				<updated>2009-06-18T22:11:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
The Gambit Scheme system is a complete, portable, efficient and reliable implementation&lt;br /&gt;
of the [[Scheme | Scheme programming language]].&lt;br /&gt;
&lt;br /&gt;
This web site is intended for users of the Gambit Scheme system.  It is a place where various&lt;br /&gt;
resources are collected and where users can exchange information related to Gambit.&lt;br /&gt;
&lt;br /&gt;
'''Download latest release (v4.4.4):'''&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/source/gambc-v4_4_4-devel.tgz Development Sources],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/prebuilt/gambc-v4_4_4-macosx-intel32.dmg Mac OS X installer (for Intel 32)],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/prebuilt/gambc-v4_4_4-windows-mingw.exe Windows installer]&lt;br /&gt;
(for other releases see the [[distributions]]).&lt;br /&gt;
&lt;br /&gt;
==What's Gambit?==&lt;br /&gt;
&lt;br /&gt;
Gambit consists of two main programs: '''gsi''', the Gambit Scheme interpreter, and '''gsc''', the Gambit Scheme compiler.&lt;br /&gt;
The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time.  Interpreted code and compiled code can be freely mixed.&lt;br /&gt;
&lt;br /&gt;
Gambit-C is a version of the Gambit programming system in which the&lt;br /&gt;
compiler generates portable C code.  The main features of Gambit-C are:&lt;br /&gt;
&lt;br /&gt;
* '''Conformance.'''  The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards and implements all optional features.  Tail calls and first class continuations conform to the Scheme semantics.  The full numeric tower is implemented, including: arbitrary precision integers (bignums), rationals, inexact reals (floating point numbers), and complex numbers.  Several extensions to Scheme are provided, including: lightweight threads, a foreign-function interface (FFI), and extended I/O capabilities (Unicode, networking, subprocesses, ...).&lt;br /&gt;
* '''Portability.'''  Because the system is mostly written in Scheme and the compiler generates portable C code, it is easy to port the system as well as programs compiled with it to any platform with a decent C or C++ compiler.  There is no reliance on a particular C compiler, although the system can take advantage of some '''gcc'''-specific constructs.  The C code generated is oblivious to the endianness and word size of the target environment (32 and 64 bit architectures are currently supported).&lt;br /&gt;
* '''Performance.'''  The compiler includes several powerful program transformations such as user procedure inlining, partial-evaluation, and lambda-lifting.  With appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs.  Programs containing no declarations are also optimized without compromising the Scheme semantics by speculatively inlining predefined procedures (see the [[benchmarks]] page for a comparison with other Scheme implementations and other languages).  Thanks to an efficient implementation of continuations, the thread system is very efficient and can support millions of concurrent threads.  The bignum library uses sophisticated algorithms that are in some cases asymptotically faster than those of GMP (GNU Multiple Precision Arithmetic Library). [Note: With the release of GMP 4.3.0 in April 2009, this claim is no longer true; see the [[benchmarks]] page for some crude comparisons on large integers.]&lt;br /&gt;
* '''Reliability.'''  Stable releases typically have very few bugs.  Bug tracking is done with [http://www.bugzilla.org/ bugzilla].  Gambit-C has been used to develop large-scale real-world software in academic and commercial settings.&lt;br /&gt;
&lt;br /&gt;
==Getting Gambit==&lt;br /&gt;
&lt;br /&gt;
Gambit is available as prebuilt and source code [[distributions]].  There are prebuilt distributions for Mac OS X, Microsoft Windows, and other operating systems.  The source code distributions must be compiled with a C or C++ compiler.  The latest sources are available in the [[Source code repository | source code repository]]. It can be accessed using&lt;br /&gt;
the [http://git.or.cz/ git] distributed version control system.&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Documentation]] is available.&lt;br /&gt;
&lt;br /&gt;
==Support==&lt;br /&gt;
&lt;br /&gt;
Come chat with us in the #gambit channel on [http://www.mibbit.com Freenode IRC].&lt;br /&gt;
&lt;br /&gt;
==Contributing==&lt;br /&gt;
&lt;br /&gt;
Learn [[how to contribute]] to Gambit's development.&lt;br /&gt;
&lt;br /&gt;
===Reporting bugs===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/bugzilla/ Gambit bugzilla]&lt;br /&gt;
&lt;br /&gt;
===Source repository===&lt;br /&gt;
&lt;br /&gt;
[[Source code repository | Gambit Git repo]]&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
&lt;br /&gt;
Gambit is Copyright &amp;amp;copy; 1994-2008 by Marc Feeley.&lt;br /&gt;
It is released under a dual LGPL and Apache 2 license. You&lt;br /&gt;
can choose whichever license you prefer:&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/copyleft/lesser.html LGPL version 2.1 license]&lt;br /&gt;
* [http://www.apache.org/licenses/LICENSE-2.0.html Apache version 2.0 license]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks</id>
		<title>Benchmarks</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks"/>
				<updated>2009-06-18T22:02:37Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Some simple operations on large bignums */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gambit benchmarks==&lt;br /&gt;
&lt;br /&gt;
Marc Feeley has put together a collection of benchmarks, called the [[Gambit benchmarks]].  The performance of Gambit is compared to a number of other Scheme implementations on that page.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;Programming Language Shootout&amp;quot; benchmarks==&lt;br /&gt;
&lt;br /&gt;
The [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] compares various computer languages by benchmarking similar algorithms to a number of small problems in a number of language implementations.  Here are a number of Gambit implementations of the programs in the [[programming language shootout]].  Please feel free to propose improvements before they're submitted.&lt;br /&gt;
&lt;br /&gt;
==Some simple operations on large bignums==&lt;br /&gt;
&lt;br /&gt;
In a talk Paul Zimmerman defined &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;(expt 3 2095903)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 1183294)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(expt 11 1920505)&amp;lt;/tt&amp;gt;, respectively, (presumably because &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have roughly a million decimal digits, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has roughly 2 million digits) and timed &amp;lt;tt&amp;gt;(* a b)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(quotient c a)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(integer-sqrt c)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(gcd a b)&amp;lt;/tt&amp;gt;.  With&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
heine:~/Desktop&amp;gt; gsi -v&lt;br /&gt;
v4.4.4 20090618172941 x86_64-unknown-linux-gnu &amp;quot;./configure --enable-single-host --enable-multiple-versions&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
running on the machine&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
on Ubuntu 9.04 with gcc-4.3.3, we find the times&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    183 ms real time&lt;br /&gt;
    180 ms cpu time (172 user, 8 system)&lt;br /&gt;
    3 collections accounting for 2 ms real time (0 user, 0 system)&lt;br /&gt;
    26078656 bytes allocated&lt;br /&gt;
    4313 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    808 ms real time&lt;br /&gt;
    808 ms cpu time (756 user, 52 system)&lt;br /&gt;
    9 collections accounting for 11 ms real time (4 user, 8 system)&lt;br /&gt;
    130659840 bytes allocated&lt;br /&gt;
    19657 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    805 ms real time&lt;br /&gt;
    804 ms cpu time (796 user, 8 system)&lt;br /&gt;
    21 collections accounting for 12 ms real time (12 user, 4 system)&lt;br /&gt;
    160630136 bytes allocated&lt;br /&gt;
    6131 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    11353 ms real time&lt;br /&gt;
    11353 ms cpu time (11325 user, 28 system)&lt;br /&gt;
    810 collections accounting for 304 ms real time (284 user, 4 system)&lt;br /&gt;
    5055362984 bytes allocated&lt;br /&gt;
    10674 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With gmp-4.3.1 these same operations take 20ms, 88ms, 68ms, and 524ms, respectively.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; are replaced by &amp;lt;tt&amp;gt;(expt 3 20959032)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 11832946)&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;(expt 11 19205051)&amp;lt;/tt&amp;gt;, respectively, so &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have about 10,000,000 decimal digits and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has about 20 million decimal digits, then the Gambit times are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))                  &lt;br /&gt;
(time (* a b))&lt;br /&gt;
    1579 ms real time&lt;br /&gt;
    1572 ms cpu time (1452 user, 120 system)&lt;br /&gt;
    3 collections accounting for 18 ms real time (0 user, 16 system)&lt;br /&gt;
    209714208 bytes allocated&lt;br /&gt;
    51308 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))           &lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    7132 ms real time&lt;br /&gt;
    7124 ms cpu time (6772 user, 352 system)&lt;br /&gt;
    11 collections accounting for 66 ms real time (8 user, 68 system)&lt;br /&gt;
    1061819624 bytes allocated&lt;br /&gt;
    161607 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))         &lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    7565 ms real time&lt;br /&gt;
    7528 ms cpu time (7420 user, 108 system)&lt;br /&gt;
    20 collections accounting for 34 ms real time (4 user, 24 system)&lt;br /&gt;
    1291585184 bytes allocated&lt;br /&gt;
    44122 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))                &lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    138545 ms real time&lt;br /&gt;
    138441 ms cpu time (138149 user, 292 system)&lt;br /&gt;
    1152 collections accounting for 542 ms real time (532 user, 20 system)&lt;br /&gt;
    53377143992 bytes allocated&lt;br /&gt;
    42407 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and the GMP 4.3.1 times are 26ms, 1544ms, 1268ms, and 9992ms, respectively.&lt;br /&gt;
&lt;br /&gt;
So, GMP 4.3.1 is decisively faster (and Gambit is no longer a reproof to the permanent claim on GMP's home page that GMP is the &amp;quot;fastest bignum library on the planet!&amp;quot;).  Some of the changes that went into GMP 4.3.0 are&lt;br /&gt;
&lt;br /&gt;
Speedups:&lt;br /&gt;
&lt;br /&gt;
* Vastly improved assembly code for x86-64 processors from AMD and Intel.&lt;br /&gt;
* Major improvements also for many other processor families, such as Alpha, PowerPC, and Itanium.&lt;br /&gt;
* New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase gcd code.&lt;br /&gt;
* The multiply FFT code has been slightly improved.&lt;br /&gt;
* Balanced multiplication now uses 4-way Toom in addition to schoolbook, Karatsuba, 3-way Toom, and FFT.&lt;br /&gt;
* Unbalanced multiplication has been vastly improved.&lt;br /&gt;
* Improved schoolbook division by means of faster quotient approximation.&lt;br /&gt;
* Several new algorithms for division and mod by single limbs, giving many-fold speedups.&lt;br /&gt;
* Improved nth root computations.&lt;br /&gt;
* The mpz_nextprime function uses sieving and is much faster.&lt;br /&gt;
* Countless minor tweaks.&lt;br /&gt;
&lt;br /&gt;
Niels Möller introduced the new gcd algorithm; it was based on an algorithm of Schönhage that was never published but was reverse engineered by Brad Lucier for Gambit (after some hints from Schönhage in e-mail) in January 2004. In 2005 Lucier told Möller (who was working on a Schönhage-type gcd algorithm for GMP) about Schönhage's algorithm, and Möller integrated it into GMP's HGCD framework for gcd calculations (and got two publications out of it, too!).  Now that it is actually part of released GMP, GMP's bignum code beats Gambit's bignum code for all relevant bignum operations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks</id>
		<title>Benchmarks</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Benchmarks"/>
				<updated>2009-06-18T21:53:49Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Document how recent gmp beats Gambit in bignum benchmarks.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Gambit benchmarks==&lt;br /&gt;
&lt;br /&gt;
Marc Feeley has put together a collection of benchmarks, called the [[Gambit benchmarks]].  The performance of Gambit is compared to a number of other Scheme implementations on that page.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;Programming Language Shootout&amp;quot; benchmarks==&lt;br /&gt;
&lt;br /&gt;
The [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] compares various computer languages by benchmarking similar algorithms to a number of small problems in a number of language implementations.  Here are a number of Gambit implementations of the programs in the [[programming language shootout]].  Please feel free to propose improvements before they're submitted.&lt;br /&gt;
&lt;br /&gt;
==Some simple operations on large bignums==&lt;br /&gt;
&lt;br /&gt;
In a talk Paul Zimmerman defined &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; to be &amp;lt;tt&amp;gt;(expt 3 2095903)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 1183294)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(expt 11 1920505)&amp;lt;/tt&amp;gt;, respectively, (presumably because &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have roughly a million decimal digits, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has roughly 2 million digits) and timed &amp;lt;tt&amp;gt;(* a b)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(quotient c a)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(integer-sqrt c)&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;(gcd a b)&amp;lt;/tt&amp;gt;.  With&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
heine:~/Desktop&amp;gt; gsi -v&lt;br /&gt;
v4.4.4 20090618172941 x86_64-unknown-linux-gnu &amp;quot;./configure --enable-single-host --enable-multiple-versions&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
running on the machine&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
on Ubuntu 9.04 with gcc-4.3.3, we find the times&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))&lt;br /&gt;
(time (* a b))&lt;br /&gt;
    183 ms real time&lt;br /&gt;
    180 ms cpu time (172 user, 8 system)&lt;br /&gt;
    3 collections accounting for 2 ms real time (0 user, 0 system)&lt;br /&gt;
    26078656 bytes allocated&lt;br /&gt;
    4313 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))&lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    808 ms real time&lt;br /&gt;
    808 ms cpu time (756 user, 52 system)&lt;br /&gt;
    9 collections accounting for 11 ms real time (4 user, 8 system)&lt;br /&gt;
    130659840 bytes allocated&lt;br /&gt;
    19657 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))&lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    805 ms real time&lt;br /&gt;
    804 ms cpu time (796 user, 8 system)&lt;br /&gt;
    21 collections accounting for 12 ms real time (12 user, 4 system)&lt;br /&gt;
    160630136 bytes allocated&lt;br /&gt;
    6131 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))&lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    11353 ms real time&lt;br /&gt;
    11353 ms cpu time (11325 user, 28 system)&lt;br /&gt;
    810 collections accounting for 304 ms real time (284 user, 4 system)&lt;br /&gt;
    5055362984 bytes allocated&lt;br /&gt;
    10674 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
With gmp-4.3.1 these same operations take 20ms, 88ms, 68ms, and 524ms, respectively.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; are replaced by &amp;lt;tt&amp;gt;(expt 3 20959032)&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;(expt 7 11832946)&amp;lt;/tt&amp;gt;, and&lt;br /&gt;
&amp;lt;tt&amp;gt;(expt 11 19205051)&amp;lt;/tt&amp;gt;, respectively, so &amp;lt;tt&amp;gt;a&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;b&amp;lt;/tt&amp;gt; have about 10,000,000 decimal digits and &amp;lt;tt&amp;gt;c&amp;lt;/tt&amp;gt; has about 20 million decimal digits, then the Gambit times are&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;gt; (define d (time (* a b)))                  &lt;br /&gt;
(time (* a b))&lt;br /&gt;
    1579 ms real time&lt;br /&gt;
    1572 ms cpu time (1452 user, 120 system)&lt;br /&gt;
    3 collections accounting for 18 ms real time (0 user, 16 system)&lt;br /&gt;
    209714208 bytes allocated&lt;br /&gt;
    51308 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define e (time (quotient c a)))           &lt;br /&gt;
(time (quotient c a))&lt;br /&gt;
    7132 ms real time&lt;br /&gt;
    7124 ms cpu time (6772 user, 352 system)&lt;br /&gt;
    11 collections accounting for 66 ms real time (8 user, 68 system)&lt;br /&gt;
    1061819624 bytes allocated&lt;br /&gt;
    161607 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define f (time (integer-sqrt c)))         &lt;br /&gt;
(time (integer-sqrt c))&lt;br /&gt;
    7565 ms real time&lt;br /&gt;
    7528 ms cpu time (7420 user, 108 system)&lt;br /&gt;
    20 collections accounting for 34 ms real time (4 user, 24 system)&lt;br /&gt;
    1291585184 bytes allocated&lt;br /&gt;
    44122 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;gt; (define g (time (gcd a b)))                &lt;br /&gt;
(time (gcd a b))&lt;br /&gt;
    138545 ms real time&lt;br /&gt;
    138441 ms cpu time (138149 user, 292 system)&lt;br /&gt;
    1152 collections accounting for 542 ms real time (532 user, 20 system)&lt;br /&gt;
    53377143992 bytes allocated&lt;br /&gt;
    42407 minor faults&lt;br /&gt;
    no major faults&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and the GMP 4.3.1 times are 26ms, 1544ms, 1268ms, and 9992ms, respectively.&lt;br /&gt;
&lt;br /&gt;
So, GMP 4.3.1 is decisively faster (and we are no longer living in &amp;quot;Backwards World&amp;quot;!).  Some of the changes that went into GMP 4.3.0 are&lt;br /&gt;
&lt;br /&gt;
Speedups:&lt;br /&gt;
&lt;br /&gt;
* Vastly improved assembly code for x86-64 processors from AMD and Intel.&lt;br /&gt;
* Major improvements also for many other processor families, such as Alpha, PowerPC, and Itanium.&lt;br /&gt;
* New sub-quadratic mpn_gcd and mpn_gcdext, as well as improved basecase gcd code.&lt;br /&gt;
* The multiply FFT code has been slightly improved.&lt;br /&gt;
* Balanced multiplication now uses 4-way Toom in addition to schoolbook, Karatsuba, 3-way Toom, and FFT.&lt;br /&gt;
* Unbalanced multiplication has been vastly improved.&lt;br /&gt;
* Improved schoolbook division by means of faster quotient approximation.&lt;br /&gt;
* Several new algorithms for division and mod by single limbs, giving many-fold speedups.&lt;br /&gt;
* Improved nth root computations.&lt;br /&gt;
* The mpz_nextprime function uses sieving and is much faster.&lt;br /&gt;
* Countless minor tweaks.&lt;br /&gt;
&lt;br /&gt;
Niels Möller introduced the new gcd algorithm; it was based on an algorithm of Schönhage that was never published but was reverse engineered by Brad Lucier for Gambit (after some hints from Schönhage in e-mail) in January 2004. In 2005 Lucier told Möller (who was working on a Schönhage-type gcd algorithm for GMP) about Schönhage's algorithm, and Möller integrated it into GMP's HGCD framework for gcd calculations (and got two publications out of it, too!).  Now that it is actually part of released GMP, GMP's bignum code beats Gambit's bignum code for all relevant bignum operations.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page"/>
				<updated>2009-06-18T20:55:28Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: GMP now beats Gambit in all bignum operations, blah.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
The Gambit Scheme system is a complete, portable, efficient and reliable implementation&lt;br /&gt;
of the [[Scheme | Scheme programming language]].&lt;br /&gt;
&lt;br /&gt;
This web site is intended for users of the Gambit Scheme system.  It is a place where various&lt;br /&gt;
resources are collected and where users can exchange information related to Gambit.&lt;br /&gt;
&lt;br /&gt;
'''Download latest release (v4.4.4):'''&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/source/gambc-v4_4_4-devel.tgz Development Sources],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/prebuilt/gambc-v4_4_4-macosx-intel32.dmg Mac OS X installer (for Intel 32)],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/prebuilt/gambc-v4_4_4-windows-mingw.exe Windows installer]&lt;br /&gt;
(for other releases see the [[distributions]]).&lt;br /&gt;
&lt;br /&gt;
==What's Gambit?==&lt;br /&gt;
&lt;br /&gt;
Gambit consists of two main programs: '''gsi''', the Gambit Scheme interpreter, and '''gsc''', the Gambit Scheme compiler.&lt;br /&gt;
The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time.  Interpreted code and compiled code can be freely mixed.&lt;br /&gt;
&lt;br /&gt;
Gambit-C is a version of the Gambit programming system in which the&lt;br /&gt;
compiler generates portable C code.  The main features of Gambit-C are:&lt;br /&gt;
&lt;br /&gt;
* '''Conformance.'''  The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards and implements all optional features.  Tail calls and first class continuations conform to the Scheme semantics.  The full numeric tower is implemented, including: arbitrary precision integers (bignums), rationals, inexact reals (floating point numbers), and complex numbers.  Several extensions to Scheme are provided, including: lightweight threads, a foreign-function interface (FFI), and extended I/O capabilities (Unicode, networking, subprocesses, ...).&lt;br /&gt;
* '''Portability.'''  Because the system is mostly written in Scheme and the compiler generates portable C code, it is easy to port the system as well as programs compiled with it to any platform with a decent C or C++ compiler.  There is no reliance on a particular C compiler, although the system can take advantage of some '''gcc'''-specific constructs.  The C code generated is oblivious to the endianness and word size of the target environment (32 and 64 bit architectures are currently supported).&lt;br /&gt;
* '''Performance.'''  The compiler includes several powerful program transformations such as user procedure inlining, partial-evaluation, and lambda-lifting.  With appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs.  Programs containing no declarations are also optimized without compromising the Scheme semantics by speculatively inlining predefined procedures (see the [[benchmarks]] page for a comparison with other Scheme implementations and other languages).  Thanks to an efficient implementation of continuations, the thread system is very efficient and can support millions of concurrent threads.  The bignum library uses sophisticated algorithms that are in some cases asymptotically faster than those of GMP (GNU Multiple Precision Arithmetic Library). [Note: With the release of GMP 4.3.0 this claim is no longer true; see the [[benchmarks]] page for some crude comparisons on large integers.]&lt;br /&gt;
* '''Reliability.'''  Stable releases typically have very few bugs.  Bug tracking is done with [http://www.bugzilla.org/ bugzilla].  Gambit-C has been used to develop large-scale real-world software in academic and commercial settings.&lt;br /&gt;
&lt;br /&gt;
==Getting Gambit==&lt;br /&gt;
&lt;br /&gt;
Gambit is available as prebuilt and source code [[distributions]].  There are prebuilt distributions for Mac OS X, Microsoft Windows, and other operating systems.  The source code distributions must be compiled with a C or C++ compiler.  The latest sources are available in the [[Source code repository | source code repository]]. It can be accessed using&lt;br /&gt;
the [http://git.or.cz/ git] distributed version control system.&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Documentation]] is available.&lt;br /&gt;
&lt;br /&gt;
==Support==&lt;br /&gt;
&lt;br /&gt;
Come chat with us in the #gambit channel on [http://www.mibbit.com Freenode IRC].&lt;br /&gt;
&lt;br /&gt;
==Contributing==&lt;br /&gt;
&lt;br /&gt;
Learn [[how to contribute]] to Gambit's development.&lt;br /&gt;
&lt;br /&gt;
===Reporting bugs===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/bugzilla/ Gambit bugzilla]&lt;br /&gt;
&lt;br /&gt;
===Source repository===&lt;br /&gt;
&lt;br /&gt;
[[Source code repository | Gambit Git repo]]&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
&lt;br /&gt;
Gambit is Copyright &amp;amp;copy; 1994-2008 by Marc Feeley.&lt;br /&gt;
It is released under a dual LGPL and Apache 2 license. You&lt;br /&gt;
can choose whichever license you prefer:&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/copyleft/lesser.html LGPL version 2.1 license]&lt;br /&gt;
* [http://www.apache.org/licenses/LICENSE-2.0.html Apache version 2.0 license]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_nsieve-bits</id>
		<title>Programming language shootout: nsieve-bits</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_nsieve-bits"/>
				<updated>2009-03-24T00:54:45Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=nsievebits&amp;amp;lang=all nsieve-bits] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
;; $Id: nsieve-bits.scm,v 1.2 2008/02/17 23:44:02 lucier Exp lucier $&lt;br /&gt;
;; The Great Computer Language Shootout&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; nsieve benchmark for The Computer Language Shootout&lt;br /&gt;
;; Written by Dima Dorfman, 2004&lt;br /&gt;
;; Converted to MzScheme by Brent Fulgham&lt;br /&gt;
;; Converted to Gambit by Bradley Lucier&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(fixnum)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define (nsieve m)&lt;br /&gt;
  &lt;br /&gt;
  (define (make-bvector n val)&lt;br /&gt;
    (make-u8vector (quotient (+ n 7) 8)&lt;br /&gt;
		   (if val 255 0)))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-true? a i)&lt;br /&gt;
    (not (zero? (fxand (u8vector-ref a (quotient i 8))&lt;br /&gt;
		       (fxarithmetic-shift-left 1 (remainder i 8))))))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-clear! a i)&lt;br /&gt;
    (let* ((index (quotient i 8))&lt;br /&gt;
	   (byte (u8vector-ref a index))&lt;br /&gt;
	   (mask (fxarithmetic-shift-left 1 (remainder i 8))))&lt;br /&gt;
      (u8vector-set! a index (fxand byte (fxnot mask)))))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-set! a i)&lt;br /&gt;
    (let* ((index (quotient i 8))&lt;br /&gt;
	   (byte (u8vector-ref a index))&lt;br /&gt;
	   (mask (fxarithmetic-shift-left 1 (remainder i 8))))&lt;br /&gt;
      (u8vector-set! a index (fxior byte mask))))&lt;br /&gt;
  &lt;br /&gt;
  (let ((a (make-bvector m #t)))&lt;br /&gt;
    (let loop ((i 2)&lt;br /&gt;
	       (n 0))&lt;br /&gt;
      (if (&amp;lt; i m)&lt;br /&gt;
	  (if (bvector-true? a i)&lt;br /&gt;
	      (let clear ((j (+ i i)))&lt;br /&gt;
		(if (&amp;lt; j m)&lt;br /&gt;
		    (begin&lt;br /&gt;
		      (bvector-clear! a j)&lt;br /&gt;
		      (clear (+ j i)))&lt;br /&gt;
		    (loop (+ 1 i)&lt;br /&gt;
			  (+ 1 n))))&lt;br /&gt;
	      (loop (+ 1 i) n))&lt;br /&gt;
	  n))))&lt;br /&gt;
&lt;br /&gt;
(define (test n)&lt;br /&gt;
  &lt;br /&gt;
  (define (string-pad s n)&lt;br /&gt;
    (string-append (make-string (- n (string-length s)) #\space)&lt;br /&gt;
		   s))&lt;br /&gt;
  &lt;br /&gt;
  (let* ((m (* (expt 2 n) 10000))&lt;br /&gt;
	 (count (nsieve m)))&lt;br /&gt;
    (display (list &amp;quot;Primes up to &amp;quot;&lt;br /&gt;
		   (string-pad (number-&amp;gt;string m) 8)&lt;br /&gt;
		   &amp;quot; &amp;quot;&lt;br /&gt;
		   (string-pad (number-&amp;gt;string count) 8)&lt;br /&gt;
		   #\newline))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(define (main arg)&lt;br /&gt;
  &lt;br /&gt;
  (let ((n (string-&amp;gt;number arg)))&lt;br /&gt;
    (if (not n)&lt;br /&gt;
	(begin&lt;br /&gt;
	  (display &amp;quot;An integer is required&amp;quot;) (newline) 2)&lt;br /&gt;
	(begin&lt;br /&gt;
	  (if (&amp;gt;= n 0) (test n))&lt;br /&gt;
	  (if (&amp;gt;= n 1) (test (- n 1)))&lt;br /&gt;
	  (if (&amp;gt;= n 2) (test (- n 2)))&lt;br /&gt;
	  0))))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc nsieve-bits&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi nsieve-bits 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Configure_script_options</id>
		<title>Configure script options</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Configure_script_options"/>
				<updated>2009-02-25T20:20:33Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: remove old stuff about versions of gcc, which recent configuration changes made irrelevant&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The configure script, which was generated by the&lt;br /&gt;
[http://www.gnu.org/software/autoconf autoconf] tool,&lt;br /&gt;
accepts command line options that control various features.  It is&lt;br /&gt;
'''highly''' recommended to use the --enable-single-host option to&lt;br /&gt;
improve the execution speed and compactness of the executables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-single-host&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This option is not used by default because compilation is much longer&lt;br /&gt;
and requires much more RAM.  In fact some platforms may not have&lt;br /&gt;
enough resources to build the system this way.  With&lt;br /&gt;
--enable-single-host the build takes roughly 500 megabytes and 20&lt;br /&gt;
minutes on a 1.2 GHz Athlon Linux machine with the GCC 3.1 compiler&lt;br /&gt;
instead of 100 megabytes and 2 minutes when --enable-single-host is&lt;br /&gt;
not used.  However, the speed of the Gambit-C interpreter improves by&lt;br /&gt;
a factor of 2 as a result.&lt;br /&gt;
&lt;br /&gt;
It is also '''highly''' recommended to use the GCC compiler to build&lt;br /&gt;
the system as the source code can take advantage of some GCC&lt;br /&gt;
extensions.  Notably the use of GCC's computed gotos reduces the&lt;br /&gt;
execution time by roughly 35%.&lt;br /&gt;
&lt;br /&gt;
We recommend that users build Gambit-C with GCC 3.1 or later, as&lt;br /&gt;
these versions will generally produce faster code than&lt;br /&gt;
previous versions of GCC.&lt;br /&gt;
&lt;br /&gt;
==Other options of the configure script==&lt;br /&gt;
&lt;br /&gt;
The detailed list of options accepted by the &amp;quot;configure&amp;quot; script can be&lt;br /&gt;
obtained with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most options are the same as for other autoconf generated configure&lt;br /&gt;
scripts.  For example, you can select the installation directory with&lt;br /&gt;
the option --prefix:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --prefix=/u/feeley/my-gambit&lt;br /&gt;
make install&lt;br /&gt;
~/my-gambit/bin/gsi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the --prefix option is not used, the default is to install all&lt;br /&gt;
files in /usr/local/Gambit-C and its subdirectories.&lt;br /&gt;
&lt;br /&gt;
The configure options which are specific to the Gambit-C system are:&lt;br /&gt;
&lt;br /&gt;
  --enable-single-host    compile each Scheme module as a single C function&lt;br /&gt;
  --enable-cplusplus      compile using C++ compiler&lt;br /&gt;
  --enable-guide          include the Gambit Universal IDE (currently broken)&lt;br /&gt;
  --enable-shared         build the Scheme runtime system as a shared library&lt;br /&gt;
  --enable-debug          build system so that it can be debugged&lt;br /&gt;
  --enable-profile        build system so that it can be profiled&lt;br /&gt;
&lt;br /&gt;
The option --enable-cplusplus should be used when applications&lt;br /&gt;
developed with the Gambit-C compiler are to be linked with code or&lt;br /&gt;
libraries written in C++.  This will compile all of the Gambit-C&lt;br /&gt;
source code with a C++ compiler instead of a C compiler (this is&lt;br /&gt;
possible because the code generated by the Gambit-C compiler conforms&lt;br /&gt;
both to C and C++).&lt;br /&gt;
&lt;br /&gt;
The option --enable-guide will include the Gambit Universal IDE in the&lt;br /&gt;
Gambit-C runtime system.  The option --enable-cplusplus must be used&lt;br /&gt;
when the option --enable-guide is used.  The Gambit Universal IDE&lt;br /&gt;
requires the Qt GUI library version 3.3.  To include GUIDE it is&lt;br /&gt;
necessary to first build the system without including GUIDE (to have a&lt;br /&gt;
working Gambit-C compiler) and then rebuild the system with GUIDE&lt;br /&gt;
enabled.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-cplusplus&lt;br /&gt;
make&lt;br /&gt;
make clean&lt;br /&gt;
./configure --enable-cplusplus --enable-guide&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The option --enable-shared will build a shared library for the&lt;br /&gt;
Gambit-C runtime system.  This is not supported on all platforms.&lt;br /&gt;
&lt;br /&gt;
The option --enable-debug and --enable-profile are useful for&lt;br /&gt;
debugging the system.&lt;br /&gt;
&lt;br /&gt;
By default the configure script will use the GCC compiler to build the&lt;br /&gt;
system, if it is available.  To override this choice or to use special&lt;br /&gt;
C compiler flags it is possible to set the environment variables CC,&lt;br /&gt;
CFLAGS, LDFLAGS, etc in the shell or on the configure command line.&lt;br /&gt;
Object file compilation options should go in CFLAGS, link options&lt;br /&gt;
should go in LDFLAGS, and options that apply to both can be next to&lt;br /&gt;
the name of the C compiler in CC.  Here are some examples.&lt;br /&gt;
&lt;br /&gt;
* To use cc instead of gcc:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=cc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On a Sun Sparc workstation, the following will use the Sun Workshop C/C++ compiler and generate 64 bit executables (the heap can grow beyond 4 Gbytes):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=&amp;quot;cc -xtarget=native -xarch=v9&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On a Compaq Alpha workstation, the following will use the Compaq Tru64 UNIX C/C++ compiler and generate executables that use 32 bit addressing instead of the normal 64 bit addressing (the heap and code will be in the lower 4 GBytes of the address space):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% ./configure CC=cc CFLAGS=&amp;quot;-w -D___USE_32_BIT_ADDR&amp;quot; LDFLAGS=-taso&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* By default, Gambit-C's runtime system does not restrict the size of the Scheme heap.  A heap overflow will only be signalled when virtual memory is all used up, which can take a long time and cause lots of paging.  This is not ideal for an educational environment where endless recursions are commonplace.  The symbol ___FORCE_MAX_HEAP can be defined to put a limit on the size of the heap.  To get a 5000 kilobyte limit (a reasonable amount for an educational environment) the system could be configured with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% ./configure CFLAGS=&amp;quot;-D___FORCE_MAX_HEAP=5000&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Configure_script_options</id>
		<title>Configure script options</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Configure_script_options"/>
				<updated>2009-02-21T18:52:21Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Note that gcc-4.4 has fixed the memory bug, add some more suggestions.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The configure script, which was generated by the&lt;br /&gt;
[http://www.gnu.org/software/autoconf autoconf] tool,&lt;br /&gt;
accepts command line options that control various features.  It is&lt;br /&gt;
'''highly''' recommended to use the --enable-single-host option to&lt;br /&gt;
improve the execution speed and compactness of the executables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-single-host&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This option is not used by default because compilation is much longer&lt;br /&gt;
and requires much more RAM.  In fact some platforms may not have&lt;br /&gt;
enough resources to build the system this way.  With&lt;br /&gt;
--enable-single-host the build takes roughly 500 megabytes and 20&lt;br /&gt;
minutes on a 1.2 GHz Athlon Linux machine with the GCC 3.1 compiler&lt;br /&gt;
instead of 100 megabytes and 2 minutes when --enable-single-host is&lt;br /&gt;
not used.  However, the speed of the Gambit-C interpreter improves by&lt;br /&gt;
a factor of 2 as a result.&lt;br /&gt;
&lt;br /&gt;
It is also '''highly''' recommended to use the GCC compiler to build&lt;br /&gt;
the system as the source code can take advantage of some GCC&lt;br /&gt;
extensions.  Notably the use of GCC's computed gotos reduces the&lt;br /&gt;
execution time by roughly 35%.&lt;br /&gt;
&lt;br /&gt;
We recommend that users build Gambit-C with GCC 3.1 or later; GCC 3.1&lt;br /&gt;
will compile C code generated by the Gambit-C compiler faster than&lt;br /&gt;
previous versions of GCC, and will generally produce faster code than&lt;br /&gt;
previous versions of GCC.  For example, the interpreter is about 5%&lt;br /&gt;
faster than when it is compiled with GCC 2.95.3.&lt;br /&gt;
&lt;br /&gt;
We also recommend that users avoid versions 4.2.* to 4.3.* of GCC, as&lt;br /&gt;
these versions of GCC require&lt;br /&gt;
an unreasonable amount of memory to compile the C output of the Gambit&lt;br /&gt;
compiler for relatively large Scheme programs&lt;br /&gt;
when Gambit is configured with the --enable-single-host option.  For&lt;br /&gt;
example, with GCC 4.2.4, one cannot compile the &amp;quot;compiler&amp;quot; benchmark&lt;br /&gt;
in &amp;quot;r6rs&amp;quot; mode in 20GB of memory on x86-64.  (GCC version 4.1.2&lt;br /&gt;
compiles this program in at most 1.5GB of RAM.)  Note that some Linux&lt;br /&gt;
releases ship with GCC 4.[23].* as the default system&lt;br /&gt;
compiler, so you might need to build gcc-4.1.2 yourself if you're&lt;br /&gt;
serious about compiling relatively large Scheme programs.&lt;br /&gt;
&lt;br /&gt;
Another option is to add&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
-fno-move-loop-invariants&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to the gcc command line, e.g.,&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC='gcc -fno-move-loop-invariants&amp;quot; ...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
See [[http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39157 PR 39157]]&lt;br /&gt;
&lt;br /&gt;
==Other options of the configure script==&lt;br /&gt;
&lt;br /&gt;
The detailed list of options accepted by the &amp;quot;configure&amp;quot; script can be&lt;br /&gt;
obtained with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most options are the same as for other autoconf generated configure&lt;br /&gt;
scripts.  For example, you can select the installation directory with&lt;br /&gt;
the option --prefix:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --prefix=/u/feeley/my-gambit&lt;br /&gt;
make install&lt;br /&gt;
~/my-gambit/bin/gsi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the --prefix option is not used, the default is to install all&lt;br /&gt;
files in /usr/local/Gambit-C and its subdirectories.&lt;br /&gt;
&lt;br /&gt;
The configure options which are specific to the Gambit-C system are:&lt;br /&gt;
&lt;br /&gt;
  --enable-single-host    compile each Scheme module as a single C function&lt;br /&gt;
  --enable-cplusplus      compile using C++ compiler&lt;br /&gt;
  --enable-guide          include the Gambit Universal IDE (currently broken)&lt;br /&gt;
  --enable-shared         build the Scheme runtime system as a shared library&lt;br /&gt;
  --enable-debug          build system so that it can be debugged&lt;br /&gt;
  --enable-profile        build system so that it can be profiled&lt;br /&gt;
&lt;br /&gt;
The option --enable-cplusplus should be used when applications&lt;br /&gt;
developed with the Gambit-C compiler are to be linked with code or&lt;br /&gt;
libraries written in C++.  This will compile all of the Gambit-C&lt;br /&gt;
source code with a C++ compiler instead of a C compiler (this is&lt;br /&gt;
possible because the code generated by the Gambit-C compiler conforms&lt;br /&gt;
both to C and C++).&lt;br /&gt;
&lt;br /&gt;
The option --enable-guide will include the Gambit Universal IDE in the&lt;br /&gt;
Gambit-C runtime system.  The option --enable-cplusplus must be used&lt;br /&gt;
when the option --enable-guide is used.  The Gambit Universal IDE&lt;br /&gt;
requires the Qt GUI library version 3.3.  To include GUIDE it is&lt;br /&gt;
necessary to first build the system without including GUIDE (to have a&lt;br /&gt;
working Gambit-C compiler) and then rebuild the system with GUIDE&lt;br /&gt;
enabled.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-cplusplus&lt;br /&gt;
make&lt;br /&gt;
make clean&lt;br /&gt;
./configure --enable-cplusplus --enable-guide&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The option --enable-shared will build a shared library for the&lt;br /&gt;
Gambit-C runtime system.  This is not supported on all platforms.&lt;br /&gt;
&lt;br /&gt;
The option --enable-debug and --enable-profile are useful for&lt;br /&gt;
debugging the system.&lt;br /&gt;
&lt;br /&gt;
By default the configure script will use the GCC compiler to build the&lt;br /&gt;
system, if it is available.  To override this choice or to use special&lt;br /&gt;
C compiler flags it is possible to set the environment variables CC,&lt;br /&gt;
CFLAGS, LDFLAGS, etc in the shell or on the configure command line.&lt;br /&gt;
Object file compilation options should go in CFLAGS, link options&lt;br /&gt;
should go in LDFLAGS, and options that apply to both can be next to&lt;br /&gt;
the name of the C compiler in CC.  Here are some examples.&lt;br /&gt;
&lt;br /&gt;
* To use cc instead of gcc:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=cc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On a Sun Sparc workstation, the following will use the Sun Workshop C/C++ compiler and generate 64 bit executables (the heap can grow beyond 4 Gbytes):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=&amp;quot;cc -xtarget=native -xarch=v9&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On a Compaq Alpha workstation, the following will use the Compaq Tru64 UNIX C/C++ compiler and generate executables that use 32 bit addressing instead of the normal 64 bit addressing (the heap and code will be in the lower 4 GBytes of the address space):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% ./configure CC=cc CFLAGS=&amp;quot;-w -D___USE_32_BIT_ADDR&amp;quot; LDFLAGS=-taso&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* By default, Gambit-C's runtime system does not restrict the size of the Scheme heap.  A heap overflow will only be signalled when virtual memory is all used up, which can take a long time and cause lots of paging.  This is not ideal for an educational environment where endless recursions are commonplace.  The symbol ___FORCE_MAX_HEAP can be defined to put a limit on the size of the heap.  To get a 5000 kilobyte limit (a reasonable amount for an educational environment) the system could be configured with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% ./configure CFLAGS=&amp;quot;-D___FORCE_MAX_HEAP=5000&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Configure_script_options</id>
		<title>Configure script options</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Configure_script_options"/>
				<updated>2009-02-12T01:24:23Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Discourage use of gcc-4.[234].* because of large memory requirements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The configure script, which was generated by the&lt;br /&gt;
[http://www.gnu.org/software/autoconf autoconf] tool,&lt;br /&gt;
accepts command line options that control various features.  It is&lt;br /&gt;
'''highly''' recommended to use the --enable-single-host option to&lt;br /&gt;
improve the execution speed and compactness of the executables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-single-host&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This option is not used by default because compilation is much longer&lt;br /&gt;
and requires much more RAM.  In fact some platforms may not have&lt;br /&gt;
enough resources to build the system this way.  With&lt;br /&gt;
--enable-single-host the build takes roughly 500 megabytes and 20&lt;br /&gt;
minutes on a 1.2 GHz Athlon Linux machine with the GCC 3.1 compiler&lt;br /&gt;
instead of 100 megabytes and 2 minutes when --enable-single-host is&lt;br /&gt;
not used.  However, the speed of the Gambit-C interpreter improves by&lt;br /&gt;
a factor of 2 as a result.&lt;br /&gt;
&lt;br /&gt;
It is also '''highly''' recommended to use the GCC compiler to build&lt;br /&gt;
the system as the source code can take advantage of some GCC&lt;br /&gt;
extensions.  Notably the use of GCC's computed gotos reduces the&lt;br /&gt;
execution time by roughly 35%.&lt;br /&gt;
&lt;br /&gt;
We recommend that users build Gambit-C with GCC 3.1 or later; GCC 3.1&lt;br /&gt;
will compile C code generated by the Gambit-C compiler faster than&lt;br /&gt;
previous versions of GCC, and will generally produce faster code than&lt;br /&gt;
previous versions of GCC.  For example, the interpreter is about 5%&lt;br /&gt;
faster than when it is compiled with GCC 2.95.3.&lt;br /&gt;
&lt;br /&gt;
We also recommend that users avoid versions 4.2.* to 4.4.* of GCC, as&lt;br /&gt;
these versions of GCC require&lt;br /&gt;
an unreasonable amount of memory to compile the C output of the Gambit&lt;br /&gt;
compiler for relatively large Scheme programs&lt;br /&gt;
when Gambit is configured with the --enable-single-host option.  For&lt;br /&gt;
example, with GCC 4.2.4, one cannot compile the &amp;quot;compiler&amp;quot; benchmark&lt;br /&gt;
in &amp;quot;r6rs&amp;quot; mode in 20GB of memory on x86-64.  (GCC version 4.1.2&lt;br /&gt;
compiles this program in at most 1.5GB of RAM.)  Note that some Linux&lt;br /&gt;
releases ship with GCC 4.[234].* as the default system&lt;br /&gt;
compiler, so you might need to build gcc-4.1.2 yourself if you're&lt;br /&gt;
serious about compiling relatively large Scheme programs.&lt;br /&gt;
&lt;br /&gt;
==Other options of the configure script==&lt;br /&gt;
&lt;br /&gt;
The detailed list of options accepted by the &amp;quot;configure&amp;quot; script can be&lt;br /&gt;
obtained with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Most options are the same as for other autoconf generated configure&lt;br /&gt;
scripts.  For example, you can select the installation directory with&lt;br /&gt;
the option --prefix:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --prefix=/u/feeley/my-gambit&lt;br /&gt;
make install&lt;br /&gt;
~/my-gambit/bin/gsi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the --prefix option is not used, the default is to install all&lt;br /&gt;
files in /usr/local/Gambit-C and its subdirectories.&lt;br /&gt;
&lt;br /&gt;
The configure options which are specific to the Gambit-C system are:&lt;br /&gt;
&lt;br /&gt;
  --enable-single-host    compile each Scheme module as a single C function&lt;br /&gt;
  --enable-cplusplus      compile using C++ compiler&lt;br /&gt;
  --enable-guide          include the Gambit Universal IDE (currently broken)&lt;br /&gt;
  --enable-shared         build the Scheme runtime system as a shared library&lt;br /&gt;
  --enable-debug          build system so that it can be debugged&lt;br /&gt;
  --enable-profile        build system so that it can be profiled&lt;br /&gt;
&lt;br /&gt;
The option --enable-cplusplus should be used when applications&lt;br /&gt;
developed with the Gambit-C compiler are to be linked with code or&lt;br /&gt;
libraries written in C++.  This will compile all of the Gambit-C&lt;br /&gt;
source code with a C++ compiler instead of a C compiler (this is&lt;br /&gt;
possible because the code generated by the Gambit-C compiler conforms&lt;br /&gt;
both to C and C++).&lt;br /&gt;
&lt;br /&gt;
The option --enable-guide will include the Gambit Universal IDE in the&lt;br /&gt;
Gambit-C runtime system.  The option --enable-cplusplus must be used&lt;br /&gt;
when the option --enable-guide is used.  The Gambit Universal IDE&lt;br /&gt;
requires the Qt GUI library version 3.3.  To include GUIDE it is&lt;br /&gt;
necessary to first build the system without including GUIDE (to have a&lt;br /&gt;
working Gambit-C compiler) and then rebuild the system with GUIDE&lt;br /&gt;
enabled.  For instance:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-cplusplus&lt;br /&gt;
make&lt;br /&gt;
make clean&lt;br /&gt;
./configure --enable-cplusplus --enable-guide&lt;br /&gt;
make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The option --enable-shared will build a shared library for the&lt;br /&gt;
Gambit-C runtime system.  This is not supported on all platforms.&lt;br /&gt;
&lt;br /&gt;
The option --enable-debug and --enable-profile are useful for&lt;br /&gt;
debugging the system.&lt;br /&gt;
&lt;br /&gt;
By default the configure script will use the GCC compiler to build the&lt;br /&gt;
system, if it is available.  To override this choice or to use special&lt;br /&gt;
C compiler flags it is possible to set the environment variables CC,&lt;br /&gt;
CFLAGS, LDFLAGS, etc in the shell or on the configure command line.&lt;br /&gt;
Object file compilation options should go in CFLAGS, link options&lt;br /&gt;
should go in LDFLAGS, and options that apply to both can be next to&lt;br /&gt;
the name of the C compiler in CC.  Here are some examples.&lt;br /&gt;
&lt;br /&gt;
* To use cc instead of gcc:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=cc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On a Sun Sparc workstation, the following will use the Sun Workshop C/C++ compiler and generate 64 bit executables (the heap can grow beyond 4 Gbytes):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC=&amp;quot;cc -xtarget=native -xarch=v9&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* On a Compaq Alpha workstation, the following will use the Compaq Tru64 UNIX C/C++ compiler and generate executables that use 32 bit addressing instead of the normal 64 bit addressing (the heap and code will be in the lower 4 GBytes of the address space):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% ./configure CC=cc CFLAGS=&amp;quot;-w -D___USE_32_BIT_ADDR&amp;quot; LDFLAGS=-taso&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* By default, Gambit-C's runtime system does not restrict the size of the Scheme heap.  A heap overflow will only be signalled when virtual memory is all used up, which can take a long time and cause lots of paging.  This is not ideal for an educational environment where endless recursions are commonplace.  The symbol ___FORCE_MAX_HEAP can be defined to put a limit on the size of the heap.  To get a 5000 kilobyte limit (a reasonable amount for an educational environment) the system could be configured with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% ./configure CFLAGS=&amp;quot;-D___FORCE_MAX_HEAP=5000&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page"/>
				<updated>2009-02-03T05:23:11Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
The Gambit Scheme system is a complete, portable, efficient and reliable implementation&lt;br /&gt;
of the [[Scheme | Scheme programming language]].&lt;br /&gt;
&lt;br /&gt;
This web site is intended for users of the Gambit Scheme system.  It is a place where various&lt;br /&gt;
resources are collected and where users can exchange information related to Gambit.&lt;br /&gt;
&lt;br /&gt;
'''Download latest release (v4.4.0):'''&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/source/gambc-v4_4_0-devel.tgz Development Sources],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/prebuilt/gambc-v4_4_0-macosx-intel32.dmg Mac OS X installer (for Intel 32)],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.4/prebuilt/gambc-v4_4_0-windows-mingw.exe Windows installer]&lt;br /&gt;
(for other releases see the [[distributions]]).&lt;br /&gt;
&lt;br /&gt;
==What's Gambit?==&lt;br /&gt;
&lt;br /&gt;
Gambit consists of two main programs: '''gsi''', the Gambit Scheme interpreter, and '''gsc''', the Gambit Scheme compiler.&lt;br /&gt;
The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time.  Interpreted code and compiled code can be freely mixed.&lt;br /&gt;
&lt;br /&gt;
Gambit-C is a version of the Gambit programming system in which the&lt;br /&gt;
compiler generates portable C code.  The main features of Gambit-C are:&lt;br /&gt;
&lt;br /&gt;
* '''Conformance.'''  The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards and implements all optional features.  Tail calls and first class continuations conform to the Scheme semantics.  The full numeric tower is implemented, including: arbitrary precision integers (bignums), rationals, inexact reals (floating point numbers), and complex numbers.  Several extensions to Scheme are provided, including: lightweight threads, a foreign-function interface (FFI), and extended I/O capabilities (Unicode, networking, subprocesses, ...).&lt;br /&gt;
* '''Portability.'''  Because the system is mostly written in Scheme and the compiler generates portable C code, it is easy to port the system as well as programs compiled with it to any platform with a decent C or C++ compiler.  There is no reliance on a particular C compiler, although the system can take advantage of some '''gcc'''-specific constructs.  The C code generated is oblivious to the endianness and word size of the target environment (32 and 64 bit architectures are currently supported).&lt;br /&gt;
* '''Performance.'''  The compiler includes several powerful program transformations such as user procedure inlining, partial-evaluation, and lambda-lifting.  With appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs.  Programs containing no declarations are also optimized without compromising the Scheme semantics by speculatively inlining predefined procedures (see the [[benchmarks]] page for a comparison with other Scheme implementations and other languages).  Thanks to an efficient implementation of continuations, the thread system is very efficient and can support millions of concurrent threads.  The bignum library uses sophisticated algorithms that are in some cases asymptotically faster than those of GMP (GNU Multiple Precision Arithmetic Library).&lt;br /&gt;
* '''Reliability.'''  Stable releases typically have very few bugs.  Bug tracking is done with [http://www.bugzilla.org/ bugzilla].  Gambit-C has been used to develop large-scale real-world software in academic and commercial settings.&lt;br /&gt;
&lt;br /&gt;
==Getting Gambit==&lt;br /&gt;
&lt;br /&gt;
Gambit is available as prebuilt and source code [[distributions]].  There are prebuilt distributions for Mac OS X, Microsoft Windows, and other operating systems.  The source code distributions must be compiled with a C or C++ compiler.  The latest sources are available in the [[Source code repository | source code repository]]. It can be accessed using&lt;br /&gt;
the [http://git.or.cz/ git] distributed version control system.&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Documentation]] is available.&lt;br /&gt;
&lt;br /&gt;
==Support==&lt;br /&gt;
&lt;br /&gt;
Come chat with us in the #gambit channel on [http://www.mibbit.com Freenode IRC].&lt;br /&gt;
&lt;br /&gt;
==Contributing==&lt;br /&gt;
&lt;br /&gt;
Learn [[how to contribute]] to Gambit's development.&lt;br /&gt;
&lt;br /&gt;
===Reporting bugs===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/bugzilla/ Gambit bugzilla]&lt;br /&gt;
&lt;br /&gt;
===Source repository===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/repo/gambit/ Gambit Mercurial repo]&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
&lt;br /&gt;
Gambit is Copyright &amp;amp;copy; 1994-2008 by Marc Feeley.&lt;br /&gt;
It is released under a dual LGPL and Apache 2 license. You&lt;br /&gt;
can choose whichever license you prefer:&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/copyleft/lesser.html LGPL version 2.1 license]&lt;br /&gt;
* [http://www.apache.org/licenses/LICENSE-2.0.html Apache version 2.0 license]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/R6RS</id>
		<title>R6RS</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/R6RS"/>
				<updated>2008-12-14T05:27:27Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: add a questions category to the page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Using Andre van Tonder's [http://www.het.brown.edu/people/andre/macros syntax-case &amp;amp; library system] on Gambit&lt;br /&gt;
&lt;br /&gt;
There is a R6RS distribution located at [[media:gambit-r6rs.tgz|gambit-r6rs.tgz]]. There is a compile script written in Gambit scheme that will compile all the libraries together into a loadable library. The libraries are divided into 3 layers; each layer being dependent on the previous layer.&lt;br /&gt;
&lt;br /&gt;
 1. The Gambit libraries are where all the extensions to r5rs are put&lt;br /&gt;
 2. the standard and base libraries.&lt;br /&gt;
 3. The srfi's that are implemented by gambit.&lt;br /&gt;
&lt;br /&gt;
There are some general differences:&lt;br /&gt;
 * You can't use Gambit's extended lambda syntax. Instead use srfi-89&lt;br /&gt;
 &lt;br /&gt;
Gambit libraries:&lt;br /&gt;
 (gambit threads)&lt;br /&gt;
 (gambit exceptions)&lt;br /&gt;
 (gambit extensions)&lt;br /&gt;
 (gambit files)&lt;br /&gt;
 (gambit io)&lt;br /&gt;
 (gambit io readtable)&lt;br /&gt;
 (gambit programs)&lt;br /&gt;
 (gambit time)&lt;br /&gt;
 (gambit will)&lt;br /&gt;
 (gambit debug)&lt;br /&gt;
 (gambit bytevectors)&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
R6RS libraries implemented:&lt;br /&gt;
 (rnrs base)&lt;br /&gt;
 (rnrs lists)&lt;br /&gt;
 (rnrs sorting)&lt;br /&gt;
 (rnrs control)&lt;br /&gt;
 (rnrs records inspection)&lt;br /&gt;
 (rnrs conditions)&lt;br /&gt;
 (rnrs exceptions)&lt;br /&gt;
 (rnrs files)&lt;br /&gt;
 (rnrs programs)&lt;br /&gt;
 (rnrs arithmetic fixnums)&lt;br /&gt;
 (rnrs arithmetic bitwise)&lt;br /&gt;
 (rnrs syntax-case)&lt;br /&gt;
 (rnrs eval)&lt;br /&gt;
 (rnrs mutable-pairs)&lt;br /&gt;
 (rnrs mutable-strings)&lt;br /&gt;
 (rnrs r5rs)&lt;br /&gt;
&lt;br /&gt;
R6RS libraries (incomplete):&lt;br /&gt;
  (rnrs unicode)&lt;br /&gt;
  (rnrs records procedural)&lt;br /&gt;
  (rnrs bytevectors)&lt;br /&gt;
  (rnrs io ports)&lt;br /&gt;
  (rnrs io simple)&lt;br /&gt;
  (rnrs arithmetic flonums)&lt;br /&gt;
  (rnrs)&lt;br /&gt;
  &lt;br /&gt;
R6RS libraries missing:&lt;br /&gt;
  (rnrs records syntactic (6))&lt;br /&gt;
  (rnrs hashtables (6))&lt;br /&gt;
  (rnrs enums (6))&lt;br /&gt;
&lt;br /&gt;
SRFI libraries:&lt;br /&gt;
 (srfi-2)&lt;br /&gt;
 (srfi-4)&lt;br /&gt;
 (srfi-6)&lt;br /&gt;
 (srfi-8)&lt;br /&gt;
 (srfi-9)&lt;br /&gt;
 (srfi-18)&lt;br /&gt;
 (srfi-21)&lt;br /&gt;
 (srfi-23)&lt;br /&gt;
 (srfi-27)&lt;br /&gt;
 (srfi-39)&lt;br /&gt;
 (srfi-88)&lt;br /&gt;
 (srfi-89)&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
  * Finish importing all gambit api into gambit libraries.&lt;br /&gt;
  * Implement all R6RS api&lt;br /&gt;
  * Remove warnings when loading the R6RS compiled library&lt;br /&gt;
  * Create a error handler that prints R6RS conditions in repl.&lt;br /&gt;
  * Integrate gambit and r6rs repl&lt;br /&gt;
  * Create R6RS mode for Gambit that loads this library&lt;br /&gt;
  * Implement a compile-library and compile-program functions.&lt;br /&gt;
  * Implement a packaging standard&lt;br /&gt;
&lt;br /&gt;
Questions:&lt;br /&gt;
  * Can you add the declarations (declare (standard-binding)(extended-bindings)(block)) to the top of the file?  That would decrease the size of the .c file passed to gcc.&lt;br /&gt;
&lt;br /&gt;
[[Category: Code]] [[Category: Languages]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/GambitNds</id>
		<title>GambitNds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/GambitNds"/>
				<updated>2008-10-08T04:15:01Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Add note about removing bignum algorithms, and a note about simplifying the &amp;quot;radical surgery&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This will be a page describing the efforts to build a version of Gambit optimized for NDS (Nintendo DS) development.&lt;br /&gt;
&lt;br /&gt;
Right now it will just point to the [[Distributions]] page, and contain a few notes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Decreasing the size of the Gambit executable ==&lt;br /&gt;
&lt;br /&gt;
One of the Biggest challenges is the RAM limitation on the DS (4 megs).  Gambit, even when properly compressed will take 3 of those. &lt;br /&gt;
&lt;br /&gt;
=== Get rid of the fancy bignum algorithms ===&lt;br /&gt;
&lt;br /&gt;
Gambit includes fast algorithms for large integer multiplication, division, and gcd.&lt;br /&gt;
&lt;br /&gt;
You probably don't need them on the NDS.  To remove them from the executable, after you've done&lt;br /&gt;
a &amp;quot;make bootstrap&amp;quot; change the line&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(##define-macro (use-fast-bignum-algorithms) #t)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
in _num.scm to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(##define-macro (use-fast-bignum-algorithms) #f)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
and do another &amp;quot;make&amp;quot;.  Gambit's constant propagation and dead-code elimination will eliminate all&lt;br /&gt;
the code (and tables) for the fancy bignum algorithms.&lt;br /&gt;
&lt;br /&gt;
=== Radical surgery on the Gambit runtime ===&lt;br /&gt;
&lt;br /&gt;
(Note: In revision 207, _kernel.scm was changed so that these warnings do not occur, and you don't have to provide your own&lt;br /&gt;
versions of ##map, ##string-&amp;gt;symbol, ##+, and ##*.)&lt;br /&gt;
&lt;br /&gt;
Recently Marc sent a message about how to radically decrease the size of the executable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Actually there is another one, which consists in eliminating the whole  &lt;br /&gt;
Gambit library, except for the &amp;quot;essentials&amp;quot; (lib/_kernel.scm and some  &lt;br /&gt;
of the C files in lib/ which implement the GC, C-interface,&lt;br /&gt;
initialization code, etc).&lt;br /&gt;
&lt;br /&gt;
Using this technique (see trace below) I managed to build a 300 kB  &lt;br /&gt;
executable on MacOS X from the v4.2.9 tarball.  This could be reduced  &lt;br /&gt;
some more by removing some functionality.  Anyway, this is just a  &lt;br /&gt;
quick-and-dirty experiment.&lt;br /&gt;
&lt;br /&gt;
The downside of course is that you have to implement yourself whatever  &lt;br /&gt;
you need in your application.  You only have very basic functionality  &lt;br /&gt;
(the inlinable primitives like ##fx+, ##cons, ##car).  This is like  &lt;br /&gt;
reinventing the wheel... but I'm sure some users will appreciate the  &lt;br /&gt;
hack value!&lt;br /&gt;
&lt;br /&gt;
Marc&lt;br /&gt;
&lt;br /&gt;
% tar zxf gambc-v4_2_9.tgz&lt;br /&gt;
% cd gambc-v4_2_9&lt;br /&gt;
% ./configure --enable-single-host&lt;br /&gt;
% make bootstrap&lt;br /&gt;
% ################ Now edit lib/makefile.in .&lt;br /&gt;
% diff lib/makefile.in lib/makefile.in-orig&lt;br /&gt;
&amp;lt; MODULES = _kernel&lt;br /&gt;
&amp;lt; MODULES_SCM = _kernel.scm&lt;br /&gt;
&amp;lt; MODULES_C = _kernel.c&lt;br /&gt;
&amp;lt; MODULES_O = _kernel@obj@&lt;br /&gt;
&amp;lt; MODULES_O_PLUS = +_kernel@obj@&lt;br /&gt;
&amp;lt; MODULES_O_COMMA = _kernel@obj@&lt;br /&gt;
---&lt;br /&gt;
MODULES = _kernel _system _num _std \&lt;br /&gt;
_eval _io _nonstd _thread _repl&lt;br /&gt;
MODULES_SCM = _kernel.scm _system.scm _num.scm _std.scm \&lt;br /&gt;
_eval.scm _io.scm _nonstd.scm _thread.scm _repl.scm&lt;br /&gt;
MODULES_C = _kernel.c _system.c _num.c _std.c \&lt;br /&gt;
_eval.c _io.c _nonstd.c _thread.c _repl.c&lt;br /&gt;
MODULES_O = _kernel@obj@ _system@obj@ _num@obj@ _std@obj@ \&lt;br /&gt;
_eval@obj@ _io@obj@ _nonstd@obj@ _thread@obj@ _repl@obj@&lt;br /&gt;
MODULES_O_PLUS = +_kernel@obj@ +_system@obj@ +_num@obj@ +_std@obj@ \&lt;br /&gt;
+_eval@obj@ +_io@obj@ +_nonstd@obj@ +_thread@obj@ +_repl@obj@&lt;br /&gt;
MODULES_O_COMMA = _kernel@obj@,_system@obj@,_num@obj@,_std@obj@,\&lt;br /&gt;
+_eval@obj@,_io@obj@,_nonstd@obj@,_thread@obj@,_repl@obj@&lt;br /&gt;
81c87,88&lt;br /&gt;
&amp;lt; MODULES_O_IN_COMPILE_ORDER = _kernel@obj@&lt;br /&gt;
---&lt;br /&gt;
MODULES_O_IN_COMPILE_ORDER = _io@obj@ _num@obj@ _std@obj@ \&lt;br /&gt;
_kernel@obj@ _nonstd@obj@ _repl@obj@ _eval@obj@ _thread@obj@  &lt;br /&gt;
_system@obj@&lt;br /&gt;
% make clean&lt;br /&gt;
% make&lt;br /&gt;
making all in include&lt;br /&gt;
...&lt;br /&gt;
making all in lib&lt;br /&gt;
...&lt;br /&gt;
../gsc-comp -:=.. -f -link -flat -o _gambc.c _kernel.c&lt;br /&gt;
*** WARNING -- &amp;quot;##*&amp;quot; is not defined,&lt;br /&gt;
***            referenced in: (&amp;quot;_kernel.c&amp;quot;)&lt;br /&gt;
*** WARNING -- &amp;quot;##+&amp;quot; is not defined,&lt;br /&gt;
***            referenced in: (&amp;quot;_kernel.c&amp;quot;)&lt;br /&gt;
*** WARNING -- &amp;quot;##map&amp;quot; is not defined,&lt;br /&gt;
***            referenced in: (&amp;quot;_kernel.c&amp;quot;)&lt;br /&gt;
*** WARNING -- &amp;quot;##string-&amp;gt;symbol&amp;quot; is not defined,&lt;br /&gt;
***            referenced in: (&amp;quot;_kernel.c&amp;quot;)&lt;br /&gt;
% ################ Note that lib/_kernel.scm depends on some Gambit&lt;br /&gt;
% ################ library procedures that are not defined in&lt;br /&gt;
% ################ lib/_kernel.scm.  This will be fixed so that&lt;br /&gt;
% ################ lib/_kernel.scm is self contained, as it should.&lt;br /&gt;
% ################ Now create hw.scm .&lt;br /&gt;
% cat hw.scm&lt;br /&gt;
;; Make sure the compiler does not assume the standard library is&lt;br /&gt;
;; linked in.&lt;br /&gt;
(declare&lt;br /&gt;
   (block)&lt;br /&gt;
   (not inline)&lt;br /&gt;
   (not inline-primitives)&lt;br /&gt;
   (inlining-limit 0)&lt;br /&gt;
   (not run-time-bindings)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
;; Supply the procedures lib/_kernel.scm needs (this dependency should&lt;br /&gt;
;; be removed since it is gratuitous).&lt;br /&gt;
(define (##map f lst) '()) ;; I'm lazy&lt;br /&gt;
(define (##string-&amp;gt;symbol str) 'foo)&lt;br /&gt;
(define (##+ x y) 0)&lt;br /&gt;
(define (##* x y) 0)&lt;br /&gt;
&lt;br /&gt;
;; The &amp;quot;hello world&amp;quot; program:&lt;br /&gt;
&lt;br /&gt;
(c-declare &amp;quot;#include &amp;lt;stdio.h&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(define puts (c-lambda (char-string) int &amp;quot;puts&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
(puts &amp;quot;hello world&amp;quot;)&lt;br /&gt;
% ./gsc-comp -:=. -c hw.scm&lt;br /&gt;
% ./gsc-comp -:=. -link hw.c&lt;br /&gt;
% gcc -Iinclude -D___SINGLE_HOST hw_.c hw.c lib/libgambc.a -o hw&lt;br /&gt;
% strip hw&lt;br /&gt;
% ls -l hw&lt;br /&gt;
-rwxr-xr-x  1 feeley  feeley  300384 Oct  4 09:22 hw&lt;br /&gt;
% ./hw&lt;br /&gt;
hello world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Talk:Programming_language_shootout:_mandelbrot</id>
		<title>Talk:Programming language shootout: mandelbrot</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Talk:Programming_language_shootout:_mandelbrot"/>
				<updated>2008-09-03T04:18:53Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The invocation should probably be&lt;br /&gt;
&lt;br /&gt;
  gsi -:m10000 mandelbrot 3000 &amp;gt; output.pbm&lt;br /&gt;
&lt;br /&gt;
instead of&lt;br /&gt;
&lt;br /&gt;
  gsi mandelbrot -:m10000 3000 &amp;gt; output.pbm&lt;br /&gt;
&lt;br /&gt;
since the latter passes -:m10000 to main() instead of gsi, yielding&lt;br /&gt;
&lt;br /&gt;
  *** ERROR -- Wrong number of arguments passed to procedure&lt;br /&gt;
  (main &amp;quot;-:m10000&amp;quot; &amp;quot;3000&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[[User:Pipping|Pipping]] 23:38, 2 September 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
Absolutely right, fixed.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_mandelbrot</id>
		<title>Programming language shootout: mandelbrot</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_mandelbrot"/>
				<updated>2008-09-03T04:17:53Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Running */  Fix command line&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=mandelbrot&amp;amp;lang=all mandelbrot] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the Chicken variant by Anthony Borla&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define-macro (when test . body)&lt;br /&gt;
  `(if ,test&lt;br /&gt;
       (begin&lt;br /&gt;
	 ,@body)))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define *limit-sqr* 4.0)&lt;br /&gt;
&lt;br /&gt;
(define *iterations* 50)&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (mandelbrot iterations x frac2/n ci)&lt;br /&gt;
  (let ((cr (fl- (fl* (exact-&amp;gt;inexact x) frac2/n) 1.5))&lt;br /&gt;
	(z (f64vector 0. 0.)))&lt;br /&gt;
&lt;br /&gt;
    (define-macro (with-z . body)&lt;br /&gt;
      `(let ((zr (f64vector-ref z 0))&lt;br /&gt;
	     (zi (f64vector-ref z 1)))&lt;br /&gt;
	 ,@body))&lt;br /&gt;
&lt;br /&gt;
    (define (zr-set! val)&lt;br /&gt;
      (f64vector-set! z 0 val))&lt;br /&gt;
&lt;br /&gt;
    (define (zi-set! val)&lt;br /&gt;
      (f64vector-set! z 1 val))&lt;br /&gt;
    &lt;br /&gt;
    (let loop ((i 0))&lt;br /&gt;
      (cond ((fx&amp;gt; i iterations)&lt;br /&gt;
	     1)&lt;br /&gt;
	    ((with-z&lt;br /&gt;
	      (fl&amp;gt; (fl+ (fl* zr zr)&lt;br /&gt;
			(fl* zi zi))&lt;br /&gt;
		   *limit-sqr*))&lt;br /&gt;
	     0)&lt;br /&gt;
	    (else&lt;br /&gt;
	     (with-z&lt;br /&gt;
	      (zr-set! (fl+ (fl- (fl* zr zr)&lt;br /&gt;
				 (fl* zi zi))&lt;br /&gt;
			    cr))&lt;br /&gt;
	      (zi-set! (fl+ (fl* 2.0 zr zi)&lt;br /&gt;
			    ci))&lt;br /&gt;
	      (loop (fx+ 1 i))))))))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (main arg)&lt;br /&gt;
  (let* ((n (string-&amp;gt;number arg))&lt;br /&gt;
	 (frac2/n (/ 2.0 n))&lt;br /&gt;
	 (out (current-output-port)))&lt;br /&gt;
    (display &amp;quot;P4&amp;quot;) (newline)&lt;br /&gt;
    (display n) (display &amp;quot; &amp;quot;) (display n) (newline)&lt;br /&gt;
    (let loop-y ((y 0))&lt;br /&gt;
      (when (&amp;lt; y n)&lt;br /&gt;
            (let ([ci (fl- (fl* (exact-&amp;gt;inexact y) frac2/n) 1.0)])&lt;br /&gt;
              (let loop-x ((x 0) (bitnum 0) (byteacc 0))&lt;br /&gt;
                (if (&amp;lt; x n)&lt;br /&gt;
                    (let ([bitnum (fx+ 1 bitnum)]&lt;br /&gt;
                          [byteacc (fx+ (fxarithmetic-shift-left byteacc 1)&lt;br /&gt;
                                        (mandelbrot *iterations* x frac2/n ci))])&lt;br /&gt;
                      (cond&lt;br /&gt;
                       [(= bitnum 8)&lt;br /&gt;
                        (write-u8 byteacc out)&lt;br /&gt;
                        (loop-x (fx+ 1 x) 0 0)]&lt;br /&gt;
                       [else (loop-x (fx+ 1 x) bitnum byteacc)]))&lt;br /&gt;
                    (begin&lt;br /&gt;
                      (when (positive? bitnum)&lt;br /&gt;
                            (write-u8 (fxarithmetic-shift-left byteacc (- 8 (fxand n #x7)))&lt;br /&gt;
				      out))&lt;br /&gt;
                      (loop-y (fx+ 1 y))))))))&lt;br /&gt;
    (force-output out)))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc mandelbrot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi -:m10000 mandelbrot 3000 &amp;gt; output.pbm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here I give it a 10MB minimum heap.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Using_Gambit_with_External_Libraries</id>
		<title>Using Gambit with External Libraries</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Using_Gambit_with_External_Libraries"/>
				<updated>2008-07-02T20:52:01Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Add comment re: possibly not needed special options for gsc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using gsc to compile and link a dynamically loadable object file that uses external libraries ==&lt;br /&gt;
&lt;br /&gt;
Here is an example of building a dynamically loadable Gambit object file that uses [http://www.fftw.org FFTW].  This example is on Red Hat Enterprise Linux 4.2 on x86-64.&lt;br /&gt;
&lt;br /&gt;
The program uses the FFTW version 2 API, so we downloaded fftw-2.1.5.tar.gz, untarred it and configured it with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-shared --prefix=/export/users/lucier/local/fftw-2.1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You need the &amp;lt;tt&amp;gt;--enable-shared&amp;lt;/tt&amp;gt; option because shared Gambit modules must be linked to shared external libraries.  I set the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; to install the final FFTW libraries and header files in my home directory.&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;fftbasics.scm&amp;lt;/tt&amp;gt; provides the basic interface between the Scheme code and FFTW; it is as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(c-declare&lt;br /&gt;
&amp;quot;&lt;br /&gt;
#include \&amp;quot;fftw.h\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
fftwnd_plan p;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(define fftw2d_create_plan_backward&lt;br /&gt;
  (c-lambda ()&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;p = fftw2d_create_plan(64,&lt;br /&gt;
                                    64,&lt;br /&gt;
                                    FFTW_BACKWARD,&lt;br /&gt;
                                    FFTW_ESTIMATE | FFTW_IN_PLACE);&lt;br /&gt;
            &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
(define fftw2d_create_plan_forward&lt;br /&gt;
  (c-lambda ()&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;p = fftw2d_create_plan(64,&lt;br /&gt;
                                    64,&lt;br /&gt;
                                    FFTW_FORWARD,&lt;br /&gt;
                                    FFTW_ESTIMATE | FFTW_IN_PLACE);&lt;br /&gt;
            &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
;;; Both forward and backward ffts, depends on which way the plan was created.&lt;br /&gt;
&lt;br /&gt;
(define fftwc&lt;br /&gt;
  (c-lambda (scheme-object)&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;&lt;br /&gt;
int j; double *fp = (double *)((___WORD)___BODY_AS(___arg1,___tSUBTYPED));&lt;br /&gt;
  fftwnd_one(p,&lt;br /&gt;
             (fftw_complex *)(fp),&lt;br /&gt;
             NULL);&lt;br /&gt;
  for (j = 0; j &amp;lt; 64 * 64 * 2; j++)&lt;br /&gt;
    fp[j] *= .015625;&lt;br /&gt;
&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We need to pass special options to gsc to compile this file, namely&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc -cc-options &amp;quot;-I/export/users/lucier/local/fftw-2.1.5/include&amp;quot; -ld-options &amp;quot;-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw&amp;quot; fftbasic.scm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first option (&amp;lt;tt&amp;gt;-I/export/users/lucier/local/fftw-2.1.5/include&amp;lt;/tt&amp;gt;) tells gcc where to find the header file &amp;lt;tt&amp;gt;fftw.h&amp;lt;/tt&amp;gt; at compile time.  The second option (&amp;lt;tt&amp;gt;-L/export/users/lucier/local/fftw-2.1.5/lib/&amp;lt;/tt&amp;gt;) tells the linker where to find the FFTW library (&amp;lt;tt&amp;gt;-lfftw&amp;lt;/tt&amp;gt;) at link time (i.e., when building the file &amp;lt;tt&amp;gt;fftwbasic.o1&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;fftwbasic.o&amp;lt;/tt&amp;gt;), and the third option (&amp;lt;tt&amp;gt;-Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/&amp;lt;/tt&amp;gt;) tells the dynamic loader &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; where to find the FFTW library when &amp;lt;tt&amp;gt;fftwbasic.o1&amp;lt;/tt&amp;gt; is loaded into gsc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Aside&amp;lt;/b&amp;gt;: Note that if the headers and libraries are in a standard place known to gcc, and the location of the shared library is already in the path of the dynamic loader, then these options may not be necessary.  In many GNU/Linux systems, for examples, nearly all packages are installed in &amp;lt;tt&amp;gt;/usr/{bin,include,lib}&amp;lt;/tt&amp;gt;, and you may not need to pass these special options to gsc.&lt;br /&gt;
&lt;br /&gt;
Then we can do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-316% gsc&lt;br /&gt;
Gambit v4.2.8&lt;br /&gt;
&lt;br /&gt;
&amp;gt; (load &amp;quot;fftbasic&amp;quot;)&lt;br /&gt;
&amp;quot;/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1&amp;quot;&lt;br /&gt;
&amp;gt; fftwc&lt;br /&gt;
#&amp;lt;procedure #2 fftwc&amp;gt;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
*** EOF again to exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can check that &amp;lt;tt&amp;gt;fftbasic.o1&amp;lt;/tt&amp;gt; links to the right libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-317% ldd fftbasic.o1&lt;br /&gt;
        libfftw.so.2 =&amp;gt; /export/users/lucier/local/fftw-2.1.5/lib/libfftw.so.2 (0x0000002a9565a000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib64/tls/libc.so.6 (0x0000002a957aa000)&lt;br /&gt;
        libm.so.6 =&amp;gt; /lib64/tls/libm.so.6 (0x0000002a959df000)&lt;br /&gt;
        /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, recall from the the [http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#SEC21 Gambit manual] that anything you can do with gsc on the command line you can do with one of the gsc-specific scheme procedures &amp;lt;tt&amp;gt;compile-file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;compile-file-to-c&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link-incremental&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;link-flat&amp;lt;/tt&amp;gt;.  Thus, one could build &amp;lt;tt&amp;gt;fftbasic.o1&amp;lt;/tt&amp;gt; by&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-352% gsc&lt;br /&gt;
Gambit v4.2.8&lt;br /&gt;
&lt;br /&gt;
&amp;gt; (compile-file &amp;quot;fftbasic.scm&amp;quot; cc-options: &amp;quot;-I/export/users/lucier/local/fftw-2.1.5/include&amp;quot;&lt;br /&gt;
 ld-options: &amp;quot;-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw&amp;quot;)&lt;br /&gt;
#t&lt;br /&gt;
&amp;gt; (load &amp;quot;fftbasic&amp;quot;)&lt;br /&gt;
&amp;quot;/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1&amp;quot;&lt;br /&gt;
&amp;gt; fftwc&lt;br /&gt;
#&amp;lt;procedure #2 fftwc&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Using_Gambit_with_External_Libraries</id>
		<title>Using Gambit with External Libraries</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Using_Gambit_with_External_Libraries"/>
				<updated>2008-07-02T20:31:33Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Using gsc to compile and link a dynamically loadable object file that uses external libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using gsc to compile and link a dynamically loadable object file that uses external libraries ==&lt;br /&gt;
&lt;br /&gt;
Here is an example of building a dynamically loadable Gambit object file that uses [http://www.fftw.org FFTW].  This example is on Red Hat Enterprise Linux 4.2 on x86-64.&lt;br /&gt;
&lt;br /&gt;
The program uses the FFTW version 2 API, so we downloaded fftw-2.1.5.tar.gz, untarred it and configured it with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-shared --prefix=/export/users/lucier/local/fftw-2.1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You need the &amp;lt;tt&amp;gt;--enable-shared&amp;lt;/tt&amp;gt; option because shared Gambit modules must be linked to shared external libraries.  I set the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; to install the final FFTW libraries and header files in my home directory.&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;fftbasics.scm&amp;lt;/tt&amp;gt; provides the basic interface between the Scheme code and FFTW; it is as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(c-declare&lt;br /&gt;
&amp;quot;&lt;br /&gt;
#include \&amp;quot;fftw.h\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
fftwnd_plan p;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(define fftw2d_create_plan_backward&lt;br /&gt;
  (c-lambda ()&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;p = fftw2d_create_plan(64,&lt;br /&gt;
                                    64,&lt;br /&gt;
                                    FFTW_BACKWARD,&lt;br /&gt;
                                    FFTW_ESTIMATE | FFTW_IN_PLACE);&lt;br /&gt;
            &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
(define fftw2d_create_plan_forward&lt;br /&gt;
  (c-lambda ()&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;p = fftw2d_create_plan(64,&lt;br /&gt;
                                    64,&lt;br /&gt;
                                    FFTW_FORWARD,&lt;br /&gt;
                                    FFTW_ESTIMATE | FFTW_IN_PLACE);&lt;br /&gt;
            &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
;;; Both forward and backward ffts, depends on which way the plan was created.&lt;br /&gt;
&lt;br /&gt;
(define fftwc&lt;br /&gt;
  (c-lambda (scheme-object)&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;&lt;br /&gt;
int j; double *fp = (double *)((___WORD)___BODY_AS(___arg1,___tSUBTYPED));&lt;br /&gt;
  fftwnd_one(p,&lt;br /&gt;
             (fftw_complex *)(fp),&lt;br /&gt;
             NULL);&lt;br /&gt;
  for (j = 0; j &amp;lt; 64 * 64 * 2; j++)&lt;br /&gt;
    fp[j] *= .015625;&lt;br /&gt;
&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We need to pass special options to gsc to compile this file, namely&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc -cc-options &amp;quot;-I/export/users/lucier/local/fftw-2.1.5/include&amp;quot; -ld-options &amp;quot;-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw&amp;quot; fftbasic.scm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first option (&amp;lt;tt&amp;gt;-I/export/users/lucier/local/fftw-2.1.5/include&amp;lt;/tt&amp;gt;) tells gcc where to find the header file &amp;lt;tt&amp;gt;fftw.h&amp;lt;/tt&amp;gt; at compile time.  The second option (&amp;lt;tt&amp;gt;-L/export/users/lucier/local/fftw-2.1.5/lib/&amp;lt;/tt&amp;gt;) tells the linker where to find the FFTW library (&amp;lt;tt&amp;gt;-lfftw&amp;lt;/tt&amp;gt;) at link time (i.e., when building the file &amp;lt;tt&amp;gt;fftwbasic.o1&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;fftwbasic.o&amp;lt;/tt&amp;gt;), and the third option (&amp;lt;tt&amp;gt;-Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/&amp;lt;/tt&amp;gt;) tells the dynamic loader &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; where to find the FFTW library when &amp;lt;tt&amp;gt;fftwbasic.o1&amp;lt;/tt&amp;gt; is loaded into gsc.&lt;br /&gt;
&lt;br /&gt;
Then we can do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-316% gsc&lt;br /&gt;
Gambit v4.2.8&lt;br /&gt;
&lt;br /&gt;
&amp;gt; (load &amp;quot;fftbasic&amp;quot;)&lt;br /&gt;
&amp;quot;/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1&amp;quot;&lt;br /&gt;
&amp;gt; fftwc&lt;br /&gt;
#&amp;lt;procedure #2 fftwc&amp;gt;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
*** EOF again to exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can check that &amp;lt;tt&amp;gt;fftbasic.o1&amp;lt;/tt&amp;gt; links to the right libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-317% ldd fftbasic.o1&lt;br /&gt;
        libfftw.so.2 =&amp;gt; /export/users/lucier/local/fftw-2.1.5/lib/libfftw.so.2 (0x0000002a9565a000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib64/tls/libc.so.6 (0x0000002a957aa000)&lt;br /&gt;
        libm.so.6 =&amp;gt; /lib64/tls/libm.so.6 (0x0000002a959df000)&lt;br /&gt;
        /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, recall from the the [http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#SEC21 Gambit manual] that anything you can do with gsc on the command line you can do with one of the gsc-specific scheme procedures &amp;lt;tt&amp;gt;compile-file&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;compile-file-to-c&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;link-incremental&amp;lt;/tt&amp;gt;, or &amp;lt;tt&amp;gt;link-flat&amp;lt;/tt&amp;gt;.  Thus, one could build &amp;lt;tt&amp;gt;fftbasic.o1&amp;lt;/tt&amp;gt; by&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-352% gsc&lt;br /&gt;
Gambit v4.2.8&lt;br /&gt;
&lt;br /&gt;
&amp;gt; (compile-file &amp;quot;fftbasic.scm&amp;quot; cc-options: &amp;quot;-I/export/users/lucier/local/fftw-2.1.5/include&amp;quot;&lt;br /&gt;
 ld-options: &amp;quot;-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw&amp;quot;)&lt;br /&gt;
#t&lt;br /&gt;
&amp;gt; (load &amp;quot;fftbasic&amp;quot;)&lt;br /&gt;
&amp;quot;/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1&amp;quot;&lt;br /&gt;
&amp;gt; fftwc&lt;br /&gt;
#&amp;lt;procedure #2 fftwc&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Using_Gambit_with_External_Libraries</id>
		<title>Using Gambit with External Libraries</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Using_Gambit_with_External_Libraries"/>
				<updated>2008-07-02T14:08:36Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: New page: == Using gsc to compile and link a dynamically loadable object file that uses external libraries ==  Here is an example of building a dynamically loadable Gambit object file that uses [htt...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Using gsc to compile and link a dynamically loadable object file that uses external libraries ==&lt;br /&gt;
&lt;br /&gt;
Here is an example of building a dynamically loadable Gambit object file that uses [http://www.fftw.org FFTW].  This example is on Red Hat Enterprise Linux 4.2 on x86-64.&lt;br /&gt;
&lt;br /&gt;
The program uses the FFTW version 2 API, so we downloaded fftw-2.1.5.tar.gz, untarred it and configured it with&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure --enable-shared --prefix=/export/users/lucier/local/fftw-2.1.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You need the &amp;lt;tt&amp;gt;--enable-shared&amp;lt;/tt&amp;gt; option because shared Gambit modules must be linked to shared external libraries.  I set the &amp;lt;tt&amp;gt;--prefix&amp;lt;/tt&amp;gt; to install the final FFTW libraries and header files in my home directory.&lt;br /&gt;
&lt;br /&gt;
The file &amp;lt;tt&amp;gt;fftbasics.scm&amp;lt;/tt&amp;gt; provides the basic interface between the Scheme code and FFTW; it is as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(c-declare&lt;br /&gt;
&amp;quot;&lt;br /&gt;
#include \&amp;quot;fftw.h\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
fftwnd_plan p;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
(define fftw2d_create_plan_backward&lt;br /&gt;
  (c-lambda ()&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;p = fftw2d_create_plan(64,&lt;br /&gt;
                                    64,&lt;br /&gt;
                                    FFTW_BACKWARD,&lt;br /&gt;
                                    FFTW_ESTIMATE | FFTW_IN_PLACE);&lt;br /&gt;
            &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
(define fftw2d_create_plan_forward&lt;br /&gt;
  (c-lambda ()&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;p = fftw2d_create_plan(64,&lt;br /&gt;
                                    64,&lt;br /&gt;
                                    FFTW_FORWARD,&lt;br /&gt;
                                    FFTW_ESTIMATE | FFTW_IN_PLACE);&lt;br /&gt;
            &amp;quot;))&lt;br /&gt;
&lt;br /&gt;
;;; Both forward and backward ffts, depends on which way the plan was created.&lt;br /&gt;
&lt;br /&gt;
(define fftwc&lt;br /&gt;
  (c-lambda (scheme-object)&lt;br /&gt;
            void&lt;br /&gt;
            &amp;quot;&lt;br /&gt;
int j; double *fp = (double *)((___WORD)___BODY_AS(___arg1,___tSUBTYPED));&lt;br /&gt;
  fftwnd_one(p,&lt;br /&gt;
             (fftw_complex *)(fp),&lt;br /&gt;
             NULL);&lt;br /&gt;
  for (j = 0; j &amp;lt; 64 * 64 * 2; j++)&lt;br /&gt;
    fp[j] *= .015625;&lt;br /&gt;
&amp;quot;))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We need to pass special options to gsc to compile this file, namely&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc -cc-options &amp;quot;-I/export/users/lucier/local/fftw-2.1.5/include&amp;quot; -ld-options &amp;quot;-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw&amp;quot; fftbasic.scm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The first option (&amp;lt;tt&amp;gt;-I/export/users/lucier/local/fftw-2.1.5/include&amp;lt;/tt&amp;gt;) tells gcc where to find the header file &amp;lt;tt&amp;gt;fftw.h&amp;lt;/tt&amp;gt; at compile time.  The second option (&amp;lt;tt&amp;gt;-L/export/users/lucier/local/fftw-2.1.5/lib/&amp;lt;/tt&amp;gt;) tells the linker where to find the FFTW library (&amp;lt;tt&amp;gt;-lfftw&amp;lt;/tt&amp;gt;) at link time (i.e., when building the file &amp;lt;tt&amp;gt;fftwbasic.o1&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;fftwbasic.o&amp;lt;/tt&amp;gt;), and the third option (&amp;lt;tt&amp;gt;-Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/&amp;lt;/tt&amp;gt;) tells the dynamic loader &amp;lt;tt&amp;gt;ldd&amp;lt;/tt&amp;gt; where to find the FFTW library when &amp;lt;tt&amp;gt;fftwbasic.o1&amp;lt;/tt&amp;gt; is loaded into gsc.&lt;br /&gt;
&lt;br /&gt;
Then we can do&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-316% gsc&lt;br /&gt;
Gambit v4.2.8&lt;br /&gt;
&lt;br /&gt;
&amp;gt; (load &amp;quot;fftbasic&amp;quot;)&lt;br /&gt;
&amp;quot;/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1&amp;quot;&lt;br /&gt;
&amp;gt; fftwc&lt;br /&gt;
#&amp;lt;procedure #2 fftwc&amp;gt;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
*** EOF again to exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
We can check that &amp;lt;tt&amp;gt;fftbasic.o1&amp;lt;/tt&amp;gt; links to the right libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
euler-317% ldd fftbasic.o1&lt;br /&gt;
        libfftw.so.2 =&amp;gt; /export/users/lucier/local/fftw-2.1.5/lib/libfftw.so.2 (0x0000002a9565a000)&lt;br /&gt;
        libc.so.6 =&amp;gt; /lib64/tls/libc.so.6 (0x0000002a957aa000)&lt;br /&gt;
        libm.so.6 =&amp;gt; /lib64/tls/libm.so.6 (0x0000002a959df000)&lt;br /&gt;
        /lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Documentation</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Documentation"/>
				<updated>2008-07-02T13:44:55Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== User Documentation ==&lt;br /&gt;
&lt;br /&gt;
There is a user manual for Gambit in [http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html HTML]&lt;br /&gt;
and [http://www.iro.umontreal.ca/~gambit/doc/gambit-c.pdf PDF] formats.&lt;br /&gt;
&lt;br /&gt;
General documentation about Scheme in various formats can be found at [http://www.schemers.org/ Schemers.org].&lt;br /&gt;
We've collected together on a single page some [[External links]]&lt;br /&gt;
&lt;br /&gt;
== Using a Prebuilt Distribution ==&lt;br /&gt;
&lt;br /&gt;
Some prebuilt distributions are [[Distributions | available]].&lt;br /&gt;
&lt;br /&gt;
== Building Gambit from Source ==&lt;br /&gt;
&lt;br /&gt;
Various [[Distributions | distributions]] of gambit have been made available.&lt;br /&gt;
&lt;br /&gt;
To build Gambit from source, one must first run the configure script, which has a number&lt;br /&gt;
of important [[Configure script options | options]].&lt;br /&gt;
&lt;br /&gt;
There are various [[Make targets | make targets]] of which you should be aware.&lt;br /&gt;
&lt;br /&gt;
== Packages ==&lt;br /&gt;
&lt;br /&gt;
[http://snow.iro.umontreal.ca/ Snow] is a package system for R4RS and R5RS Scheme.  I suspect that nearly&lt;br /&gt;
all such packages will run on Gambit.  Snow has its own&lt;br /&gt;
[http://snow.iro.umontreal.ca/?tab=Documentation documentation] for those who want&lt;br /&gt;
to develop new packages, but users can simply download and install&lt;br /&gt;
[http://snow.iro.umontreal.ca/?tab=Packages existing packages].&lt;br /&gt;
&lt;br /&gt;
== Editor/IDE Support ==&lt;br /&gt;
&lt;br /&gt;
Gambit provides a powerful development environment through [http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#SEC28 Emacs]. &lt;br /&gt;
&lt;br /&gt;
For those running Windows you can [http://ftp.gnu.org/pub/gnu/emacs/windows/ download Emacs here]. You may want to read the [http://www.gnu.org/software/emacs/windows/ntemacs.html Emacs FAQ for Windows] before customizing Emacs for use with Gambit.&lt;br /&gt;
&lt;br /&gt;
== Termite ==&lt;br /&gt;
&lt;br /&gt;
[http://www.toute.ca/ Termite] is an Erlang-like distributed programming system written in Scheme.&lt;br /&gt;
&lt;br /&gt;
Distributed computing hot right now, and Termite has been noticed in blogs and elsewhere.&lt;br /&gt;
&lt;br /&gt;
Termite depends on specific features of Gambit, and at one time or another&lt;br /&gt;
the Termite source code has been distributed with Gambit, so we point to the Termite web site&lt;br /&gt;
from here.&lt;br /&gt;
&lt;br /&gt;
== Internals Documentation ==&lt;br /&gt;
&lt;br /&gt;
People who want to [[How to Contribute | contribute]] to Gambit development will need to learn something about how the Gambit-C&lt;br /&gt;
runtime and compiler are organized.  While we intend that source code documentation be included in the source&lt;br /&gt;
itself (currently there is very little documentation), we intend that descriptions of program design&lt;br /&gt;
or algorithms used in the runtime and compiler could be included on the [[Internal Documentation]] page.&lt;br /&gt;
&lt;br /&gt;
== Working with External Libraries ==&lt;br /&gt;
&lt;br /&gt;
With Gambit's C FFI (Foreign Function Interface), one can easily use standard C libraries with your code; this wiki has some [[Using Gambit with External Libraries | examples of using Gambit with external libraries]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_binary_trees</id>
		<title>Programming language shootout: binary trees</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_binary_trees"/>
				<updated>2008-06-30T00:55:07Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=binarytrees&amp;amp;lang=all binary trees] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant, which was&lt;br /&gt;
;; Derived by Michael D. Adams from the MzScheme variant, which was&lt;br /&gt;
;; Derived from the Chicken variant by Sven Hartrumpf&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(not safe)(fixnum))&lt;br /&gt;
&lt;br /&gt;
(define-structure node left val right)&lt;br /&gt;
(define-structure leaf val)&lt;br /&gt;
&lt;br /&gt;
(define (make item d)&lt;br /&gt;
  (if (= d 0)&lt;br /&gt;
      (make-leaf item)&lt;br /&gt;
      (let ((item2 (* item 2))&lt;br /&gt;
            (d2 (- d 1)))&lt;br /&gt;
        (make-node (make (- item2 1) d2) item (make item2 d2)))))&lt;br /&gt;
&lt;br /&gt;
(define (check t)&lt;br /&gt;
  (if (leaf? t)&lt;br /&gt;
      (leaf-val t)&lt;br /&gt;
      (+ (node-val t) (- (check (node-left t)) (check (node-right t))))))&lt;br /&gt;
&lt;br /&gt;
(define (main . argv)&lt;br /&gt;
  (let* ((min-depth 4)&lt;br /&gt;
         (max-depth (max (+ min-depth 2) (string-&amp;gt;number (car argv)))))&lt;br /&gt;
    (let ((stretch-depth (+ max-depth 1)))&lt;br /&gt;
      (display &amp;quot;stretch tree of depth &amp;quot;)&lt;br /&gt;
      (display stretch-depth)&lt;br /&gt;
      (display &amp;quot;\t check: &amp;quot;)&lt;br /&gt;
      (display (check (make 0 stretch-depth)))&lt;br /&gt;
      (display &amp;quot;\n&amp;quot;))&lt;br /&gt;
    (let ((long-lived-tree (make 0 max-depth)))&lt;br /&gt;
      (do ((d 4 (+ d 2)))&lt;br /&gt;
          ((&amp;gt; d max-depth))&lt;br /&gt;
        (let ((iterations&lt;br /&gt;
               (fxarithmetic-shift-left 1 (+ (- max-depth d) min-depth))))&lt;br /&gt;
          (do ((i 0 (+ i 1))&lt;br /&gt;
	       (c 0 (+ c (check (make i d)) (check (make (- i) d)))))&lt;br /&gt;
	      ((&amp;gt;= i iterations)&lt;br /&gt;
	       (display (* 2 iterations))&lt;br /&gt;
	       (display &amp;quot;\t trees of depth &amp;quot;)&lt;br /&gt;
	       (display d)&lt;br /&gt;
	       (display &amp;quot;\t check: &amp;quot;)&lt;br /&gt;
	       (display c)&lt;br /&gt;
	       (display &amp;quot;\n&amp;quot;)))))&lt;br /&gt;
      (display &amp;quot;long lived tree of depth &amp;quot;)&lt;br /&gt;
      (display max-depth)&lt;br /&gt;
      (display &amp;quot;\t check: &amp;quot;)&lt;br /&gt;
      (display (check long-lived-tree))&lt;br /&gt;
      (display &amp;quot;\n&amp;quot;))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Compiling==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc binary-trees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi -:m100000 binary-trees 16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here we specify a minimum heap size of 100MB.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_fasta</id>
		<title>Programming language shootout: fasta</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_fasta"/>
				<updated>2008-06-30T00:53:29Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=fasta&amp;amp;lang=all fasta] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the Chicken variant by Anthony Borla&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define-macro (unless test . body)&lt;br /&gt;
  `(if (not ,test)&lt;br /&gt;
       (begin&lt;br /&gt;
	 ,@body)))&lt;br /&gt;
&lt;br /&gt;
(define *alu*&lt;br /&gt;
  (string-append&lt;br /&gt;
   &amp;quot;GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG&amp;quot;&lt;br /&gt;
   &amp;quot;GAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGA&amp;quot;&lt;br /&gt;
   &amp;quot;CCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAAT&amp;quot;&lt;br /&gt;
   &amp;quot;ACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCA&amp;quot;&lt;br /&gt;
   &amp;quot;GCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGG&amp;quot;&lt;br /&gt;
   &amp;quot;AGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCC&amp;quot;&lt;br /&gt;
   &amp;quot;AGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
(define *iub*&lt;br /&gt;
  (list&lt;br /&gt;
   '(#\a . 0.27) '(#\c . 0.12) '(#\g . 0.12) '(#\t . 0.27) '(#\B . 0.02)&lt;br /&gt;
   '(#\D . 0.02) '(#\H . 0.02) '(#\K . 0.02) '(#\M . 0.02) '(#\N . 0.02)&lt;br /&gt;
   '(#\R . 0.02) '(#\S . 0.02) '(#\V . 0.02) '(#\W . 0.02) '(#\Y . 0.02)))&lt;br /&gt;
&lt;br /&gt;
(define *homosapien*&lt;br /&gt;
  (list&lt;br /&gt;
   '(#\a . 0.3029549426680) '(#\c . 0.1979883004921)&lt;br /&gt;
   '(#\g . 0.1975473066391) '(#\t . 0.3015094502008)))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define *line-size* 60)&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (make-random seed)&lt;br /&gt;
  (let ((ia 3877.0)&lt;br /&gt;
	(ic 29573.)&lt;br /&gt;
	(im 139968.)&lt;br /&gt;
	(last (f64vector (exact-&amp;gt;inexact seed)))&lt;br /&gt;
	(result (f64vector 0.)))&lt;br /&gt;
    (lambda ()&lt;br /&gt;
      (let* ((advance (fl+ ic&lt;br /&gt;
			(fl* (f64vector-ref last 0)&lt;br /&gt;
			     ia)))&lt;br /&gt;
	     (next (fl- advance&lt;br /&gt;
			(fl* im&lt;br /&gt;
			     (fltruncate (fl/ advance im))))))&lt;br /&gt;
	(f64vector-set! last 0 next)&lt;br /&gt;
	(f64vector-set! result 0 (fl/ next im))))))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (make-cumulative-table frequency-table)&lt;br /&gt;
  (let ((cumulative 0.0))&lt;br /&gt;
    (map&lt;br /&gt;
     (lambda (x)&lt;br /&gt;
       (set! cumulative (fl+ cumulative (cdr x)))&lt;br /&gt;
       (cons (car x) cumulative))&lt;br /&gt;
       frequency-table)))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define random-next (make-random 42))&lt;br /&gt;
(define *segmarker* &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define (select-random cumulative-table)&lt;br /&gt;
  (select-over-threshold (random-next) cumulative-table))&lt;br /&gt;
&lt;br /&gt;
(define (select-over-threshold rvalue table)&lt;br /&gt;
  (if (fl&amp;lt;= (f64vector-ref rvalue 0) (cdar table))&lt;br /&gt;
      (caar table)&lt;br /&gt;
      (select-over-threshold rvalue (cdr table))))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define (repeat-fasta id desc n sequence line-length)&lt;br /&gt;
  (let ((seqlen (string-length sequence))&lt;br /&gt;
        (out (current-output-port))&lt;br /&gt;
	(buffer (make-string line-length)))&lt;br /&gt;
    (display (string-append *segmarker* id &amp;quot; &amp;quot; desc &amp;quot;\n&amp;quot;) out)&lt;br /&gt;
    (let loop-o ((n n) (k 0))&lt;br /&gt;
      (unless (fx&amp;lt;= n 0)&lt;br /&gt;
              (let ((m (fxmin n line-length)))&lt;br /&gt;
                (let loop-i ((i 0) (k k))&lt;br /&gt;
                  (if (fx&amp;gt;= i m)&lt;br /&gt;
                      (begin&lt;br /&gt;
			(write-substring buffer 0 m)&lt;br /&gt;
                        (write-char #\newline out)&lt;br /&gt;
                        (loop-o (fx- n line-length) k))&lt;br /&gt;
                      (let ([k (if (fx= k seqlen) 0 k)])&lt;br /&gt;
			(string-set! buffer i (string-ref sequence k))&lt;br /&gt;
                        (loop-i (fx+ 1 i) (fx+ 1 k))))))))&lt;br /&gt;
    (force-output out)))&lt;br /&gt;
&lt;br /&gt;
;; -------------&lt;br /&gt;
&lt;br /&gt;
(define (random-fasta id desc n cumulative-table line-length)&lt;br /&gt;
  (let ((out (current-output-port))&lt;br /&gt;
	(buffer (make-string line-length)))&lt;br /&gt;
    (display (string-append *segmarker* id &amp;quot; &amp;quot; desc &amp;quot;\n&amp;quot;) out)&lt;br /&gt;
    (let loop-o ((n n))&lt;br /&gt;
      (unless (&amp;lt;= n 0)&lt;br /&gt;
              (let ((m (min n line-length)))&lt;br /&gt;
                (let loop-i ((i 0))&lt;br /&gt;
                  (unless (&amp;gt;= i m)&lt;br /&gt;
			  (string-set! buffer i (select-random cumulative-table))&lt;br /&gt;
                          (loop-i (fx+ 1 i))))&lt;br /&gt;
		(write-substring buffer 0 m)&lt;br /&gt;
                (write-char #\newline out)&lt;br /&gt;
                (loop-o (fx- n line-length)))))&lt;br /&gt;
    (force-output out)))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (main . args)&lt;br /&gt;
  (let ((n (string-&amp;gt;number (car args))))&lt;br /&gt;
    (repeat-fasta &amp;quot;ONE&amp;quot; &amp;quot;Homo sapiens alu&amp;quot; (* n 2) *alu* *line-size*)&lt;br /&gt;
    (random-fasta &amp;quot;TWO&amp;quot; &amp;quot;IUB ambiguity codes&amp;quot; (* n 3)&lt;br /&gt;
                  (make-cumulative-table *iub*) *line-size*)&lt;br /&gt;
    (random-fasta &amp;quot;THREE&amp;quot; &amp;quot;Homo sapiens frequency&amp;quot; (* n 5)&lt;br /&gt;
                  (make-cumulative-table *homosapien*) *line-size*) ))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc fasta&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi fasta 25000000 &amp;gt; /dev/null&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Building the input for [[Programming language shootout: k-nucleotide| k-nucleotide]]==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi fasta 1000000 &amp;gt; knucleotide-input1000000.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The file knucleotide-input1000000.txt is used by [[Programming language shootout: k-nucleotide| k-nucleotide]].&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_fannkuch</id>
		<title>Programming language shootout: fannkuch</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_fannkuch"/>
				<updated>2008-06-30T00:21:44Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=fannkuch&amp;amp;lang=all fannkuch] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the O'Caml variant, by Christophe Papazian&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define (write-permutation perm)&lt;br /&gt;
  (for-each write (vector-&amp;gt;list perm))&lt;br /&gt;
  (newline))&lt;br /&gt;
&lt;br /&gt;
;; Find first value where r[i] != i&lt;br /&gt;
;; and increment (mod j+2) all values up to that (i.e. set them to j+1)&lt;br /&gt;
;; returning i+2&lt;br /&gt;
(define (choose-next r)&lt;br /&gt;
  (let loop ((i 0))&lt;br /&gt;
    (if (eq? (vector-ref r i) i)&lt;br /&gt;
        (loop (fx+ 1 i))&lt;br /&gt;
        (let loop ((j 0))&lt;br /&gt;
          (if (eq? j i)&lt;br /&gt;
              (begin (vector-set! r j (fxremainder (fx+ 1 (vector-ref r j)) (fx+ j 2)))&lt;br /&gt;
                     (fx+ j 2))&lt;br /&gt;
              (begin (vector-set! r j (fx+ j 1))&lt;br /&gt;
                     (loop (fx+ j 1))))))))&lt;br /&gt;
&lt;br /&gt;
;; Count number of &amp;quot;pancake flips&amp;quot; it takes to get p[0]=1&lt;br /&gt;
;; Does not side-effect p, uses s as a temporary&lt;br /&gt;
;; &amp;quot;Pancake flip&amp;quot; = Reverse first p[0]-1 elements&lt;br /&gt;
(define (count-flips n p s)&lt;br /&gt;
  ;; Check if all p[i] != i+1&lt;br /&gt;
  (define (check i)&lt;br /&gt;
    (or (eq? i n)&lt;br /&gt;
        (and (not (eq? (vector-ref p i) (fx+ i 1)))&lt;br /&gt;
             (check (fx+ i 1)))))&lt;br /&gt;
  ;; If all p[i] != i+1&lt;br /&gt;
  (if (check 0)&lt;br /&gt;
      (begin&lt;br /&gt;
        ;; set all s[i] = p[i]&lt;br /&gt;
        (do ((i 0 (fx+ i 1)))&lt;br /&gt;
            ((eq? i n))&lt;br /&gt;
          (vector-set! s i (vector-ref p i)))&lt;br /&gt;
        ;; keep reversing the first s[0]-1 values of s until s[0] = 1&lt;br /&gt;
        ;; and return number of flippings&lt;br /&gt;
        (do ((flips 0 (fx+ flips 1))&lt;br /&gt;
             (s0 (fx- (vector-ref s 0) 1)&lt;br /&gt;
                 (fx- (vector-ref s 0) 1)))&lt;br /&gt;
            ((eq? s0 0)&lt;br /&gt;
             flips)&lt;br /&gt;
          ;; reverse the first s[0]-1 values of s&lt;br /&gt;
          (do ((i 0  (fx+ i 1))&lt;br /&gt;
               (j s0 (fx- j 1)))&lt;br /&gt;
              ((fx&amp;gt;= i j))&lt;br /&gt;
            (let ((tmp (vector-ref s i)))&lt;br /&gt;
              (vector-set! s i (vector-ref s j))&lt;br /&gt;
              (vector-set! s j tmp)))))&lt;br /&gt;
      0))&lt;br /&gt;
&lt;br /&gt;
;; Build a new permutation by &amp;quot;braiding&amp;quot;:&lt;br /&gt;
;;  For every i in [1..n-1]:&lt;br /&gt;
;;    Shift each p[j&amp;lt;i] down by one&lt;br /&gt;
;;    and put p[0] at p[i]&lt;br /&gt;
(define (braid n p)&lt;br /&gt;
  ;; For every i in [1..n-1]&lt;br /&gt;
  (do ((i 1 (fx+ i 1)))&lt;br /&gt;
      ((eq? i n))&lt;br /&gt;
    ;; Shift each p[j] down by one&lt;br /&gt;
    ;; and put p[0] at p[i]&lt;br /&gt;
    (let ((t (vector-ref p 0)))&lt;br /&gt;
      (do ((j 0 (fx+ j 1)))&lt;br /&gt;
          ((eq? j i))&lt;br /&gt;
        (vector-set! p j (vector-ref p (fx+ j 1))))&lt;br /&gt;
      (vector-set! p i t))))&lt;br /&gt;
&lt;br /&gt;
(define (fannkuch n r p s m z)&lt;br /&gt;
  (let ((i (choose-next r)))&lt;br /&gt;
    (if (fx&amp;gt; i n)&lt;br /&gt;
        m&lt;br /&gt;
        (begin&lt;br /&gt;
          (if (fx&amp;gt; z 0) (write-permutation p))&lt;br /&gt;
          (braid i p)&lt;br /&gt;
          (fannkuch n r p s (max m (count-flips n p s)) (fx- z 1))))))&lt;br /&gt;
&lt;br /&gt;
(define (main . args)&lt;br /&gt;
  (let ((n (string-&amp;gt;number (car args))))&lt;br /&gt;
    (let ((r (make-vector n))&lt;br /&gt;
          (p (make-vector n))&lt;br /&gt;
          (s (make-vector n 0)))&lt;br /&gt;
&lt;br /&gt;
      ;; Init r and p to [1,...,n]&lt;br /&gt;
      (do ((i 0 (fx+ 1 i)))&lt;br /&gt;
          ((eq? i n))&lt;br /&gt;
        (vector-set! r i (fx+ i 1))&lt;br /&gt;
        (vector-set! p i (fx+ i 1)))&lt;br /&gt;
&lt;br /&gt;
      ;; No need to init s; it is only used as a temporary&lt;br /&gt;
&lt;br /&gt;
      (let ((x (fannkuch n r p s 0 30)))&lt;br /&gt;
        (display &amp;quot;Pfannkuchen(&amp;quot;)(display n)(display &amp;quot;) = &amp;quot;)&lt;br /&gt;
        (display x)(newline)))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc fannkuch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi fannkuch 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_binary_trees</id>
		<title>Programming language shootout: binary trees</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_binary_trees"/>
				<updated>2008-06-30T00:04:25Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: /* Running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=binarytrees&amp;amp;lang=all binary trees] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant, which was&lt;br /&gt;
;; Derived by Michael D. Adams from the MzScheme variant, which was&lt;br /&gt;
;; Derived from the Chicken variant by Sven Hartrumpf&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(not safe)(fixnum))&lt;br /&gt;
&lt;br /&gt;
(define-structure node left val right)&lt;br /&gt;
(define-structure leaf val)&lt;br /&gt;
&lt;br /&gt;
(define (make item d)&lt;br /&gt;
  (if (= d 0)&lt;br /&gt;
      (make-leaf item)&lt;br /&gt;
      (let ((item2 (* item 2))&lt;br /&gt;
            (d2 (- d 1)))&lt;br /&gt;
        (make-node (make (- item2 1) d2) item (make item2 d2)))))&lt;br /&gt;
&lt;br /&gt;
(define (check t)&lt;br /&gt;
  (if (leaf? t)&lt;br /&gt;
      (leaf-val t)&lt;br /&gt;
      (+ (node-val t) (- (check (node-left t)) (check (node-right t))))))&lt;br /&gt;
&lt;br /&gt;
(define (main . argv)&lt;br /&gt;
  (let* ((min-depth 4)&lt;br /&gt;
         (max-depth (max (+ min-depth 2) (string-&amp;gt;number (car argv)))))&lt;br /&gt;
    (let ((stretch-depth (+ max-depth 1)))&lt;br /&gt;
      (display &amp;quot;stretch tree of depth &amp;quot;)&lt;br /&gt;
      (display stretch-depth)&lt;br /&gt;
      (display &amp;quot;\t check: &amp;quot;)&lt;br /&gt;
      (display (check (make 0 stretch-depth)))&lt;br /&gt;
      (display &amp;quot;\n&amp;quot;))&lt;br /&gt;
    (let ((long-lived-tree (make 0 max-depth)))&lt;br /&gt;
      (do ((d 4 (+ d 2)))&lt;br /&gt;
          ((&amp;gt; d max-depth))&lt;br /&gt;
        (let ((iterations&lt;br /&gt;
               (fxarithmetic-shift-left 1 (+ (- max-depth d) min-depth))))&lt;br /&gt;
          (do ((i 0 (+ i 1))&lt;br /&gt;
	       (c 0 (+ c (check (make i d)) (check (make (- i) d)))))&lt;br /&gt;
	      ((&amp;gt;= i iterations)&lt;br /&gt;
	       (display (* 2 iterations))&lt;br /&gt;
	       (display &amp;quot;\t trees of depth &amp;quot;)&lt;br /&gt;
	       (display d)&lt;br /&gt;
	       (display &amp;quot;\t check: &amp;quot;)&lt;br /&gt;
	       (display c)&lt;br /&gt;
	       (display &amp;quot;\n&amp;quot;)))))&lt;br /&gt;
      (display &amp;quot;long lived tree of depth &amp;quot;)&lt;br /&gt;
      (display max-depth)&lt;br /&gt;
      (display &amp;quot;\t check: &amp;quot;)&lt;br /&gt;
      (display (check long-lived-tree))&lt;br /&gt;
      (display &amp;quot;\n&amp;quot;))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Compiling==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc binary-trees&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi -:m100000 binary-trees 16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Main_Page"/>
				<updated>2008-04-18T00:07:52Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ __NOEDITSECTION__&lt;br /&gt;
The Gambit Scheme system is a complete, portable, efficient and reliable implementation&lt;br /&gt;
of the [[Scheme | Scheme programming language]].&lt;br /&gt;
&lt;br /&gt;
This web site is intended for users of the Gambit Scheme system.  It is a place where various&lt;br /&gt;
resources are collected and where users can exchange information related to Gambit.&lt;br /&gt;
&lt;br /&gt;
'''Download latest release (v4.2.6):'''&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.2/source/gambc-v4_2_6.tgz Sources],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.2/prebuilt/gambc-v4_2_6-macosx-universal.dmg Universal Mac OS X installer],&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/download/gambit/v4.2/prebuilt/gambc-v4_2_6-windows-mingw.exe Windows installer]&lt;br /&gt;
(for other releases see the [[distributions]]).&lt;br /&gt;
&lt;br /&gt;
==What's Gambit?==&lt;br /&gt;
&lt;br /&gt;
Gambit consists of two main programs: '''gsi''', the Gambit Scheme&lt;br /&gt;
interpreter, and '''gsc''', the Gambit Scheme compiler.  The interpreter is designed to provide&lt;br /&gt;
a nice debugging environment whereas the compiler targets fast execution.&lt;br /&gt;
The compiler can produce standalone executables or compiled modules which&lt;br /&gt;
can be loaded at run time.  Interpreted code and compiled code can be freely mixed.&lt;br /&gt;
&lt;br /&gt;
Gambit-C is a version of the Gambit programming system in which the&lt;br /&gt;
compiler generates portable C code.  The main features of Gambit-C are:&lt;br /&gt;
&lt;br /&gt;
* '''Conformance.'''  The Gambit-C system conforms to the R4RS, R5RS and IEEE Scheme standards and implements all optional features.  Tail calls and first class continuations conform to the Scheme semantics.  The full numeric tower is implemented, including: arbitrary precision integers (bignums), rationals, inexact reals (floating point numbers), and complex numbers.  Several extensions to Scheme are provided, including: lightweight threads, a foreign-function interface (FFI), and extended I/O capabilities (Unicode, networking, subprocesses, ...).&lt;br /&gt;
* '''Portability.'''  Because the system is mostly written in Scheme and the compiler generates portable C code, it is easy to port the system as well as programs compiled with it to any platform with a decent C or C++ compiler.  There is no reliance on a particular C compiler, although the system can take advantage of some '''gcc'''-specific constructs.  The C code generated is oblivious to the endianness and word size of the target environment (32 and 64 bit architectures are currently supported).&lt;br /&gt;
* '''Performance.'''  The compiler includes several powerful program transformations such as user procedure inlining, partial-evaluation, and lambda-lifting.  With appropriate declarations in the source code the executable programs generated by the compiler run roughly as fast as equivalent C programs.  Programs containing no declarations are also optimized without compromising the Scheme semantics by speculatively inlining predefined procedures (see the [[benchmarks]] page for a comparison with other Scheme implementations and other languages).  Thanks to an efficient implementation of continuations, the thread system is very efficient and can support millions of concurrent threads.  The bignum library uses sophisticated algorithms that are in some cases asymptotically faster than those of GMP (GNU Multiple Precision Arithmetic Library).&lt;br /&gt;
* '''Reliability.'''  Stable releases typically have very few bugs.  Bug tracking is done with [http://www.bugzilla.org/ bugzilla].  Gambit-C has been used to develop large-scale real-world software in academic and commercial settings.&lt;br /&gt;
&lt;br /&gt;
==Getting Gambit==&lt;br /&gt;
&lt;br /&gt;
Gambit is available as prebuilt and source code [[distributions]].  There are prebuilt distributions for Mac OS X, Microsoft Windows, and other operating systems.  The source code distributions must be compiled with a C or C++ compiler.  The latest sources are available in the [[Source code repository | source code repository]]. It can be accessed using&lt;br /&gt;
the [http://www.selenic.com/mercurial/wiki/ Mercurial] distributed version control system.&lt;br /&gt;
&lt;br /&gt;
==Documentation==&lt;br /&gt;
&lt;br /&gt;
[[Documentation]] is available.&lt;br /&gt;
&lt;br /&gt;
==Support==&lt;br /&gt;
&lt;br /&gt;
Come chat with us in the #gambit channel on Freenode.&lt;br /&gt;
&lt;br /&gt;
==Contributing==&lt;br /&gt;
&lt;br /&gt;
Learn [[how to contribute]] to Gambit's development.&lt;br /&gt;
&lt;br /&gt;
===Reporting bugs===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/bugzilla/ Gambit bugzilla]&lt;br /&gt;
&lt;br /&gt;
===Source repository===&lt;br /&gt;
&lt;br /&gt;
[http://www.iro.umontreal.ca/~gambit/repo/gambit/ Gambit Mercurial repo]&lt;br /&gt;
&lt;br /&gt;
==License==&lt;br /&gt;
&lt;br /&gt;
Gambit is Copyright &amp;amp;copy; 1994-2008 by Marc Feeley.&lt;br /&gt;
It is released under a dual LGPL and Apache 2 license. You&lt;br /&gt;
can choose whichever license you prefer:&lt;br /&gt;
&lt;br /&gt;
* [http://www.gnu.org/copyleft/lesser.html LGPL version 2.1 license]&lt;br /&gt;
* [http://www.apache.org/licenses/LICENSE-2.0.html Apache version 2.0 license]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:Schemeray-0.2b.tgz</id>
		<title>File:Schemeray-0.2b.tgz</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:Schemeray-0.2b.tgz"/>
				<updated>2008-03-21T19:12:45Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Schemeray-0.2 with changes to improve speed.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Schemeray-0.2 with changes to improve speed.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds</id>
		<title>Dumping Grounds</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Dumping_Grounds"/>
				<updated>2008-03-19T03:01:24Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Remove cruft from Pi.scm.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here you will find packages of Gambit code contributed by users.  This page is meant as a simple repository where random code snippets as well as complex systems can easily be stored so that other users can get to them.  This is not a substitute for a repository that is closely coupled with the Gambit system's module system (which is under development).  It is meant to foster the sharing of code by making it extremely easy to publish code in a publicly accessible place.  Sharing a piece of code that is incomplete, undocumented, and unreliable is better than not sharing it, because others can correct the deficiencies, learn from the code, or avoid the bugs.  Hence the name '''Dumping Grounds''' for this page.&lt;br /&gt;
&lt;br /&gt;
The code need not follow a specific structure.  It could simply be a Scheme source file (with a '''.scm''' extension).  However, if you are packaging your code specifically for storing it here, it is best if the name of the package contains a revision number (so that many revisions can be stored) and is a gzip compressed tar file ('''.tgz''' extension) containing the code and documentation (for example file '''Sort-r1.tgz''' containing the files '''Sort-r1/Sort.scm''' and possibly '''Sort-r1/Sort.html''' and other related files).  For some reason the wiki insists on the package name starting with an upper-case letter.  The code is assumed to be in the public domain unless you add licensing information in the package itself or the documentation.&lt;br /&gt;
&lt;br /&gt;
To add a new package you must add an entry for it to this page (copy-paste an existing entry), update the file name in the &amp;lt;nowiki&amp;gt;[[media:Sort-r1.tgz|Sort-r1.tgz]]&amp;lt;/nowiki&amp;gt; link, save the page and click on the link to upload your file.  If you upload a new revision don't forget to change the revision number, and keep the link to the old revisions.&lt;br /&gt;
&lt;br /&gt;
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]&lt;br /&gt;
&lt;br /&gt;
==Packages==&lt;br /&gt;
&lt;br /&gt;
# '''Sort''': Provides a simple sorting procedure for lists and vectors.  The mergesort algorithm is used.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]&lt;br /&gt;
# '''Pi''': Compute pi to arbitrary precision.&lt;br /&gt;
#: Author: Marc Feeley&lt;br /&gt;
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])&lt;br /&gt;
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:oops33.tgz|oops33.tgz]]&lt;br /&gt;
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.&lt;br /&gt;
#: Author: Ken Dickey&lt;br /&gt;
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/File:Pi-r3.tgz</id>
		<title>File:Pi-r3.tgz</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/File:Pi-r3.tgz"/>
				<updated>2008-03-19T02:57:54Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Now much smaller, since we got rid of code that isn't used.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Now much smaller, since we got rid of code that isn't used.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout</id>
		<title>Programming language shootout</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout"/>
				<updated>2008-03-05T00:43:22Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Specify a good configuration for target machine.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==The programs==&lt;br /&gt;
&lt;br /&gt;
Here are implementations for some programs from the [http://shootout.alioth.debian.org/ Computer Language Benchmarks Game] for Gambit.&lt;br /&gt;
&lt;br /&gt;
Running [[Programming language shootout: k-nucleotide|k-nucleotide.scm]]  with the largest data set creates a string of length 5,000,000. With four-byte characters (Gambit's default) this is 20,000,000 byte object, and the largest object that can be created in a 32-bit system is a bit less than 16MB. So, either configure Gambit with --enable-char-size=1 (or 2) or use a 64-bit version of Gambit.&lt;br /&gt;
&lt;br /&gt;
The suggested build and install procedure for Gambit on the Computer Language Benchmarks Game machine is&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./configure CC='gcc -march=pentium4 -mfpmath=sse -msse2' --enable-single-host --enable-char-size=1&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This installs Gambit in &amp;lt;tt&amp;gt;/usr/local/Gambit-C&amp;lt;/tt&amp;gt;, and the binaries &amp;lt;tt&amp;gt;gsi&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;gsc&amp;lt;/tt&amp;gt; are in &amp;lt;tt&amp;gt;/usr/local/Gambit-C/current/bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* [[Programming language shootout: binary trees|binary-trees.scm]]&lt;br /&gt;
* [[Programming language shootout: chameneos redux|chameneos-redux.scm]]&lt;br /&gt;
* [[Programming language shootout: fannkuch|fannkuch.scm]]&lt;br /&gt;
* [[Programming language shootout: fasta|fasta.scm]]&lt;br /&gt;
* [[Programming language shootout: k-nucleotide|k-nucleotide.scm]]&lt;br /&gt;
* [[Programming language shootout: mandelbrot|mandelbrot.scm]]&lt;br /&gt;
* [[Programming language shootout: meteor contest|meteor-contest.scm]]&lt;br /&gt;
* [[Programming language shootout: n-body|n-body.scm]]&lt;br /&gt;
* [[Programming language shootout: nsieve|nsieve.scm]]&lt;br /&gt;
* [[Programming language shootout: nsieve-bits|nsieve-bits.scm]]&lt;br /&gt;
* [[Programming language shootout: partial sums|partial-sums.scm]]&lt;br /&gt;
* [[Programming language shootout: pidigits|pidigits.scm]]&lt;br /&gt;
* [[Programming language shootout: recursive|recursive.scm]]&lt;br /&gt;
* [[Programming language shootout: regex dna|regex-dna.scm]]&lt;br /&gt;
* [[Programming language shootout: reverse complement|reverse-complement.scm]]&lt;br /&gt;
* [[Programming language shootout: spectral norm|spectral-norm.scm]]&lt;br /&gt;
* [[Programming language shootout: startup|startup.scm]]&lt;br /&gt;
* [[Programming language shootout: sum file|sum-file.scm]]&lt;br /&gt;
* [[Programming language shootout: thread ring|thread-ring.scm]]&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Wish_list</id>
		<title>Wish list</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Wish_list"/>
				<updated>2008-02-29T19:51:33Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Wish for inlined two-list map&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists suggestions for new features.  We hope it will be useful for brainstorming by the user&lt;br /&gt;
community to help direct the further development of Gambit.  Suggestions should include a&lt;br /&gt;
description of the feature and a motivation.&lt;br /&gt;
&lt;br /&gt;
====Support for long (&amp;gt; 8192) lists in apply====&lt;br /&gt;
&lt;br /&gt;
Even if it has to be slow for large lists, it would be preferable to having to change the way you code for certain applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Delimited continuations====&lt;br /&gt;
&lt;br /&gt;
Would allow creating continuations that&lt;br /&gt;
don't capture the current-input/output-ports and are serializable (useful for Termite,&lt;br /&gt;
web-continuations, etc).&lt;br /&gt;
&lt;br /&gt;
====Integration of Termite with Snow====&lt;br /&gt;
&lt;br /&gt;
Handle namespaces, provide null (single threaded) implementations of more general operations (pmap, mapreduce etc) for other hosts.&lt;br /&gt;
&lt;br /&gt;
====Multiple Processes on Multiple Cores====&lt;br /&gt;
&lt;br /&gt;
Automate the creation of nodes on the same machine to allow simpler use of multiple cores from within Termite (ie more like Erlang).  This should also load the correct environment.&lt;br /&gt;
&lt;br /&gt;
====Real Time and Generational Garbage Collection====&lt;br /&gt;
&lt;br /&gt;
Support multiple garbage collection strategies. Ideally garbage collection strategy could be decided at runtime but implementation details may force that decision to be specified at build time.&lt;br /&gt;
&lt;br /&gt;
====Support for R6RS====&lt;br /&gt;
&lt;br /&gt;
Support for running [[R6RS]] programs would be really useful and make it much easier to share code with other implementations (which promised to be R6RS compliant soon).&lt;br /&gt;
&lt;br /&gt;
While there are many things I don't like about R6RS, I would like to see the macro and module system integrated into Gambit, specifically so that Meroon can be rewritten to use these features.  I think Meroon is in a design space sweet spot, and with Meroon's close integration into the Gambit runtime, a better macro/module implementation would make it quite appealing.  Perhaps Gambit could use Andre van Tonder's implementation, but I haven't yet looked at the license.  (Brad Lucier)&lt;br /&gt;
&lt;br /&gt;
====FFI Improvement====&lt;br /&gt;
&lt;br /&gt;
Better and higher level support for the foreign function interface for C/C++. This could include some easy ways to create struct/class objects, easy way to access their inner elements, simple foreign struct/class declaration, etc...&lt;br /&gt;
&lt;br /&gt;
Also, a simplification of the Gambit-&amp;gt;C and C-&amp;gt;Gambit type translation process. Instead of having to define some very low level C macros, it would be interesting to have a simplified form which could cover most usage of such type translations and speed up the developpement process.&lt;br /&gt;
&lt;br /&gt;
It would be nice to be able to pass SRFI-4 style vectors as float*, int*, etc.&lt;br /&gt;
&lt;br /&gt;
====Better debugger support for locally bound procedures====&lt;br /&gt;
&lt;br /&gt;
When displaying a procedure, Gambit's debugger already scans all the global variables to try and find one that is bound to that procedure so it can display the variable's name instead of just a generic #&amp;lt;procedure&amp;gt;. This is very usefull but it would be nice to have a similar mecanism for locally bound procedures (internal define, named let, ...).&lt;br /&gt;
&lt;br /&gt;
====Native / pre-emptive threads====&lt;br /&gt;
&lt;br /&gt;
Given the fact that the world is moving from faster processors to parallel processing, I believe that support for true native threads is increasingly critical.  Eventually, no programming environment will survive that doesn't support native threads.  Support for multiple processes is good but pales in comparison to light weight, native, pre-emptive thread support.  PThreads would be a good, portable way to go here.&lt;br /&gt;
&lt;br /&gt;
====Continued support for the Windows environment====&lt;br /&gt;
&lt;br /&gt;
Few programmers like Windows less than I do.  However, Windows is in fact an environment we have to deal with.  Continued and native (Microsoft C) support enables programmers to use Linux at home and Windows at work.  If Windows is not supported then none of the cool stuff developed at home can be used at work thus reducing the excitement and usefulness of developing cool stuff at home.&lt;br /&gt;
&lt;br /&gt;
====Better Documentation of Compiler and Runtime Internals====&lt;br /&gt;
&lt;br /&gt;
The source code needs to be documented more thoroughly if Gambit is to thrive as an open-source project.  This is something a lot of people could work on, but Marc would probably need to do most of the work for the compiler.&lt;br /&gt;
&lt;br /&gt;
====Identify and Implement Important Optimizations====&lt;br /&gt;
&lt;br /&gt;
=====More inline expansions=====&lt;br /&gt;
Inline expansion and run-time bindings have proved very effective compilation strategies for standard functions.  Perhaps the majority of the work has been done, but there are still opportunities to be identified and implemented (e.g., eqv?, read-char, and write-char for starters).  Two-list map is common enough that it should be inlined, as one-list map already is.&lt;br /&gt;
&lt;br /&gt;
=====Efficient compilation of quasiquote=====&lt;br /&gt;
Right now, any use of quasiquotation results in calls to the built-in routines ##quasi-cons, ##quasi-list, ##quasi-list-&amp;gt;vector, etc.  When I changed&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(define (make-node left val right) `#(node ,left ,val ,right))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
(define (make-node left val right) (vector 'node left val right))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
in the Ikarus version of the alioth binary trees benchmark, for example, and compiled the code with Gambit, the run time went from 40 seconds to 8 seconds.  Runtimes shouldn't depend so much on different ways of doing the same thing.&lt;br /&gt;
&lt;br /&gt;
(48 hours later.)  This should be fixed by checkin 95.  That was fast!&lt;br /&gt;
&lt;br /&gt;
=====Faster unsafe numerical inline expansions=====&lt;br /&gt;
The last operation in the unfolded code for (op x1 x2 x3 ...) when (declare (not safe)) should be a call to ##op, not op.&lt;br /&gt;
&lt;br /&gt;
=====Deforestation=====&lt;br /&gt;
A pass to eliminate code generation for unused intermediate structures (cons cells, small vector, ...).&lt;br /&gt;
&lt;br /&gt;
====Implement SRFI-63====&lt;br /&gt;
[http://srfi.schemers.org/srfi-63/srfi-63.html SRFI 63, &amp;quot;Homogeneous and Heterogeneous Arrays&amp;quot;], is the latest in the evolution of strongly-typed multidimensional array/matrix types in scheme, superseding SRFI-47  and including all SRFI-4 data types. Gambit already provides SRFI-4 support for homogeneous arrays; this would add on a few new types and allow for multidimensional operations. Coupled with the FFI, it might make it easy to link with BLAS/LAPACK and other optimized numeric libraries to allow gambit to be a first-class numerical processing and data analysis environment.&lt;br /&gt;
&lt;br /&gt;
====Graphical Extensions====&lt;br /&gt;
* Support for any kind of graphical library, low level like X, or high level like SDL, in order to generate pictures or animations.&lt;br /&gt;
* Graphical external representation of data structures, with boxes and arrows, à la UML, or like some graphical debuggers. Useful to represent trees, cyclic data structure, and for debugging too.&lt;br /&gt;
&lt;br /&gt;
====Error-free loading====&lt;br /&gt;
The possibility to load or include a file, without having any error when the file can't be read or does not exist.&lt;br /&gt;
 (unsafe-include &amp;quot;/path/to/inexistant.file&amp;quot;) &lt;br /&gt;
would just return #f, or not be expanded, or even better&lt;br /&gt;
 (include-with-exception-handler&lt;br /&gt;
   (lambda (err)&lt;br /&gt;
     (cond ...))&lt;br /&gt;
   &amp;quot;/path/to/file&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
====Tying Data and files====&lt;br /&gt;
The ability to tie some data structure to a file would be greatly appreciated. For example,&lt;br /&gt;
 (define h (make-tied-hash &amp;quot;/tmp/myhash.scm&amp;quot;))&lt;br /&gt;
 (tied-hash-set! h 'foo 42)&lt;br /&gt;
 ^D&lt;br /&gt;
&lt;br /&gt;
 cat /tmp/myhash.scm&lt;br /&gt;
 foo =&amp;gt; 42&lt;br /&gt;
or a binary format or it could even dump its own code...&lt;br /&gt;
&lt;br /&gt;
And since we have procedures serialisation thanks to termite, functions too could be tied....&lt;br /&gt;
&lt;br /&gt;
The aim is to simplify file managing, when reading/writing data stored in S-exprs, such as a config file or else...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====TCP/IP interpreter====&lt;br /&gt;
Couldn't we run a session of the interpreter on a socket/pipe ?&lt;br /&gt;
It would enable calling gambit easily from other programs, from scripts, etc.&lt;br /&gt;
It could use several connexions for default input/ouput ports and result port, or reply with answers like &lt;br /&gt;
 (STDOUT 42) (STDERR &amp;quot;hello&amp;quot;) (VALUE 3.141592)&lt;br /&gt;
meaning that it wrote 42 on the standard output (with DISPLAY), the string hello on the standard error (with PP) and that the value returned by the call was π.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_spectral_norm</id>
		<title>Programming language shootout: spectral norm</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_spectral_norm"/>
				<updated>2008-02-26T15:21:52Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: Fix totally screwed up earlier entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=spectralnorm&amp;amp;lang=all spectral-norm] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the MzScheme variant&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(not safe))&lt;br /&gt;
&lt;br /&gt;
;;; Stupid boiler-plate for formatting floating point value&lt;br /&gt;
(define (roundto digits n)&lt;br /&gt;
  (let* ([e (expt 10 digits)]&lt;br /&gt;
         [num (round (abs (* e (inexact-&amp;gt;exact n))))]&lt;br /&gt;
         [str (number-&amp;gt;string (remainder num e))])&lt;br /&gt;
    (string-append&lt;br /&gt;
     (if (negative? n) &amp;quot;-&amp;quot; &amp;quot;&amp;quot;)&lt;br /&gt;
     (number-&amp;gt;string (quotient num e))&lt;br /&gt;
     &amp;quot;.&amp;quot;&lt;br /&gt;
     (make-string (- digits (string-length str)) #\0)&lt;br /&gt;
     str)))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (approximate n)&lt;br /&gt;
  (let ((u (make-f64vector n 1.0))&lt;br /&gt;
        (v (make-f64vector n 0.0)))&lt;br /&gt;
    (do ((i 0 (fx+ i 1)))&lt;br /&gt;
        ((fx= 10 i))&lt;br /&gt;
      (mulAtAv n u v)&lt;br /&gt;
      (mulAtAv n v u))&lt;br /&gt;
    (let loop ([i 0] [vBv 0.0] [vV 0.0])&lt;br /&gt;
      (if (fx&amp;lt; i n)&lt;br /&gt;
          (loop (fx+ i 1)&lt;br /&gt;
                (fl+ vBv (fl* (f64vector-ref u i) (f64vector-ref v i)))&lt;br /&gt;
                (fl+ vV (fl* (f64vector-ref v i) (f64vector-ref v i))))&lt;br /&gt;
          (flsqrt (fl/ vBv vV))))))&lt;br /&gt;
&lt;br /&gt;
;; --------------&lt;br /&gt;
&lt;br /&gt;
(define (A i j)&lt;br /&gt;
  (fl/ 1.0 (fixnum-&amp;gt;flonum (fx+ (fx+ (fxquotient (fx* (fx+ i j) (fx+ (fx+ i j) 1)) 2) i) 1))))&lt;br /&gt;
&lt;br /&gt;
;; --------------&lt;br /&gt;
&lt;br /&gt;
(define (mulAv n v av)&lt;br /&gt;
  (do ((i 0 (fx+ i 1)))&lt;br /&gt;
      ((fx= n i))&lt;br /&gt;
    (f64vector-set! av i 0.0)&lt;br /&gt;
    (do ((j 0 (fx+ j 1)))&lt;br /&gt;
        ((fx= n j))&lt;br /&gt;
      (let ()&lt;br /&gt;
        (declare (inlining-limit 10000))&lt;br /&gt;
        (f64vector-set! av i (fl+ (f64vector-ref av i) (fl* (A i j) (f64vector-ref v j))))))))&lt;br /&gt;
&lt;br /&gt;
;; --------------&lt;br /&gt;
&lt;br /&gt;
(define (mulAtV n v atv)&lt;br /&gt;
  (do ((i 0 (fx+ i 1)))&lt;br /&gt;
      ((= n i))&lt;br /&gt;
    (f64vector-set! atv i 0.0)&lt;br /&gt;
    (do ((j 0 (fx+ j 1)))&lt;br /&gt;
        ((fx= n j))&lt;br /&gt;
      (let ()&lt;br /&gt;
        (declare (inlining-limit 10000))&lt;br /&gt;
        (f64vector-set! atv i (fl+ (f64vector-ref atv i) (fl* (A j i) (f64vector-ref v j))))))))&lt;br /&gt;
&lt;br /&gt;
;; --------------&lt;br /&gt;
&lt;br /&gt;
(define (mulAtAv n v atav) &lt;br /&gt;
  (let ((u (make-f64vector n 0.0)))&lt;br /&gt;
    (mulAv n v u)&lt;br /&gt;
    (mulAtV n u atav)))&lt;br /&gt;
&lt;br /&gt;
;; -------------------------------&lt;br /&gt;
&lt;br /&gt;
(define (main . args)&lt;br /&gt;
  (let ((n (if (&amp;lt; (length args) 1)&lt;br /&gt;
               100&lt;br /&gt;
               (string-&amp;gt;number (car args)))))&lt;br /&gt;
    (display (roundto 9 (approximate n))) (newline)))&lt;br /&gt;
&lt;br /&gt;
; -------------------------------&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc spectral-norm&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi spectral-norm 5500&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_k-nucleotide</id>
		<title>Programming language shootout: k-nucleotide</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_k-nucleotide"/>
				<updated>2008-02-26T14:08:42Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: disabling interrupts is bad form and doesn't improve performance.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=knucleotide&amp;amp;lang=all k-nucleotide] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
This implementation is quite slow; nearly all the time is spent in all-counts.&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the MzScheme variant&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(fixnum)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define (substring-copy! dest dest-start source source-start source-end)&lt;br /&gt;
  (do ((i source-start (+ i 1))&lt;br /&gt;
       (j dest-start   (+ j 1)))&lt;br /&gt;
      ((= i source-end))&lt;br /&gt;
    (string-set! dest j (string-ref source i))))&lt;br /&gt;
&lt;br /&gt;
(define (strings-&amp;gt;string strings)&lt;br /&gt;
  (let* ((total-length&lt;br /&gt;
	  (do ((i 0 (+ i (string-length (car strings))))&lt;br /&gt;
	       (strings strings (cdr strings)))&lt;br /&gt;
	      ((null? strings) i)))&lt;br /&gt;
	 (result&lt;br /&gt;
	  (make-string total-length)))&lt;br /&gt;
    (let loop ((strings strings)&lt;br /&gt;
	       (i 0))&lt;br /&gt;
      (if (null? strings)&lt;br /&gt;
	  result&lt;br /&gt;
	  (let* ((string (car strings))&lt;br /&gt;
		 (n (string-length string)))&lt;br /&gt;
	    (substring-copy! result i string 0 n)&lt;br /&gt;
	    (loop (cdr strings)&lt;br /&gt;
		  (+ i n)))))))&lt;br /&gt;
&lt;br /&gt;
(define (insertion-sort lst &amp;lt;)&lt;br /&gt;
&lt;br /&gt;
  (define (insert item lst)&lt;br /&gt;
    (if (or (null? lst)&lt;br /&gt;
	    (&amp;lt; item (car lst)))&lt;br /&gt;
	(cons item lst)&lt;br /&gt;
	(cons (car lst)&lt;br /&gt;
	      (insert item (cdr lst)))))&lt;br /&gt;
&lt;br /&gt;
  (if (null? lst)&lt;br /&gt;
      lst&lt;br /&gt;
      (insert (car lst) (insertion-sort (cdr lst) &amp;lt;))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;&lt;br /&gt;
&lt;br /&gt;
;;;  Boiler-plate for formatting floating point values&lt;br /&gt;
&lt;br /&gt;
(define (roundto digits n)&lt;br /&gt;
  (declare (generic))&lt;br /&gt;
  (let* ((e (expt 10 digits))&lt;br /&gt;
         (num (round (abs (* e (inexact-&amp;gt;exact n)))))&lt;br /&gt;
         (str (number-&amp;gt;string (remainder num e))))&lt;br /&gt;
    (string-append&lt;br /&gt;
     (if (negative? n) &amp;quot;-&amp;quot; &amp;quot;&amp;quot;)&lt;br /&gt;
     (number-&amp;gt;string (quotient num e))&lt;br /&gt;
     &amp;quot;.&amp;quot;&lt;br /&gt;
     (make-string (- digits (string-length str)) #\0)&lt;br /&gt;
     str)))&lt;br /&gt;
&lt;br /&gt;
(define (upcase! str)&lt;br /&gt;
  (let ((n (string-length str)))&lt;br /&gt;
    (do ((i 0 (+ i 1)))&lt;br /&gt;
	((= i n) str)&lt;br /&gt;
      (string-set! str i (char-upcase (string-ref str i))))))&lt;br /&gt;
&lt;br /&gt;
(define (all-counts len dna)&lt;br /&gt;
  (let ((table (make-table test: string=?&lt;br /&gt;
			   size: (let ()&lt;br /&gt;
				   (declare (generic))&lt;br /&gt;
				   (min (expt 4 len) (string-length dna))))))&lt;br /&gt;
    (let loop ((s (- (string-length dna) len))&lt;br /&gt;
	       (seq (make-string len)))&lt;br /&gt;
      (if (&amp;lt; s 0)&lt;br /&gt;
	  table&lt;br /&gt;
	  (begin&lt;br /&gt;
	    (substring-copy! seq 0 dna s (+ s len))&lt;br /&gt;
	    (let* ((cnt (table-ref table seq 0)))&lt;br /&gt;
	      (table-set! table seq (+ 1 cnt))&lt;br /&gt;
	      (loop (- s 1)&lt;br /&gt;
		    (if (zero? cnt)&lt;br /&gt;
			(make-string len)&lt;br /&gt;
			seq))))))))&lt;br /&gt;
&lt;br /&gt;
(define (write-freqs table)&lt;br /&gt;
  (declare (generic))&lt;br /&gt;
  (let* ((keys+values (table-&amp;gt;list table))&lt;br /&gt;
	 (total  (apply + (map cdr keys+values))))&lt;br /&gt;
    (for-each (lambda (a)&lt;br /&gt;
		(display (car a)) (display &amp;quot; &amp;quot;)&lt;br /&gt;
		(display (roundto 3 (* 100 (/ (cdr a) total)))) (newline))&lt;br /&gt;
	      (insertion-sort keys+values (lambda (x y) (&amp;lt; (cdr y) (cdr x)))))))&lt;br /&gt;
&lt;br /&gt;
(define (write-one-freq table key)&lt;br /&gt;
  (let ((cnt (table-ref table key 0)))&lt;br /&gt;
    (display cnt) (display &amp;quot;\t&amp;quot;)&lt;br /&gt;
    (display key) (display &amp;quot;\n&amp;quot;)))&lt;br /&gt;
&lt;br /&gt;
(define dna&lt;br /&gt;
  (let ((port (current-input-port))&lt;br /&gt;
        (start &amp;quot;&amp;gt;THREE Homo sapiens frequency&amp;quot;))&lt;br /&gt;
    (let skip ((x (read-line port)))&lt;br /&gt;
      (if (not (string=? x start))&lt;br /&gt;
	  (skip (read-line port))&lt;br /&gt;
	  (let loop ((x (read-line port))&lt;br /&gt;
		     (s '()))&lt;br /&gt;
	    (if (eof-object? x)&lt;br /&gt;
		(strings-&amp;gt;string (reverse s))&lt;br /&gt;
		(loop (read-line port)&lt;br /&gt;
		      (cons (upcase! x) s))))))))&lt;br /&gt;
&lt;br /&gt;
;; 1-nucleotide counts:&lt;br /&gt;
(write-freqs (all-counts 1 dna))&lt;br /&gt;
(newline)&lt;br /&gt;
&lt;br /&gt;
;; 2-nucleotide counts:&lt;br /&gt;
(write-freqs (all-counts 2 dna))&lt;br /&gt;
(newline)&lt;br /&gt;
&lt;br /&gt;
;; Specific sequences:&lt;br /&gt;
(for-each (lambda (seq)&lt;br /&gt;
            (write-one-freq (all-counts (string-length seq) dna)&lt;br /&gt;
                            seq))&lt;br /&gt;
          '(&amp;quot;GGT&amp;quot; &amp;quot;GGTA&amp;quot; &amp;quot;GGTATT&amp;quot; &amp;quot;GGTATTTTAATT&amp;quot; &amp;quot;GGTATTTTAATTTATAGT&amp;quot;))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc k-nucleotide&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi k-nucleotide &amp;lt; knucleotide-input1000000.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The file knucleotide-input1000000.txt is generated by [[Programming language shootout: fasta| fasta]].&lt;br /&gt;
&lt;br /&gt;
Note: Running the program with the largest data set creates a string of length 5,000,000.  With four-byte characters (Gambit's default) this is 20,000,000 byte object, and the largest object that can be created in a 32-bit system is a bit less than 16MB.  So, either configure Gambit with --enable-char-size=1 (or 2) or use a 64-bit version of Gambit.&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_nsieve-bits</id>
		<title>Programming language shootout: nsieve-bits</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_nsieve-bits"/>
				<updated>2008-02-26T14:05:30Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: disabling interrupts is bad form and doesn't help performance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=nsievebits&amp;amp;lang=all nsieve-bits] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
;; $Id: nsieve-bits.scm,v 1.2 2008/02/17 23:44:02 lucier Exp lucier $&lt;br /&gt;
;; The Great Computer Language Shootout&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; nsieve benchmark for The Computer Language Shootout&lt;br /&gt;
;; Written by Dima Dorfman, 2004&lt;br /&gt;
;; Converted to MzScheme by Brent Fulgham&lt;br /&gt;
;; Converted to Gambit by Bradley Lucier&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(fixnum)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define (nsieve m)&lt;br /&gt;
  &lt;br /&gt;
  (define (make-bvector n val)&lt;br /&gt;
    (make-u8vector (quotient (+ n 7) 8)&lt;br /&gt;
		   (if val 255 0)))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-true? a i)&lt;br /&gt;
    (not (zero? (fxand (u8vector-ref a (quotient i 8))&lt;br /&gt;
		       (fxarithmetic-shift-left 1 (remainder i 8))))))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-clear! a i)&lt;br /&gt;
    (let* ((index (quotient i 8))&lt;br /&gt;
	   (byte (u8vector-ref a index))&lt;br /&gt;
	   (mask (fxarithmetic-shift-left 1 (remainder i 8))))&lt;br /&gt;
      (u8vector-set! a index (fxand byte (fxnot mask)))))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-set! a i)&lt;br /&gt;
    (let* ((index (quotient i 8))&lt;br /&gt;
	   (byte (u8vector-ref a index))&lt;br /&gt;
	   (mask (fxarithmetic-shift-left 1 (remainder i 8))))&lt;br /&gt;
      (u8vector-set! a index (fxior byte mask))))&lt;br /&gt;
  &lt;br /&gt;
  (let ((a (make-bvector m #t)))&lt;br /&gt;
    (let loop ((i 2)&lt;br /&gt;
	       (n 0))&lt;br /&gt;
      (if (&amp;lt; i m)&lt;br /&gt;
	  (if (bvector-true? a i)&lt;br /&gt;
	      (let clear ((j (+ i i)))&lt;br /&gt;
		(if (&amp;lt; j m)&lt;br /&gt;
		    (begin&lt;br /&gt;
		      (bvector-clear! a j)&lt;br /&gt;
		      (clear (+ j i)))&lt;br /&gt;
		    (loop (+ 1 i)&lt;br /&gt;
			  (+ 1 n))))&lt;br /&gt;
	      (loop (+ 1 i) n))&lt;br /&gt;
	  n))))&lt;br /&gt;
&lt;br /&gt;
(define (test n)&lt;br /&gt;
  &lt;br /&gt;
  (define (string-pad s n)&lt;br /&gt;
    (string-append (make-string (- n (string-length s)) #\space)&lt;br /&gt;
		   s))&lt;br /&gt;
  &lt;br /&gt;
  (let* ((m (* (expt 2 n) 10000))&lt;br /&gt;
	 (count (nsieve m)))&lt;br /&gt;
    (display (list &amp;quot;Primes up to &amp;quot;&lt;br /&gt;
		   (string-pad (number-&amp;gt;string m) 8)&lt;br /&gt;
		   &amp;quot; &amp;quot;&lt;br /&gt;
		   (string-pad (number-&amp;gt;string count) 8)&lt;br /&gt;
		   #\newline))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(define (main arg)&lt;br /&gt;
  &lt;br /&gt;
  (let ((n (string-&amp;gt;number arg)))&lt;br /&gt;
    (if (not n)&lt;br /&gt;
	(begin&lt;br /&gt;
	  (display &amp;quot;An integer is required&amp;quot;) (newline) 2)&lt;br /&gt;
	(begin&lt;br /&gt;
	  (if (&amp;gt;= n 0) (test n))&lt;br /&gt;
	  (if (&amp;gt;= n 1) (test (- n 1)))&lt;br /&gt;
	  (if (&amp;gt;= n 2) (test (- n 2)))&lt;br /&gt;
	  0))))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc nsieve-bits&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi nsieve 11&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_nsieve</id>
		<title>Programming language shootout: nsieve</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_nsieve"/>
				<updated>2008-02-26T14:02:10Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: disabling performance is bad style and doesn't improve performance much&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=nsieve&amp;amp;lang=all nsieve] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
;; $Id: nsieve.scm,v 1.3 2008/02/17 23:43:53 lucier Exp lucier $&lt;br /&gt;
;; The Great Computer Language Shootout&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
;;&lt;br /&gt;
;; nsieve benchmark for The Computer Language Shootout&lt;br /&gt;
;; Written by Dima Dorfman, 2004&lt;br /&gt;
;; Converted to MzScheme by Brent Fulgham&lt;br /&gt;
;; Converted to Gambit by Bradley Lucier&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(fixnum)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define (nsieve m)&lt;br /&gt;
&lt;br /&gt;
  ;; vectors with #t or #f are too big to be allocated&lt;br /&gt;
  ;; on 32-bit machines for the size of arguments in the test&lt;br /&gt;
  &lt;br /&gt;
  (define (make-bvector n val)&lt;br /&gt;
    (make-u8vector n (if val 1 0)))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-true? a i)&lt;br /&gt;
    (= (u8vector-ref a i) 1))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-clear! a i)&lt;br /&gt;
    (u8vector-set! a i 0))&lt;br /&gt;
  &lt;br /&gt;
  (define (bvector-set! a i)&lt;br /&gt;
    (u8vector-set! a i 1))&lt;br /&gt;
  &lt;br /&gt;
  (let ((a (make-bvector m #t)))&lt;br /&gt;
    (let loop ((i 2)&lt;br /&gt;
	       (n 0))&lt;br /&gt;
      (if (&amp;lt; i m)&lt;br /&gt;
	  (if (bvector-true? a i)&lt;br /&gt;
	      (let clear ((j (+ i i)))&lt;br /&gt;
		(if (&amp;lt; j m)&lt;br /&gt;
		    (begin&lt;br /&gt;
		      (bvector-clear! a j)&lt;br /&gt;
		      (clear (+ j i)))&lt;br /&gt;
		    (loop (+ 1 i)&lt;br /&gt;
			  (+ 1 n))))&lt;br /&gt;
	      (loop (+ 1 i) n))&lt;br /&gt;
	  n))))&lt;br /&gt;
&lt;br /&gt;
(define (test n)&lt;br /&gt;
  &lt;br /&gt;
  (define (string-pad s n)&lt;br /&gt;
    (string-append (make-string (- n (string-length s)) #\space)&lt;br /&gt;
		   s))&lt;br /&gt;
  &lt;br /&gt;
  (let* ((m (* (expt 2 n) 10000))&lt;br /&gt;
	 (count (nsieve m)))&lt;br /&gt;
    (display (list &amp;quot;Primes up to &amp;quot;&lt;br /&gt;
		   (string-pad (number-&amp;gt;string m) 8)&lt;br /&gt;
		   &amp;quot; &amp;quot;&lt;br /&gt;
		   (string-pad (number-&amp;gt;string count) 8)&lt;br /&gt;
		   #\newline))))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(define (main arg)&lt;br /&gt;
  (let ((n (string-&amp;gt;number arg)))&lt;br /&gt;
    (if (not n)&lt;br /&gt;
	(begin&lt;br /&gt;
	  (display &amp;quot;An integer is required&amp;quot;) (newline) 2)&lt;br /&gt;
	(begin&lt;br /&gt;
	  (if (&amp;gt;= n 0) (test n))&lt;br /&gt;
	  (if (&amp;gt;= n 1) (test (- n 1)))&lt;br /&gt;
	  (if (&amp;gt;= n 2) (test (- n 2)))&lt;br /&gt;
	  0))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc nsieve&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi nsieve 9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	<entry>
		<id>http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_fannkuch</id>
		<title>Programming language shootout: fannkuch</title>
		<link rel="alternate" type="text/html" href="http://dynamo.iro.umontreal.ca/wiki/index.php/Programming_language_shootout:_fannkuch"/>
				<updated>2008-02-26T13:59:30Z</updated>
		
		<summary type="html">&lt;p&gt;Bjlucier: re-enable interrupts (bad programming style)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a Gambit implementation of the [http://shootout.alioth.debian.org/gp4sandbox/benchmark.php?test=fannkuch&amp;amp;lang=all fannkuch] benchmark of the [[Programming language shootout|Computer Language Benchmarks Game]].&lt;br /&gt;
==The program==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!gsi-script&lt;br /&gt;
&lt;br /&gt;
;; The Computer Language Benchmarks Game&lt;br /&gt;
;; http://shootout.alioth.debian.org/&lt;br /&gt;
&lt;br /&gt;
;; Derived by Bradley Lucier from the Ikarus variant&lt;br /&gt;
;; derived by Michael D. Adams from the O'Caml variant, by Christophe Papazian&lt;br /&gt;
&lt;br /&gt;
(declare (standard-bindings)(extended-bindings)(block)(not safe))&lt;br /&gt;
&lt;br /&gt;
(define (write-permutation perm)&lt;br /&gt;
  (for-each write (vector-&amp;gt;list perm))&lt;br /&gt;
  (newline))&lt;br /&gt;
&lt;br /&gt;
;; Find first value where r[i] != i&lt;br /&gt;
;; and increment (mod j+2) all values up to that (i.e. set them to j+1)&lt;br /&gt;
;; returning i+2&lt;br /&gt;
(define (choose-next r)&lt;br /&gt;
  (let loop ((i 0))&lt;br /&gt;
    (if (eq? (vector-ref r i) i)&lt;br /&gt;
        (loop (fx+ 1 i))&lt;br /&gt;
        (let loop ((j 0))&lt;br /&gt;
          (if (eq? j i)&lt;br /&gt;
              (begin (vector-set! r j (fxremainder (fx+ 1 (vector-ref r j)) (fx+ j 2)))&lt;br /&gt;
                     (fx+ j 2))&lt;br /&gt;
              (begin (vector-set! r j (fx+ j 1))&lt;br /&gt;
                     (loop (fx+ j 1))))))))&lt;br /&gt;
&lt;br /&gt;
;; Count number of &amp;quot;pancake flips&amp;quot; it takes to get p[0]=1&lt;br /&gt;
;; Does not side-effect p, uses s as a temporary&lt;br /&gt;
;; &amp;quot;Pancake flip&amp;quot; = Reverse first p[0]-1 elements&lt;br /&gt;
(define (count-flips n p s)&lt;br /&gt;
  ;; Check if all p[i] != i+1&lt;br /&gt;
  (define (check i)&lt;br /&gt;
    (or (eq? i n)&lt;br /&gt;
        (and (not (eq? (vector-ref p i) (fx+ i 1)))&lt;br /&gt;
             (check (fx+ i 1)))))&lt;br /&gt;
  ;; If all p[i] != i+1&lt;br /&gt;
  (if (check 0)&lt;br /&gt;
      (begin&lt;br /&gt;
        ;; set all s[i] = p[i]&lt;br /&gt;
        (do ((i 0 (fx+ i 1)))&lt;br /&gt;
            ((eq? i n))&lt;br /&gt;
          (vector-set! s i (vector-ref p i)))&lt;br /&gt;
        ;; keep reversing the first s[0]-1 values of s until s[0] = 1&lt;br /&gt;
        ;; and return number of flippings&lt;br /&gt;
        (do ((flips 0 (fx+ flips 1))&lt;br /&gt;
             (s0 (fx- (vector-ref s 0) 1)&lt;br /&gt;
                 (fx- (vector-ref s 0) 1)))&lt;br /&gt;
            ((eq? s0 0)&lt;br /&gt;
             flips)&lt;br /&gt;
          ;; reverse the first s[0]-1 values of s&lt;br /&gt;
          (do ((i 0  (fx+ i 1))&lt;br /&gt;
               (j s0 (fx- j 1)))&lt;br /&gt;
              ((fx&amp;gt;= i j))&lt;br /&gt;
            (let ((tmp (vector-ref s i)))&lt;br /&gt;
              (vector-set! s i (vector-ref s j))&lt;br /&gt;
              (vector-set! s j tmp)))))&lt;br /&gt;
      0))&lt;br /&gt;
&lt;br /&gt;
;; Build a new permutation by &amp;quot;braiding&amp;quot;:&lt;br /&gt;
;;  For every i in [1..n-1]:&lt;br /&gt;
;;    Shift each p[j&amp;lt;i] down by one&lt;br /&gt;
;;    and put p[0] at p[i]&lt;br /&gt;
(define (braid n p)&lt;br /&gt;
  ;; For every i in [1..n-1]&lt;br /&gt;
  (do ((i 1 (fx+ i 1)))&lt;br /&gt;
      ((eq? i n))&lt;br /&gt;
    ;; Shift each p[j] down by one&lt;br /&gt;
    ;; and put p[0] at p[i]&lt;br /&gt;
    (let ((t (vector-ref p 0)))&lt;br /&gt;
      (do ((j 0 (fx+ j 1)))&lt;br /&gt;
          ((eq? j i))&lt;br /&gt;
        (vector-set! p j (vector-ref p (fx+ j 1))))&lt;br /&gt;
      (vector-set! p i t))))&lt;br /&gt;
&lt;br /&gt;
(define (fannkuch n r p s m z)&lt;br /&gt;
  (let ((i (choose-next r)))&lt;br /&gt;
    (if (fx&amp;gt; i n)&lt;br /&gt;
        m&lt;br /&gt;
        (begin&lt;br /&gt;
          (if (fx&amp;gt; z 0) (write-permutation p))&lt;br /&gt;
          (braid i p)&lt;br /&gt;
          (fannkuch n r p s (max m (count-flips n p s)) (fx- z 1))))))&lt;br /&gt;
&lt;br /&gt;
(define (main . args)&lt;br /&gt;
  (let ((n (string-&amp;gt;number (car args))))&lt;br /&gt;
    (let ((r (make-vector n))&lt;br /&gt;
          (p (make-vector n))&lt;br /&gt;
          (s (make-vector n 0)))&lt;br /&gt;
&lt;br /&gt;
      ;; Init r and p to [1,...,n]&lt;br /&gt;
      (do ((i 0 (fx+ 1 i)))&lt;br /&gt;
          ((eq? i n))&lt;br /&gt;
        (vector-set! r i (fx+ i 1))&lt;br /&gt;
        (vector-set! p i (fx+ i 1)))&lt;br /&gt;
&lt;br /&gt;
      ;; No need to init s; it is only used as a temporary&lt;br /&gt;
&lt;br /&gt;
      (let ((x (fannkuch n r p s 0 30)))&lt;br /&gt;
        (display &amp;quot;Pfannkuchen(&amp;quot;)(display n)(display &amp;quot;) = &amp;quot;)&lt;br /&gt;
        (display x)(newline)))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Compiling==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsc fannkuch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==Running==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gsi fannkuch n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Bjlucier</name></author>	</entry>

	</feed>