https://gambitscheme.org/wiki/api.php?action=feedcontributions&user=Jonathan+Arkell&feedformat=atomGambit wiki - User contributions [en]2024-03-28T10:07:01ZUser contributionsMediaWiki 1.35.3https://gambitscheme.org/wiki/index.php?title=Talk:Define-type&diff=2329Talk:Define-type2009-10-13T22:27:43Z<p>Jonathan Arkell: New page: I've moved all the content here into the Documentation section for 2 purposes: 1) This will increase the chances of the documentation making it into the manual 2) It will be available...</p>
<hr />
<div>I've moved all the content here into the Documentation section for 2 purposes:<br />
<br />
1) This will increase the chances of the documentation making it into the manual<br />
2) It will be available to the internal gambit documentation system<br />
<br />
--Jonathan Arkell</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Define-type&diff=2328Define-type2009-10-13T22:25:46Z<p>Jonathan Arkell: moved content</p>
<hr />
<div>#REDIRECT [[Documentation:Special_form_define-record-type]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Special:Badtitle/NS100:Special_form_define-record-type&diff=2327Special:Badtitle/NS100:Special form define-record-type2009-10-13T22:24:16Z<p>Jonathan Arkell: Moved content</p>
<hr />
<div><texinfo><br />
<br />
@deffn {special form} define-record-type @dots{}<br />
@deffnx {special form} define-type @dots{}<br />
@end deffn<br />
<br />
</texinfo><br />
<br />
<hr><br />
<br />
===User contributed comments, clarifications and examples===<br />
<br />
[http://www.r6rs.org/r6rs-editors/2005-June/000664.html Mark Feeley explains Gambit-C Records on r6rs-editors]<br />
<br />
<br />
==== Content from define-type on main wiki page ====<br />
<br />
== define-type / define-structure usage ==<br />
<br />
Here is a traduction of some of Marc's slides from an introduction to scheme course. I believe they might be usefull since define-type / define-record are very lightly documented in the official doc.<br />
<br />
=== Syntax ===<br />
<br />
(define-type type-name <attribute or field>...)<br />
<br />
Attribute is a keyword. An attribute may have arguments?<br />
<br />
Field is a symbol or a list. If a list, the first element is the field name, optionally followed by getter and setter, then field attributes<br />
<br />
The simplest form of syntax specifies only the type name and the name of each fields<br />
*ex:<br />
<br />
:C: '''typedef struct { int x; int y; } point2d;'''<br />
:Gambit : '''(define-type point2d x y)'''<br />
<br />
*Such type definition are equivalent to multiple definitions:<br />
(define (make-point2d x y)...) ;constructor<br />
(define (point2d? obj)... ) ;predicate<br />
(define (point2d-x p)...) ;access to x field<br />
(define (point2d-x-set! p x)...) ;mutation of x field<br />
(define (point2d-y p)...) ;access to y field<br />
(define (point2d-y-set! p y)...) ;mutation of y field<br />
<br />
*ex:<br />
<br />
> (define-type point2d x y)<br />
> (define p (make-point2d 11 22))<br />
> p<br />
#<point2d #2 x: 11 y: 22><br />
> (point2d? p)<br />
#t<br />
> (point2d-x p)<br />
11<br />
> (point2d-x-set! p 33)<br />
> p<br />
#<point2d #2 x: 33 y: 22><br />
<br />
=== define-type attributes ===<br />
<br />
*These structures also supports inheritance<br />
*The parameter '''extender:''' ''name'' specifies the name of the definition form to use to define a subtype:<br />
> (define-type point2d<br />
extender: define-type-of-point2d<br />
x<br />
y)<br />
> (define-type-of-point2d point3d z)<br />
> (define p3 (make-point3d 11 22 33))<br />
> p3<br />
#<point3d #2 x: 11 y: 22 z: 33><br />
> (point2d? p3)<br />
#t<br />
> (point3d? p3)<br />
#t<br />
> (point2d-x p3)<br />
11<br />
> (point3d-z p3)<br />
33<br />
<br />
<br />
TODO other define-type's parameters:<br />
*'''id:'''<br />
*'''constructor:'''<br />
*'''constant-constructor:'''<br />
*'''predicate:'''<br />
*'''implementer:'''<br />
*'''type-exhibitor:'''<br />
*'''prefix:'''<br />
*'''opaque:'''<br />
*'''macros:'''<br />
<br />
=== Field attributes ===<br />
<br />
*Field attributes:<br />
**'''read-write:'''<br />
**'''read-only:''' non mutable field<br />
**'''equality-test:'''<br />
**'''equality-skip:''' the '''equal?''' function will ignore this field<br />
**'''printable:'''<br />
**'''unprintable:''' the '''write''' function will ignore it<br />
**'''init:''' ''cst'' initial value<br />
<br />
*ex:<br />
> (define-type noeud<br />
(a unprintable:)<br />
(b read-only: init: 9)<br />
(c equality-skip:))<br />
> (define x (make-noeud 1 2))<br />
> (noeud-a-set! x x)<br />
> x<br />
#<noeud #2 b: 9 c: 2><br />
> (equal? x (make-noeud x 3))<br />
#t<br />
> (noeud-b-set! x 999)<br />
*** ERROR -- Unbound variable: noeud-b-set!<br />
<br />
All field attributes except '''init:''' can be specified at define-type level and will affect all fields. A field can specify its own field attributes to override default attributes.<br />
<br />
*ex:<br />
> (define-type foo unprintable: a (b printable:))<br />
> (make-foo 1 2)<br />
#<foo #3 b: 2><br />
<br />
*Field may have non-conventional getter and setter names, specified after field name in that order<br />
<br />
*ex:<br />
> (define-type foo (a get-a) (b get-b set-b))<br />
> (define x (make-foo 1 2))<br />
> (get-a x)<br />
1<br />
> (set-a x 2)<br />
*** ERROR IN (console)@14.2 -- Unbound variable: set-a<br />
> (get-b x)<br />
2<br />
> (set-b x 3)<br />
> (get-b x)<br />
3</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Special:Badtitle/NS100:Procedure_continuation%3F&diff=2324Special:Badtitle/NS100:Procedure continuation?2009-10-11T04:50:52Z<p>Jonathan Arkell: Fixed hyperlink</p>
<hr />
<div><texinfo><br />
<br />
@deffn procedure continuation? @var{obj}<br />
@deffnx procedure continuation-capture @var{proc}<br />
@deffnx procedure continuation-graft @var{cont} @var{proc} @var{obj}@dots{}<br />
@deffnx procedure continuation-return @var{cont} @var{obj}@dots{}<br />
@end deffn<br />
<br />
</texinfo><br />
<br />
<hr><br />
<br />
===User contributed comments, clarifications and examples===<br />
<br />
From Mark Feelys Paper [http://3e8.org/pub/pdf-t1/feeley.pdf]:<br />
<br />
(continuation-capture receiver) – creates a continuation<br />
object representing the current continuation and<br />
tail-calls the receiver procedure with this continuation<br />
as the single argument.<br />
<br />
(continuation-graft cont thunk) – calls the thunk<br />
with no argument and the implicit continuation cont.<br />
<br />
(continuation-return cont value1...) – returns the<br />
value(s) to the continuation cont (the definition given<br />
above in terms of continuation-graft is still valid).</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Special:Badtitle/NS100:Procedure_call-with-current-continuation&diff=2323Special:Badtitle/NS100:Procedure call-with-current-continuation2009-10-11T04:05:39Z<p>Jonathan Arkell: </p>
<hr />
<div><texinfo><br />
<br />
@deffn procedure call-with-current-continuation @var{proc}<br />
@deffnx procedure call/cc @var{proc}<br />
<br />
The procedure @code{call-with-current-continuation} is bound to the<br />
global variables @code{call-with-current-continuation} and<br />
@code{call/cc}.<br />
<br />
@end deffn<br />
<br />
</texinfo><br />
<br />
<hr><br />
<br />
===User contributed comments, clarifications and examples===<br />
<br />
These procedures return a procedure that invokes the continuation, and not the continuations themselves.<br />
<br />
> (procedure? (call/cc (lambda (k) k)))<br />
#t<br />
> (continuation? (call/cc (lambda (k) k)))<br />
#f<br />
> (procedure? (continuation-capture (lambda (k) k)))<br />
#f<br />
> (continuation? (continuation-capture (lambda (k) k)))<br />
#t<br />
<br />
<texinfo><br />
<br />
@i{No comments yet!}<br />
<br />
</texinfo></div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Special:Badtitle/NS100:Procedure_display-exception&diff=2322Special:Badtitle/NS100:Procedure display-exception2009-10-11T03:55:45Z<p>Jonathan Arkell: </p>
<hr />
<div><texinfo><br />
<br />
@deffn procedure display-exception @var{exc} @r{[}@var{port}@r{]}<br />
@deffnx procedure display-exception-in-context @var{exc} @var{cont} @r{[}@var{port}@r{]}<br />
@deffnx procedure display-procedure-environment @var{proc} @r{[}@var{port}@r{]}<br />
@deffnx procedure display-continuation-environment @var{cont} @r{[}@var{port}@r{]}<br />
@deffnx procedure display-continuation-dynamic-environment @var{cont} @r{[}@var{port}@r{]}<br />
@deffnx procedure display-continuation-backtrace @var{cont} @r{[}@var{port} @r{[}@var{all-frames?} @r{[}@var{display-env?} @r{[}@var{max-head} @r{[}@var{max-tail} @r{[}@var{depth}@r{]}@r{]}@r{]}@r{]}@r{]}@r{]}<br />
@end deffn<br />
<br />
</texinfo><br />
<br />
<hr><br />
<br />
===User contributed comments, clarifications and examples===<br />
<br />
Note, that you cannot use continuations returned by [[Documentation:Procedure_call-with-current-continuation]], because [[Documentation:Procedure_call-with-current-continuation]] returns a procedure that invokes a continuation, and not the continuation itself. Instead you can use [[Documentation:Procedure_continuation-capture]] in exactly the same way as [[Documentation:Procedure_call-with-current-continuation]]<br />
<br />
<texinfo><br />
<br />
@i{No comments yet!}<br />
<br />
</texinfo></div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Talk:Main_Page&diff=2317Talk:Main Page2009-09-28T21:26:29Z<p>Jonathan Arkell: </p>
<hr />
<div>I have 2 feature requests:<br />
<br />
Would it be possible to have the default search include the Documentation namespace?<br />
<br />
Marc: What do you mean by the "default search"? The top text field and go/search buttons are the standard search provided by WikiMedia. I don't know WikiMedia well enough to modify it. Doesn't it search all pages? The second text field searches Google, and the third GMane. Should I add another field?<br />
<br />
I was thinking just the main search page and the top Search box. It should be fairly simple, all you need to do is update the $wgNamespaceToBeSearchedDefault variable. (http://www.mediawiki.org/wiki/Manual:$wgNamespacesToBeSearchedDefault) --Jonathan Arkell <br />
<br />
<br />
Also, can you add the [[Special:RecentChanges]] link to the main navigation?<br />
<br />
Marc: sure, but where? In the "toolbox", or "contributing", or "overview" sections?<br />
<br />
I think the "Overview" or "Contributing" are both good places. --JA</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Talk:Main_Page&diff=2314Talk:Main Page2009-09-26T18:06:21Z<p>Jonathan Arkell: 2 more feature requests</p>
<hr />
<div>I have 2 feature requests:<br />
<br />
Would it be possible to have the default search include the Documentation namespace? Also, can you add teh [[Special:RecentChanges]] link to the main navigation?</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Sakuryaku&diff=2312Sakuryaku2009-09-21T21:57:12Z<p>Jonathan Arkell: /* Sakuryaku */</p>
<hr />
<div>Sakuryaku is the tentative name for a set of emacs extensions to gambit.el. One day it will be more slime then slime, but for now, it is just an idea, with a little bit of elisp.<br />
<br />
<br />
It is split apart into a few sections:<br />
<br />
* sakuryaku-repl.el - REPL helper functions (coming soon, an ECB status bar)<br />
* sakuryaku-docco.el - Grab documentation from info files (coming soon, a hook into eldoc)<br />
* sakuryaku-gambit-ext.el - extensions to gambit.el<br />
<br />
I'll post it to the wiki, until I find a better home for it (git repos somewhere, possibly github)<br />
<br />
[[media:sakuryaku.zip]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=File:Sakuryaku.zip&diff=2311File:Sakuryaku.zip2009-09-21T21:52:12Z<p>Jonathan Arkell: Very alpha release of Sakuryaku</p>
<hr />
<div>Very alpha release of Sakuryaku</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Sakuryaku&diff=2310Sakuryaku2009-09-21T21:49:36Z<p>Jonathan Arkell: New page: =Sakuryaku = Sakuryaku is the tentative name for a set of emacs extensions to gambit.el. One day it will be more slime then slime, but for now, it is just an idea, with a little bit of e...</p>
<hr />
<div>=Sakuryaku =<br />
<br />
Sakuryaku is the tentative name for a set of emacs extensions to gambit.el. One day it will be more slime then slime, but for now, it is just an idea, with a little bit of elisp.<br />
<br />
<br />
It is split apart into a few sections:<br />
<br />
* sakuryaku-repl.el - REPL helper functions (coming soon, an ECB status bar)<br />
* sakuryaku-docco.el - Grab documentation from info files (coming soon, a hook into eldoc)<br />
* sakuryaku-gambit-ext.el - extensions to gambit.el<br />
<br />
I'll post it to the wiki, until I find a better home for it (git repos somewhere, possibly github)</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Special:Badtitle/NS100:Procedure_continuation%3F&diff=2309Special:Badtitle/NS100:Procedure continuation?2009-09-21T01:27:31Z<p>Jonathan Arkell: added continuation documentation from Marks paper</p>
<hr />
<div><texinfo><br />
<br />
@deffn procedure continuation? @var{obj}<br />
@deffnx procedure continuation-capture @var{proc}<br />
@deffnx procedure continuation-graft @var{cont} @var{proc} @var{obj}@dots{}<br />
@deffnx procedure continuation-return @var{cont} @var{obj}@dots{}<br />
@end deffn<br />
<br />
</texinfo><br />
<br />
<hr><br />
<br />
===User contributed comments, clarifications and examples===<br />
<br />
From Mark Feelys Paper [http://3e8.org/ pub/pdf-t1/feeley.pdf]:<br />
<br />
(continuation-capture receiver) – creates a continuation<br />
object representing the current continuation and<br />
tail-calls the receiver procedure with this continuation<br />
as the single argument.<br />
<br />
(continuation-graft cont thunk) – calls the thunk<br />
with no argument and the implicit continuation cont.<br />
<br />
(continuation-return cont value1...) – returns the<br />
value(s) to the continuation cont (the definition given<br />
above in terms of continuation-graft is still valid).</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Black_Hole&diff=2308Black Hole2009-09-20T17:15:56Z<p>Jonathan Arkell: added note about where to install blackhole-libs and a pointer to blackhole-web</p>
<hr />
<div>'''Black Hole''' (“BH”) is a module system abstraction for [[Documentation|Gambit]] providing recurring module file dependency compilation and loading, including export of macros, for regular R5RS Scheme.<br />
<br />
Read further in the Introduction section of the documentation, found below.<br />
<br />
== Download ==<br />
Its latest version is avilable via GIT, and can be downloaded using [http://www.git-scm.org GIT] by<br />
<br />
:<nowiki>git clone git://github.com/pereckerdal/blackhole.git</nowiki><br />
<br />
There are also some libraries for Black Hole at<br />
<br />
:<nowiki>git clone git://github.com/pereckerdal/blackhole-libs.git</nowiki><br />
<br />
or non-automatically, probably very old copy [[media:Black_Hole.zip|here]].<br />
<br />
Make sure you put the blackhole-libs into a directory called "std" in ~~/lib/modules<br />
<br />
== Documentation == <br />
Core documentation: [[media:Black_Hole_Core.pdf|PDF]], [[media:Black_Hole_Core.odf|OpenOffice]] and [[media:Black_Hole_Core.doc|Microsoft Word]]<br />
<br />
Bundled libraries documentation: [[media:Black_Hole_Bundled_libraries.pdf|PDF]], [[media:Black_Hole_Bundled_libraries.odf|OpenOffice]] and [[media:Black_Hole_Bundled_libraries.doc|Microsoft Word]]<br />
<br />
(The tutorial for the alpha release can still be found on http://mwaza.dyndns.org/apps/files/bh-tutorial.html .)<br />
<br />
== Bundled libraries ==<br />
BH is bundled with a set of general purpose libraries, including:<br />
<br />
*SRFI 1 (list processing), 13 (string), 14 (character sets), 16 (case-lambda support), 19 (time data types and procedures), 95 (sorting)<br />
*pregexp, hash digestion, base64 handling, UUID generator<br />
*HTTP client, server, URI and session variable handling<br />
*XML&lt;-&gt;SXML routines<br />
*FIFO queue, mailbox, weight balanced tree, erlang-style list matcher<br />
*String, u8vector, list, exception handling helper libraries<br />
*let-optionals support<br />
<br />
BH's core is completely independent of the bundled libraries, and can be separated from them without any modifications.<br />
<br />
See the documentation for more information.<br />
<br />
== Additional libraries ==<br />
Termite: A version suited for usage in Black Hole is found at GitHub, http://github.com/pereckerdal/termite/tree/master.<br />
<br />
Blackhole-web: More extensions to BlackHole for use as a web framework are here:<br />
http://github.com/jonnay/Blackhole-web. Currently it is just a copy of SSAX-SXML, but more are planned. Check the Blackhole-web.org file for more information on what is to be done, and what is planned.</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Special:Badtitle/NS100:Procedure_compile-file&diff=2306Special:Badtitle/NS100:Procedure compile-file2009-09-20T17:02:55Z<p>Jonathan Arkell: Added notes about cygwin compilation</p>
<hr />
<div><texinfo><br />
<br />
@deffn procedure compile-file @var{file} @r{[}@code{options:} @var{options}@r{]} @r{[}@code{output:} @var{output}@r{]} @r{[}@code{cc-options:} @var{cc-options}@r{]} @r{[}@code{ld-options-prelude:} @var{ld-options-prelude}@r{]} @r{[}@code{ld-options:} @var{ld-options}@r{]}<br />
@pindex gsc<br />
@findex load<br />
@cindex object file<br />
<br />
The @var{file}, @var{options}, and @var{output} parameters have the<br />
same meaning as for the @code{compile-file-to-c} procedure. The<br />
@var{cc-options} parameter is a string containing the options to pass<br />
to the C compiler and the @var{ld-options-prelude} and<br />
@var{ld-options} parameters are strings containing the options to pass<br />
to the C linker (the options in @var{ld-options-prelude} are passed to<br />
the C linker before the input file and the options in @var{ld-options}<br />
are passed after).<br />
<br />
The @code{compile-file} procedure compiles the source file into an<br />
object file by first generating a C file and then compiling it with<br />
the C compiler. The C file is always generated in the same directory<br />
as @var{file}.<br />
<br />
By default the object file is named after @var{file} with the<br />
extension replaced with @samp{.o@var{n}}, where @var{n} is a positive<br />
integer that acts as a version number. The next available version<br />
number is generated automatically by @code{compile-file}. The name of<br />
the generated object file can be specified with the @var{output}<br />
parameter. If @var{output} is a string naming a directory then the<br />
object file is created in that directory. Otherwise the name of the<br />
object file is @var{output}.<br />
<br />
Object files can be loaded dynamically by using the @code{load}<br />
procedure. The @samp{.o@var{n}} extension can be specified (to select<br />
a particular version) or omitted (to load the highest numbered<br />
version). When older versions are no longer needed, all versions must<br />
be deleted and the compilation must be repeated (this is necessary<br />
because the file name, including the extension, is used to name some<br />
of the exported symbols of the object file).<br />
<br />
Note that this procedure is only available on host operating systems<br />
that support dynamic loading.<br />
<br />
@end deffn<br />
<br />
</texinfo><br />
<br />
<hr><br />
<br />
===User contributed comments, clarifications and examples===<br />
<br />
<texinfo><br />
<br />
@i{No comments yet!}<br />
<br />
</texinfo><br />
<br />
I couldn't get compile-file to work under cygwin with a Gambit install out of the box. Instead I had to make a few modifications:<br />
<br />
First you have to move ~~/bin/gambc-cc.bat to ~~/bin/gambc-cc.sh (Assuming you got the unix version. You can compare it with the <gambit-src-distro>/bin/gambc-cc.bat.unix to be sure).<br />
<br />
Next up, make a simple dos batch file to call the bash file:<br />
<br />
c:\bin\bash.exe /usr/local/Gambit-C/v4.5.2/bin/gambc-cc.sh %*<br />
<br />
Don't forget to set the path to wherever you installed Gambit!<br />
<br />
Finally, make sure both the bat and sh scripts have the executable flag set<br />
<br />
chmod 777 gambc-cc.sh<br />
chmod 777 gambc-cc.bat<br />
<br />
After that, compilation with (compile-file) should work perfectly.</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=GambitNds&diff=371GambitNds2008-11-13T01:47:12Z<p>Jonathan Arkell: </p>
<hr />
<div>This will be a page describing the efforts to build a version of Gambit optimized for NDS (Nintendo DS) development.<br />
<br />
Right now it will just point to the [[Distributions]] page, and contain a few notes.<br />
<br />
<br />
<br />
== Decreasing the size of the Gambit executable ==<br />
<br />
One of the Biggest challenges is the RAM limitation on the DS (4 megs). Gambit, even when properly compressed will take 3 of those. <br />
<br />
=== Get rid of the fancy bignum algorithms ===<br />
<br />
Gambit includes fast algorithms for large integer multiplication, division, and gcd.<br />
<br />
You probably don't need them on the NDS. To remove them from the executable, after you've done<br />
a "make bootstrap" change the line<br />
<pre><br />
(##define-macro (use-fast-bignum-algorithms) #t)<br />
</pre><br />
in _num.scm to<br />
<pre><br />
(##define-macro (use-fast-bignum-algorithms) #f)<br />
</pre><br />
and do another "make". Gambit's constant propagation and dead-code elimination will eliminate all<br />
the code (and tables) for the fancy bignum algorithms.<br />
<br />
=== Radical surgery on the Gambit runtime ===<br />
<br />
(Note: In revision 207, _kernel.scm was changed so that these warnings do not occur, and you don't have to provide your own<br />
versions of ##map, ##string->symbol, ##+, and ##*.)<br />
<br />
Recently Marc sent a message about how to radically decrease the size of the executable:<br />
<br />
<pre><br />
Actually there is another one, which consists in eliminating the whole <br />
Gambit library, except for the "essentials" (lib/_kernel.scm and some <br />
of the C files in lib/ which implement the GC, C-interface,<br />
initialization code, etc).<br />
<br />
Using this technique (see trace below) I managed to build a 300 kB <br />
executable on MacOS X from the v4.2.9 tarball. This could be reduced <br />
some more by removing some functionality. Anyway, this is just a <br />
quick-and-dirty experiment.<br />
<br />
The downside of course is that you have to implement yourself whatever <br />
you need in your application. You only have very basic functionality <br />
(the inlinable primitives like ##fx+, ##cons, ##car). This is like <br />
reinventing the wheel... but I'm sure some users will appreciate the <br />
hack value!<br />
<br />
Marc<br />
<br />
% tar zxf gambc-v4_2_9.tgz<br />
% cd gambc-v4_2_9<br />
% ./configure --enable-single-host<br />
% make bootstrap<br />
% ################ Now edit lib/makefile.in .<br />
% diff lib/makefile.in lib/makefile.in-orig<br />
< MODULES = _kernel<br />
< MODULES_SCM = _kernel.scm<br />
< MODULES_C = _kernel.c<br />
< MODULES_O = _kernel@obj@<br />
< MODULES_O_PLUS = +_kernel@obj@<br />
< MODULES_O_COMMA = _kernel@obj@<br />
---<br />
MODULES = _kernel _system _num _std \<br />
_eval _io _nonstd _thread _repl<br />
MODULES_SCM = _kernel.scm _system.scm _num.scm _std.scm \<br />
_eval.scm _io.scm _nonstd.scm _thread.scm _repl.scm<br />
MODULES_C = _kernel.c _system.c _num.c _std.c \<br />
_eval.c _io.c _nonstd.c _thread.c _repl.c<br />
MODULES_O = _kernel@obj@ _system@obj@ _num@obj@ _std@obj@ \<br />
_eval@obj@ _io@obj@ _nonstd@obj@ _thread@obj@ _repl@obj@<br />
MODULES_O_PLUS = +_kernel@obj@ +_system@obj@ +_num@obj@ +_std@obj@ \<br />
+_eval@obj@ +_io@obj@ +_nonstd@obj@ +_thread@obj@ +_repl@obj@<br />
MODULES_O_COMMA = _kernel@obj@,_system@obj@,_num@obj@,_std@obj@,\<br />
+_eval@obj@,_io@obj@,_nonstd@obj@,_thread@obj@,_repl@obj@<br />
81c87,88<br />
< MODULES_O_IN_COMPILE_ORDER = _kernel@obj@<br />
---<br />
MODULES_O_IN_COMPILE_ORDER = _io@obj@ _num@obj@ _std@obj@ \<br />
_kernel@obj@ _nonstd@obj@ _repl@obj@ _eval@obj@ _thread@obj@ <br />
_system@obj@<br />
% make clean<br />
% make<br />
making all in include<br />
...<br />
making all in lib<br />
...<br />
../gsc-comp -:=.. -f -link -flat -o _gambc.c _kernel.c<br />
*** WARNING -- "##*" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
*** WARNING -- "##+" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
*** WARNING -- "##map" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
*** WARNING -- "##string->symbol" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
% ################ Note that lib/_kernel.scm depends on some Gambit<br />
% ################ library procedures that are not defined in<br />
% ################ lib/_kernel.scm. This will be fixed so that<br />
% ################ lib/_kernel.scm is self contained, as it should.<br />
% ################ Now create hw.scm .<br />
% cat hw.scm<br />
;; Make sure the compiler does not assume the standard library is<br />
;; linked in.<br />
(declare<br />
(block)<br />
(not inline)<br />
(not inline-primitives)<br />
(inlining-limit 0)<br />
(not run-time-bindings)<br />
)<br />
<br />
;; Supply the procedures lib/_kernel.scm needs (this dependency should<br />
;; be removed since it is gratuitous).<br />
(define (##map f lst) '()) ;; I'm lazy<br />
(define (##string->symbol str) 'foo)<br />
(define (##+ x y) 0)<br />
(define (##* x y) 0)<br />
<br />
;; The "hello world" program:<br />
<br />
(c-declare "#include <stdio.h>")<br />
<br />
(define puts (c-lambda (char-string) int "puts"))<br />
<br />
(puts "hello world")<br />
% ./gsc-comp -:=. -c hw.scm<br />
% ./gsc-comp -:=. -link hw.c<br />
% gcc -Iinclude -D___SINGLE_HOST hw_.c hw.c lib/libgambc.a -o hw<br />
% strip hw<br />
% ls -l hw<br />
-rwxr-xr-x 1 feeley feeley 300384 Oct 4 09:22 hw<br />
% ./hw<br />
hello world<br />
</pre><br />
<br />
== Tree Shake ==<br />
This has some serious implications for a completely updated version of GambitNds. Again a message from Mark on the mailing list:<br />
<pre><br />
I have implemented a simple quick-and-dirty tree-shaker for those <br />
interested in experimenting with such a thing.<br />
<br />
To try it out, update your Gambit to the latest sources. The tree- <br />
shaker is disabled by default. To use it you must compile your <br />
program this way:<br />
<br />
% gsc -e '(set! c#targ-tree-shake? #t)' test.scm<br />
<br />
The tree-shaker will only remove from a compiled file the procedures <br />
which are not reachable *and* defined in the scope of a (declare <br />
(block)). So if you compile this program:<br />
<br />
(declare (block))<br />
<br />
(define (f x)<br />
(+ (* x x)<br />
(- x 1)))<br />
<br />
(define (g y)<br />
(f (f y)))<br />
<br />
(pp 123)<br />
<br />
both f and g are eliminated. If the (pp 123) is changed to (pp (g <br />
123)) then there is code generated for f, but ***not for g*** because <br />
the compiler has inlined g so that the main call is really (pp (f (f <br />
123))).<br />
<br />
For the experimenter... implement a Scheme library in lib.scm and <br />
compile your program like so:<br />
<br />
(declare (block))<br />
(include "lib.scm")<br />
...your program here...<br />
<br />
The last step is to link with a minimal Gambit runtime library <br />
containing only _kernel.scm .<br />
</pre></div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Installer&diff=360Installer2008-10-28T04:15:32Z<p>Jonathan Arkell: Categorization</p>
<hr />
<div>This (still empty) page describes the requirements to help rewriting parts of the installation procedure of Gambit in order to make it easier to install on various systems.<br />
<br />
= Objectives =<br />
* Have a standard process with portable defaults<br />
<br />
= Constraints =<br />
* Allow several versions of gambit to be installed concurrently on a single host<br />
* Avoid name clashes with other software (i.e. gsi/gsc is also default name of some ghostscript interpreters)<br />
* Do not mess up with host's hierachy<br />
<br />
= Examples =<br />
== Default ==<br />
./configure && make && make install<br />
installs in<br />
/usr/local/bin/gs{i,c}-$VERSION<br />
/usr/local/lib/gambit/$VERSION/syntax-case.scm<br />
/usr/local/share/doc/gambit/$VERSION<br />
and so on<br />
<br />
== Parametrized ==<br />
./configure --prefix=/tmp/test --bindir=/bin --gsi=gambi-VERSION --gsc=gambc && make && make install<br />
gives<br />
/bin/gambi-4.2.9<br />
/bin/gambc<br />
/tmp/test/lib/gambit/4.2.9/syntax-case.scm<br />
/tmp/test/share/doc/gambit/4.2.9/gambit-doc.html<br />
...<br />
<br />
= Add-ons =<br />
* Provide some subsidiary package with everything that is lacking from the original source code<br />
** List manipulation: filter, fold-left, etc <br />
** Generators: iota, etc<br />
** Sorts: list-sort, vector-sort, etc<br />
** Editors tools: gambit.el for emacs, and comparable plugins for vim, eclipse, etc<br />
<br />
* References: GHC's Prelude module provides a minimal yet reasonable set of features that we want...<br />
<br />
= Join the dream team =<br />
* fetch the 4.2.8 source code (our reference for this refactoring)<br />
* with mercurial, join the task force's branch at the address *branch to be created somewhere*<br />
* hack, hack, hack<br />
* test installation<br />
* test *again*<br />
* submit patch<br />
* ???<br />
* Profit!<br />
<br />
<br />
[[Category: Installing]][[Category: Internals]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Make_targets&diff=359Make targets2008-10-28T04:14:08Z<p>Jonathan Arkell: Categorization</p>
<hr />
<div>Here are the most useful "make" targets:<br />
<br />
{|<br />
<br />
|<br />
<pre><br />
make mostlyclean<br />
</pre><br />
|| ||<br />
Removes all the files that can be<br />
regenerated using standard tools<br />
(C compiler, TeX, etc). The C files<br />
generated by gsc, and the gsi and<br />
gsc executables are not removed.<br />
<br />
|-<br />
<br />
|<br />
<pre><br />
make clean<br />
</pre><br />
|| ||<br />
Removes all the files that can be<br />
regenerated by a "make" (object files,<br />
C files generated by gsc, etc) '''except'''<br />
gsi and gsc. This is useful to<br />
bootstrap from the Scheme sources<br />
after gsc has been built with an<br />
initial "make".<br />
<br />
|-<br />
<br />
|<br />
<pre><br />
make realclean<br />
</pre><br />
|| ||<br />
Like "make clean", but also removes<br />
gsi and gsc, and all the makefiles<br />
generated by the configure script.<br />
<br />
|-<br />
<br />
|<br />
<pre><br />
make check<br />
</pre><br />
|| ||<br />
Checks that gsi and gsc pass some<br />
basic tests by running a few Scheme<br />
programs with gsi and gsc.<br />
<br />
|-<br />
<br />
|<br />
<pre><br />
make examples<br />
</pre><br />
|| ||<br />
Runs the programs in the "examples"<br />
subdirectory.<br />
<br />
|-<br />
<br />
|<br />
<pre><br />
make dist<br />
</pre><br />
|| ||<br />
Creates a compressed tar file of<br />
the system.<br />
<br />
|-<br />
<br />
|<br />
<pre><br />
make doc<br />
</pre><br />
|| ||<br />
Builds the documentation.<br />
<br />
|}<br />
<br />
<br />
[[Category: Installing]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=R6RS&diff=358R6RS2008-10-28T04:13:08Z<p>Jonathan Arkell: Categorization</p>
<hr />
<div>Using Andre van Tonder's [http://www.het.brown.edu/people/andre/macros syntax-case & library system] on Gambit<br />
<br />
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.<br />
<br />
1. The Gambit libraries are where all the extensions to r5rs are put<br />
2. the standard and base libraries.<br />
3. The srfi's that are implemented by gambit.<br />
<br />
There are some general differences:<br />
* You can't use Gambit's extended lambda syntax. Instead use srfi-89<br />
<br />
Gambit libraries:<br />
(gambit threads)<br />
(gambit exceptions)<br />
(gambit extensions)<br />
(gambit files)<br />
(gambit io)<br />
(gambit io readtable)<br />
(gambit programs)<br />
(gambit time)<br />
(gambit will)<br />
(gambit debug)<br />
(gambit bytevectors)<br />
<br />
<br />
R6RS libraries implemented:<br />
(rnrs base)<br />
(rnrs lists)<br />
(rnrs sorting)<br />
(rnrs control)<br />
(rnrs records inspection)<br />
(rnrs conditions)<br />
(rnrs exceptions)<br />
(rnrs files)<br />
(rnrs programs)<br />
(rnrs arithmetic fixnums)<br />
(rnrs arithmetic bitwise)<br />
(rnrs syntax-case)<br />
(rnrs eval)<br />
(rnrs mutable-pairs)<br />
(rnrs mutable-strings)<br />
(rnrs r5rs)<br />
<br />
R6RS libraries (incomplete):<br />
(rnrs unicode)<br />
(rnrs records procedural)<br />
(rnrs bytevectors)<br />
(rnrs io ports)<br />
(rnrs io simple)<br />
(rnrs arithmetic flonums)<br />
(rnrs)<br />
<br />
R6RS libraries missing:<br />
(rnrs records syntactic (6))<br />
(rnrs hashtables (6))<br />
(rnrs enums (6))<br />
<br />
SRFI libraries:<br />
(srfi-2)<br />
(srfi-4)<br />
(srfi-6)<br />
(srfi-8)<br />
(srfi-9)<br />
(srfi-18)<br />
(srfi-21)<br />
(srfi-23)<br />
(srfi-27)<br />
(srfi-39)<br />
(srfi-88)<br />
(srfi-89)<br />
<br />
TODO:<br />
* Finish importing all gambit api into gambit libraries.<br />
* Implement all R6RS api<br />
* Remove warnings when loading the R6RS compiled library<br />
* Create a error handler that prints R6RS conditions in repl.<br />
* Integrate gambit and r6rs repl<br />
* Create R6RS mode for Gambit that loads this library<br />
* Implement a compile-library and compile-program functions.<br />
* Implement a packaging standard<br />
<br />
[[Category: Code]] [[Category: Languages]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Scheme&diff=357Scheme2008-10-28T04:11:05Z<p>Jonathan Arkell: </p>
<hr />
<div>==Scheme in a nutshell==<br />
<br />
* Scheme is a dialect of the [http://en.wikipedia.org/wiki/Lisp_(programming_language) Lisp] programming language developed in the 70s, that inherently supports ''[http://en.wikipedia.org/wiki/Functional_programming functional programming]'' but is easily ''[http://en.wikipedia.org/wiki/Multi-paradigm multi-paradigm]''.<br />
<br />
* Scheme is one of the two major Lisp dialects used for general-purpose programming, the other one being [http://en.wikipedia.org/wiki/Common_Lisp Common Lisp].<br />
<br />
* Scheme provides very few primitives defined in its core (known as the "RnRS standard" where "n" is an integer) as the rest is defined in extensions or libraries.<br />
<br />
* Scheme can be used for any kind of software development and can be learned in a single day thanks to its minimalist yet powerful design.<br />
<br />
* ''[http://en.wikipedia.org/wiki/Higher-order_programming High order]'' programming and ''[http://people.csail.mit.edu/gregs/info-dylan-archive-html-2002/msg00070.html macros]'' allow the developers using Scheme to write efficient and easily maintainable code, hence Scheme's label as the programming language of choice for many industries as well as academics.<br />
<br />
* Among programming languages, Scheme is quite unique about natively supporting [http://community.schemewiki.org/?call-with-current-continuation continuations], a very powerful language construct using which for instance exception handling, [http://en.wikipedia.org/wiki/Coroutine coroutines], and [http://common-lisp.net/project/cl-weblocks/ weblocks] behaviour can be implemented.<br />
<br />
<br />
Scheme is a solid way to state of the art software development.<br />
<br />
==Literature==<br />
* [http://mitpress.mit.edu/sicp/ Structure and Interpretation of Computer Programs] is a Computer Science book that uses Scheme. You find the book on its web site, and its videos on [http://www.youtube.com/results?search_query=SICP+&search_type=&aq=f YouTube] and on a [http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/ homepage].<br />
<br />
* [http://www.federated.com/~jim/schintro-v14/schintro_toc.html An Introduction to Scheme and its Implementation] ([ftp://ftp.cs.utexas.edu/pub/garbage/cs345/schintro-v14/schintro_toc.html alternative link]) is a practical hands-on guide to Scheme, for people new to software development, as well as for people with a background in general programming languges such as C, C++, Java, Pascal, PHP, etc.<br />
<br />
* [http://www.htdp.org/ How to Design Programs]<br />
<br />
* [http://www.scheme.com/tspl3/ The Scheme Programming Language]<br />
<br />
* The Revised5 Report on the Algorithmic Language Scheme [http://schemers.org/Documents/Standards/R5RS/ here] and more in particular [http://schemers.org/Documents/Standards/R5RS/HTML/ here].<br />
<br />
==Web sites==<br />
*[http://www.schemers.org www.schemers.org]<br />
<br />
*[http://community.schemewiki.org/ community.schemewiki.org]<br />
<br />
*[http://en.wikipedia.org/wiki/Scheme_(programming_language) Scheme (programming language) on Wikipedia]<br />
<br />
==Forums and Chat==<br />
*[http://groups.google.com/group/comp.lang.scheme comp.lang.scheme on Usenet]<br />
<br />
*The #gambit and #scheme channels on [http://www.mibbit.com Freenode IRC]<br />
<br />
==Other resources==<br />
*[http://www.iro.umontreal.ca/~boucherd/mslug/meetings/20041020/minutes-en.html The 90 minutes Scheme to C compiler]<br />
*[http://www.artima.com/weblogs/index.jsp?blogger=micheles The adventures of a Pythonista in Schemeland]<br />
<br />
<br />
[[Category: Language]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Termite&diff=356Termite2008-10-28T04:10:21Z<p>Jonathan Arkell: </p>
<hr />
<div>Termite is a thin layer on top of Gambit which provides Erlang-like features for concurrent and distributed computing.<br />
<br />
The homepage is at http://code.google.com/p/termite/.<br />
<br />
[[Category: Languages]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Using_Gambit_with_External_Libraries&diff=355Using Gambit with External Libraries2008-10-28T04:09:37Z<p>Jonathan Arkell: </p>
<hr />
<div>== Using gsc to compile and link a dynamically loadable object file that uses external libraries ==<br />
<br />
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.<br />
<br />
The program uses the FFTW version 2 API, so we downloaded fftw-2.1.5.tar.gz, untarred it and configured it with<br />
<pre><br />
./configure --enable-shared --prefix=/export/users/lucier/local/fftw-2.1.5<br />
</pre><br />
You need the <tt>--enable-shared</tt> option because shared Gambit modules must be linked to shared external libraries. I set the <tt>--prefix</tt> to install the final FFTW libraries and header files in my home directory.<br />
<br />
The file <tt>fftbasics.scm</tt> provides the basic interface between the Scheme code and FFTW; it is as follows:<br />
<pre><br />
(c-declare<br />
"<br />
#include \"fftw.h\"<br />
<br />
fftwnd_plan p;<br />
<br />
")<br />
<br />
(define fftw2d_create_plan_backward<br />
(c-lambda ()<br />
void<br />
"p = fftw2d_create_plan(64,<br />
64,<br />
FFTW_BACKWARD,<br />
FFTW_ESTIMATE | FFTW_IN_PLACE);<br />
"))<br />
<br />
(define fftw2d_create_plan_forward<br />
(c-lambda ()<br />
void<br />
"p = fftw2d_create_plan(64,<br />
64,<br />
FFTW_FORWARD,<br />
FFTW_ESTIMATE | FFTW_IN_PLACE);<br />
"))<br />
<br />
;;; Both forward and backward ffts, depends on which way the plan was created.<br />
<br />
(define fftwc<br />
(c-lambda (scheme-object)<br />
void<br />
"<br />
int j; double *fp = (double *)((___WORD)___BODY_AS(___arg1,___tSUBTYPED));<br />
fftwnd_one(p,<br />
(fftw_complex *)(fp),<br />
NULL);<br />
for (j = 0; j < 64 * 64 * 2; j++)<br />
fp[j] *= .015625;<br />
"))<br />
</pre><br />
We need to pass special options to gsc to compile this file, namely<br />
<pre><br />
gsc -cc-options "-I/export/users/lucier/local/fftw-2.1.5/include" -ld-options "-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw" fftbasic.scm<br />
</pre><br />
The first option (<tt>-I/export/users/lucier/local/fftw-2.1.5/include</tt>) tells gcc where to find the header file <tt>fftw.h</tt> at compile time. The second option (<tt>-L/export/users/lucier/local/fftw-2.1.5/lib/</tt>) tells the linker where to find the FFTW library (<tt>-lfftw</tt>) at link time (i.e., when building the file <tt>fftwbasic.o1</tt> from <tt>fftwbasic.o</tt>), and the third option (<tt>-Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/</tt>) tells the dynamic loader <tt>ldd</tt> where to find the FFTW library when <tt>fftwbasic.o1</tt> is loaded into gsc.<br />
<br />
<b>Aside</b>: 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 <tt>/usr/{bin,include,lib}</tt>, and you may not need to pass these special options to gsc.<br />
<br />
Then we can do<br />
<pre><br />
euler-316% gsc<br />
Gambit v4.2.8<br />
<br />
> (load "fftbasic")<br />
"/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1"<br />
> fftwc<br />
#<procedure #2 fftwc><br />
><br />
*** EOF again to exit<br />
</pre><br />
We can check that <tt>fftbasic.o1</tt> links to the right libraries:<br />
<pre><br />
euler-317% ldd fftbasic.o1<br />
libfftw.so.2 => /export/users/lucier/local/fftw-2.1.5/lib/libfftw.so.2 (0x0000002a9565a000)<br />
libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a957aa000)<br />
libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a959df000)<br />
/lib64/ld-linux-x86-64.so.2 (0x000000552aaaa000)<br />
</pre><br />
<br />
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 <tt>compile-file</tt>, <tt>compile-file-to-c</tt>, <tt>link-incremental</tt>, or <tt>link-flat</tt>. Thus, one could build <tt>fftbasic.o1</tt> by<br />
<pre><br />
euler-352% gsc<br />
Gambit v4.2.8<br />
<br />
> (compile-file "fftbasic.scm" cc-options: "-I/export/users/lucier/local/fftw-2.1.5/include"<br />
ld-options: "-L/export/users/lucier/local/fftw-2.1.5/lib/ -Wl,-rpath,/export/users/lucier/local/fftw-2.1.5/lib/ -lfftw")<br />
#t<br />
> (load "fftbasic")<br />
"/export/users/lucier/programs/gambc-v4_2_8/test-load-options/fftbasic.o1"<br />
> fftwc<br />
#<procedure #2 fftwc><br />
</pre><br />
<br />
<br />
== Practices in FFI development ==<br />
(There are a couple of posts from September 2008 in the mailing list archive on this subject. Someone please cut and paste them over here.)<br />
<br />
[[Category: FFI]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Dumping_Grounds&diff=354Dumping Grounds2008-10-28T04:00:27Z<p>Jonathan Arkell: Sorted the dumping grounds</p>
<hr />
<div>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.<br />
<br />
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.<br />
<br />
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 <nowiki>[[media:Sort-r1.tgz|Sort-r1.tgz]]</nowiki> 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.<br />
<br />
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]<br />
<br />
==Packages==<br />
===Math===<br />
# '''Pi''': Compute pi to arbitrary precision.<br />
#: Author: Marc Feeley<br />
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])<br />
# '''BLAS''': Thin wrapper for level 1, 2 and 3 BLAS linear algebra routines for the Gambit Scheme system.<br />
#: Author: Pierre-Alexandre Fournier<br />
#: Package: (web page) http://carretechnologies.com/scheme/blas/blas.html<br />
# '''FFTW3''': A wrapper for some FFTW3 functions for the Gambit Scheme system. (real, complex, multi-dimensional FFT functions)<br />
#: Author: Pierre-Alexandre Fournier<br />
#: Package: (web page) http://carretechnologies.com/scheme/fftw3/fftw3.html<br />
<br />
===Object Systems===<br />
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different<br />
#: Author: Ken Dickey<br />
#: Package: [[media:oops34.tgz|oops34.tgz]]<br />
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.<br />
#: Author: Ken Dickey<br />
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]<br />
<br />
===Graphics===<br />
# '''Octave''': A simple plotting interface using octave and gnuplot.<br />
#: Author: Pierre-Alexandre Fournier<br />
#: Package: (web page) http://carretechnologies.com/scheme/octave/octave.html<br />
# '''Schemeray''': A simple (and as of yet, unoptimized) raytracer<br />
#: Author: James Long<br />
#: Package: [[media:schemeray-0.2.tgz|schemeray-0.2.tgz]]<br />
# '''Opengl FFI''': A simple opengl, glu and glut ffi which supports opengl up to version 1.1.<br />
#: Author: David St-Hilaire<br />
#: Package: [[media:Opengl-ffi-r1.tgz|Opengl-ffi-r1.tgz]]<br />
# '''Perlin Noise''': A simple opengl demonstration of a sub-optimal 2d Perlin noise implementation.<br />
#: Author: David St-Hilaire<br />
#: Package: [[media:Perlin-noise-2d-r1.tgz|Perlin-noise-2d-r1.tgz]]<br />
<br />
===SQL===<br />
# '''MySQL FFI''': FFI for mysql. Unsure about thread-safety, and needs more work<br />
#: Author: Jonathan Arkell<br />
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/<br />
# '''SQLite3''': a minimalistic interface to SQLite3.<br />
#: Author: Marco Benelli<br />
#: Package: [[media:SQLite3-r1.tgz|SQLite3-r1.tgz]]<br />
# '''Postgresql''': A socket level client for Postgresql<br />
#: Author: Francesco Bracchi<br />
#: Package: [[media:Postgresql-r1.tgz|Postgresql-r1.tgz]]<br />
<br />
===Parsing===<br />
# '''SSAX-SXML''': SSAX-SXML library packaged for Gambit-C<br />
#: Author: Kirill Lisovsky (updated by Dominique Boucher)<br />
#: Package: (web page) [[media:ssax-sxml-gambit-20080402.tgz|ssax-sxml-gambit-20080402.tgz]]<br />
# '''Mparser''': A combinatorial parser (added expression parser) (parser language rewrite)<br />
#: Author: Francesco Bracchi<br />
#: Package: [[media:Mparser-r3.tgz|Mparser-r3.tgz]] (old: [[media:Mparser-r1.tgz|Mparser-r1.tgz]], [[media:Mparser-r2.tgz|Mparser-r2.tgz]])<br />
<br />
=== Language ===<br />
# '''Jss''': JavaScriptScheme: a multithreaded Scheme to JavaScript compiler<br />
#: Author: Marc Feeley and Catherine Gaudron<br />
#: Package: [[media:Jss-r1.tgz|Jss-r1.tgz]]<br />
# '''R6RS on Gambit''':Allows R6RS programs to be run on Gambit. <br />
#: Maintainer: Arthur Smyles<br />
#: Package: (web page) http://smyles.com/projects/r6gambit/<br />
<br />
===Utilities===<br />
# '''Sort''': Provides a simple sorting procedure for lists and vectors. The mergesort algorithm is used.<br />
#: Author: Marc Feeley<br />
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]<br />
# '''Bunny Test''': A simple unit testing framework. <br />
#: Author: Jonathan Arkell<br />
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/<br />
<br />
=== Full Applications ===<br />
# '''Space-Invaders''': Space Invaders classical arcade game remake in scheme over either glut or SDL.<br />
#: Author: David St-Hilaire<br />
#: Package: [[media:Space-invaders-src-v1.0.tgz|Space-invaders-src-v1.0.tgz]]<br />
# '''Web Server''': a web server with sessions cookies and server pages.<br />
#: Author: Francesco Bracchi<br />
#: Package: [[media:WebServer-r1.tgz|WebServer-r1.tgz]]<br />
# '''GUI-Toy''': Simple Direct Media Layer prototype code with examples in the raw and using TinyTalk and Oops object systems.<br />
#: Author: Ken Dickey<br />
#: Package: [[media:GUI-Toy.tgz|GUI-Toy.tgz]]<br />
# '''Intelligent WTF''': Intelligent acronym decoder based on ''wtf'' from BSD Games<br />
#: Author: Joel J. Adamson <br />
#: Package: (web page) http://www.unc.edu/~adamsonj/software.html<br />
<br />
[[Category: Code]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=SRFI:s&diff=353SRFI:s2008-10-28T03:50:04Z<p>Jonathan Arkell: </p>
<hr />
<div>Gambit has SRFIs [http://srfi.schemers.org/srfi-0/ 0], [http://srfi.schemers.org/srfi-4/ 4], [http://srfi.schemers.org/srfi-6/ 6], [http://srfi.schemers.org/srfi-8/ 8], [http://srfi.schemers.org/srfi-9/ 9], [http://srfi.schemers.org/srfi-18/ 18], [http://srfi.schemers.org/srfi-21/ 21], [http://srfi.schemers.org/srfi-22/ 22], [http://srfi.schemers.org/srfi-23/ 23], [http://srfi.schemers.org/srfi-27/ 27], and [http://srfi.schemers.org/srfi-39/ 39] built-in.<br />
<br />
Other [http://srfi.schemers.org/ SRFI:s] have been, or need to be ported.<br />
<br />
A number of SRFI's have been ported, (at least, the barebones implementation) and are available at this SVN repository: http://bunny.jonnay.net/zengarden/trunk/lib/srfi-pack/<br />
<br />
[[Category: Code]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Internal_Documentation&diff=352Internal Documentation2008-10-28T03:43:59Z<p>Jonathan Arkell: </p>
<hr />
<div>People who want to [[Contributing Patches to Gambit Source Code | contribute]] to Gambit development will need to learn something about how the Gambit-C<br />
runtime and compiler are organized. While we intend that source code documentation be included in the source<br />
itself (currently there is very little documentation), we intend that descriptions of program design<br />
or algorithms used in the runtime and compiler could be included here.<br />
<br />
== Namespace handling ==<br />
<br />
See [[Namespaces]].<br />
<br />
== Runtime Library ==<br />
<br />
=== Memory Management ===<br />
<br />
General notes on internal object storage and memory consumption is on the [[Debugging]] page. Also see [[Notes on Memory Management]].<br />
<br />
=== Thread System ===<br />
<br />
=== I/O System ===<br />
<br />
=== Arithmetic implementation ===<br />
<br />
=== Eval ===<br />
<br />
====Continuation manipulation====<br />
<br />
The manual lists <code>continuation-graft</code>, <code>continuation-capture</code>, and <code>continuation-return</code> but doesn't describe them. The REPL debugger, and possibly other things, use them. See Marc Feeley's paper ''A Better API for First-Class Continuations''.<br />
<br />
=== REPL ===<br />
<br />
The REPL has some fairly interesting functions and variables, especially for hackers.<br />
<br />
==== Variables ====<br />
;<code>##repl-location-relative</code><br />
:Should the REPL give relative or absolute pathnames. '''Note:''' When using emacs with gambit, it is useful to set it to #f, especially if you change the current-directory.<br />
<br />
==== Functions ====<br />
;<code>##cmd-</code>''x''<br />
:where ''x'' is a REPL command letter (typed after a comma from the REPL). Executes that command as if it was executed inside of the REPL. For instance <code>##cmd-b</code> displays a backtrace.<br />
<br />
===Record system===<br />
<br />
That is, <code>define-type</code>. Based on SRFI-9, but extensions not documented.<br />
<br />
== Compiler ==<br />
<br />
[[Category: Internals]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=How_to_contribute&diff=351How to contribute2008-10-28T03:40:35Z<p>Jonathan Arkell: </p>
<hr />
<div>__NOTOC__ __NOEDITSECTION__<br />
The development of Gambit was started in 1989 by [http://www.iro.umontreal.ca/~feeley/ Marc Feeley].<br />
In order to maintain tight control over the quality of the implementation, few other developers have been permitted<br />
to contribute directly to the system. Now that Gambit has matured and that the core system is<br />
unlikely to change much, we believe that it is important to open the development process to<br />
invite contributions by the Gambit user community.<br />
<br />
Contributions are sought in at least three areas:<br />
<br />
* '''Gambit's source code'''<br />
** Locate and fix bugs<br />
** [[Wish_list | Suggest new features ]]<br />
** Implement new features<br />
** [[ Installer | Port the system to new platforms ]]<br />
** Improve the performance of the system<br />
<br />
* '''Gambit's documentation'''<br />
** Improve the user manual<br />
** Improve the Gambit web site<br />
** Write tutorials<br />
<br />
* '''Gambit's packages'''<br />
** Create and maintain Gambit-specific packages<br />
** Port packages from other Scheme implementations<br />
<br />
==Contributing to Gambit's source code==<br />
<br />
If you discover a bug while working with Gambit we advise that you report the bug on the<br />
[http://www.iro.umontreal.ca/~gambit/bugzilla/ bug tracking system], which is powered by [http://www.bugzilla.org/ Bugzilla]. You should<br />
do this even if you know how to fix or work around the problem, so that others<br />
can search the bug database to be aware of its existence and to see the status of the bug.<br />
Suggestions for new features can also be submitted to the bug tracking system. The bugs are<br />
prioritized so that the most serious bugs are addressed first.<br />
<br />
The latest sources are available in the [[Source code repository | source code repository]]. It can be accessed using<br />
the [http://git.or.cz/ git] distributed version control system. The details are<br />
explained in the [[Contributing Patches to Gambit Source Code | source code repository instructions]]. With git you get<br />
a local copy of the source code repository which you can use to develop a ''patch'' that fixes a bug<br />
or implements a new feature. If you feel confident that the patch is correct and useful to others,<br />
you can then submit this patch to the Gambit maintainers. The patch will be reviewed to see how well<br />
it fits with the goals and philosophy of Gambit. If the patch is accepted then it will be applied to the<br />
source code repository and included in the official distribution of Gambit. If you are planning to<br />
make a substantial change to the source code it is best to discuss your plans on the<br />
[https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list Gambit mailing list]<br />
beforehand to improve the likelihood it will be accepted when it is submitted.<br />
<br />
==Contributing to Gambit's documentation==<br />
<br />
The Gambit manual's source is bundled with the source code. It is in the '''doc''' subdirectory of the<br />
Gambit source code distribution. Patches to the manual can be contributed like source code<br />
contributions as explained above.<br />
<br />
The Gambit web site is organized as a Wiki, powered by [http://www.mediawiki.org/ MediaWiki] (the same<br />
system used by Wikipedia). The core pages and the navigation sidebar can only be edited by the Gambit<br />
maintainers. Pages which have an '''edit''' link or tab can be edited by anyone using these<br />
[http://meta.wikimedia.org/wiki/MediaWiki_User%27s_Guide:_Editing_overview editing rules].<br />
<br />
Suggestions for improving the Gambit web site or for adding new pages that can be edited<br />
should be discussed on the [http://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list Gambit mailing list].<br />
<br />
==Contributing to Gambit's packages ==<br />
<br />
The procedure for contributing packages is still under development. Please stay tuned.<br />
<br />
[[Category: Internals]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Source_code_repository&diff=350Source code repository2008-10-28T03:39:09Z<p>Jonathan Arkell: </p>
<hr />
<div>The Gambit source code repository contains the history of changes to the sources. It can be accessed in the following ways.<br />
<br />
* The history of changes can be browsed using the [http://www.iro.umontreal.ca/~gambit/repo/.cgit.cgi/Gambit/log/ Gambit Scheme system repository web interface].<br />
* [http://git.or.cz/ Git] can be used to get a local copy of the latest sources. The procedure is explained [[Contributing Patches to Gambit Source Code | here]].<br />
<br />
[[Category:Development]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Contributing_Patches_to_Gambit_Source_Code&diff=349Contributing Patches to Gambit Source Code2008-10-28T03:36:18Z<p>Jonathan Arkell: </p>
<hr />
<div>__NOTOC__ __NOEDITSECTION__<br />
The Gambit [[Source code repository | source code repository]] is<br />
managed with the [http://git.or.cz/ git]<br />
distributed version control system.<br />
<br />
Each developer uses a local copy of the central repository. The<br />
copies can be edited independently using any tool (editors, utility<br />
programs, etc). When a developer completes making a set of related<br />
changes they are recorded as a ''commit''. The developer can submit<br />
these changes to the Gambit maintainers as a ''patch''. If the patch is accepted<br />
then it will be applied to the repository by the Gambit maintainers<br />
and will become part of the central repository.<br />
<br />
This page only gives the main procedures and git commands that are needed<br />
to manage the local copy of the central repository.<br />
Please read the [http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html git tutorial] for<br />
typical usage instructions.<br />
<br />
==== Installing git ====<br />
<br />
Git was created for the development of the Linux kernel, and<br />
is sometimes preinstalled on Linux distributions.<br />
Prebuilt distributions of git and a source code distribution are<br />
available [http://git.or.cz/#download here].<br />
Please follow the installation instructions on the<br />
[http://git.or.cz/ git web site].<br />
<br />
To simplify usage of git the git configuration file '''$HOME/.gitconfig'''<br />
should be created and contain at least your username. There are<br />
many settings that can be specified<br />
such as the editor to use for entering the comment attached<br />
to a commit. For example, to use emacs:<br />
<br />
<pre><br />
[user]<br />
name = Marc Feeley<br />
email = feeley@iro.umontreal.ca<br />
[core]<br />
editor = emacs -nw<br />
[color]<br />
ui = auto<br />
</pre><br />
<br />
==== Obtaining a local copy of the Gambit source code ====<br />
<br />
The best way to obtain a local copy of the Gambit source code is to<br />
download and unpack a recent source code release. You need<br />
the '''developer''' version, which has a '''-devel''' in the tarball name.<br />
Normally the most recent source code release should be downloaded<br />
and you need at least v4.3.0 (the first version to support git).<br />
After that you can use the '''make update''' command to<br />
update your local copy with all the changes committed to<br />
the central source code repository.<br />
<br />
<pre><br />
wget http://www.iro.umontreal.ca/~gambit/download/gambit/v4.3/source/gambc-v4_3_0-devel.tgz<br />
tar zxf gambc-v4_3_0-devel.tgz<br />
mv gambc-v4_3_0-devel gambit<br />
</pre><br />
<br />
Note that in anticipation of making changes to the source code the<br />
directory has been renamed to '''gambit''' to avoid thinking it is a<br />
pristine copy of a particular release.<br />
<br />
The system should then be prepared for modifications of the Scheme<br />
source code by creating a compiler for bootstrapping:<br />
<br />
<pre><br />
cd gambit<br />
./configure<br />
make bootstrap<br />
</pre><br />
<br />
This will create the '''gsc-comp''' compiler, which is executed when a<br />
Scheme source code file in the Gambit system must be compiled<br />
following a change.<br />
<br />
==== Synchronizing with the central source code repository ====<br />
<br />
The local source code files can then be updated to contain the latest commits<br />
on the central source code repository with the command:<br />
<br />
<pre><br />
make update<br />
</pre><br />
<br />
This will call the '''git fetch''' and '''git checkout''' commands in a loop, so that the Gambit compiler<br />
for each release between the local copy's release and the most recent release are<br />
built in succession. This is necessary because the Gambit system is bootstrapped<br />
with itself, and to compile the runtime system for a specific version the Gambit<br />
compiler for that version must be used. If for some reason you need to do this<br />
manually the following procedure should be used. Assuming the local copy is currently<br />
at release v1.2.3 and that v1.2.5 is the most recent release, do this:<br />
<br />
<pre><br />
git checkout v1.2.4-bootstrap<br />
make bootstrap<br />
git checkout v1.2.4<br />
make clean bootstrap<br />
git checkout v1.2.5-bootstrap<br />
make bootstrap<br />
git checkout v1.2.5<br />
make clean bootstrap<br />
git checkout master<br />
make bootstrap<br />
</pre><br />
<br />
Note that the latest source code may be unstable. It is wise to check<br />
that it passes basic consistency checks by running the command '''make check'''.<br />
<br />
The local source code files can be updated to a specific version<br />
with the '''git checkout''' command.<br />
<br />
<pre><br />
git checkout v4.2.1<br />
</pre><br />
<br />
After this command it is not possible to build Gambit with<br />
a '''make''' because the local '''gsc-comp''' is not the appropriate<br />
version to compile the runtime system. One way around this problem<br />
is to download the release for that version in a different directory, do a<br />
'''make bootstrap''' in that directory, and then copy '''gsc-comp'''<br />
back here.<br />
<br />
==== Creating a commit ====<br />
<br />
A source code change may simply be modifications of existing<br />
files, deletions, and addition of new files.<br />
If a new file has been created git should be informed by entering:<br />
<br />
<pre><br />
git add newfile<br />
</pre><br />
<br />
After making a set of related changes it is customary to review which files have changed<br />
by executing the command:<br />
<br />
<pre><br />
make status<br />
</pre><br />
<br />
If all checks out, a commit is created with the command:<br />
<br />
<pre><br />
make commit<br />
</pre><br />
<br />
This command will pop up an editor to compose a comment describing the nature of the patch.<br />
Please use a short but descriptive comment on the first line of text entered.<br />
<br />
To get a list of the commits (starting with the latest, i.e. the '''HEAD''') use:<br />
<br />
<pre><br />
make log<br />
</pre><br />
<br />
==== Contributing a patch ====<br />
<br />
A patch file can be created using the '''git diff''' command. To include only the<br />
most recent commit use:<br />
<br />
<pre><br />
git diff HEAD~1 > my-patch<br />
</pre><br />
<br />
A range of patches can be specified like this:<br />
<br />
<pre><br />
git diff HEAD~7..HEAD~3 > my-patch<br />
</pre><br />
<br />
The patch file can then be submitted to the Gambit maintainers<br />
by sending the file by email to '''gambit@iro.umontreal.ca'''. For example:<br />
<br />
<pre><br />
mail -s "[PATCH] ,b command fix" gambit@iro.umontreal.ca < my-patch<br />
</pre><br />
<br />
==== Releasing a new version of Gambit ====<br />
<br />
This section contains some notes for the Gambit maintainers. It explains the steps to follow to release a new version of Gambit. '''The steps must be followed carefully or you may end up with a wedged system!'''<br />
<br />
===== Manual procedure =====<br />
<br />
Assume the latest release of Gambit is v1.2.3 and the new release will be v4.5.6.<br />
Because Gambit is bootstrapped with itself, releasing a new version of Gambit is a two step process.<br />
The Gambit compiler must first be modified so that it generates C code which references the '''gambit.h''' file version v4.5.6.<br />
Then the '''gambit.h''' file, '''configure.ac''' file, and other files with an embedded version number must be updated so they refer to version v4.5.6.<br />
<br />
'''1. Creating a Gambit compiler for version v4.5.6'''<br />
<br />
Make sure you have a working bootstrap compiler ('''gsc-comp''') and save a copy just in case:<br />
<br />
<pre><br />
make check<br />
make bootstrap<br />
cp gsc-comp gsc-comp.old<br />
</pre><br />
<br />
Now modify the definition of '''compiler-version''' in the file '''gsc/_parms.scm''' so that it refers to v4.5.6 (using a single integer encoding of the version number):<br />
<br />
<pre><br />
(define (compiler-version) 405006) ;; 100000*major + 1000*minor + revision<br />
</pre><br />
<br />
Now create the new bootstrap compiler and commit the change with an easily identifiable comment:<br />
<br />
<pre><br />
make bootstrap<br />
git commit -a -m "[COMPILER CHANGES NEEDED FOR v4.5.6] Changed version in compiler"<br />
git tag v4.5.6-bootstrap<br />
</pre><br />
<br />
Note that at this very point the new compiler will not pass the tests because the runtime still expects the old version number.<br />
<br />
'''2. Upgrading the runtime files from version v1.2.3 to v4.5.6'''<br />
<br />
For the C files generated from Scheme files the version numbers can easily be upgraded by compiling them from scratch using the new Gambit compiler.<br />
This will be done automatically by a '''make''' after a '''make clean'''. The other changes to the files are made by running the script '''misc/changev''' (this must be done first because it changes the file '''configure.ac''' which produces the '''configure''' script which must be run again).<br />
<br />
<pre><br />
misc/changev 102003 405006<br />
make clean<br />
./configure<br />
make<br />
make check # will fail test5 because version numbers have changed<br />
mv tests/mix.c tests/test5.ok<br />
make check # this time all tests should pass<br />
git commit -a -m "[RUNTIME CHANGES NEEDED FOR v4.5.6] Changed version of runtime using misc/changev"<br />
git tag v4.5.6<br />
</pre><br />
<br />
'''3. Creating prebuilt installers for version v4.5.6'''<br />
<br />
To create prebuilt installers for Mac OS and Windows you need a Mac with Xcode and Parallels workstation with Windows and the MinGW and Microsoft Visual C Express environments. The following command will build all variants of the installers (it takes about 2 hours in total):<br />
<br />
<pre><br />
make release<br />
</pre><br />
<br />
If no errors were reported then you can upload the new release to the Gambit repository using:<br />
<br />
<pre><br />
make publish-release<br />
</pre><br />
<br />
This will automatically send an announcement on the Gambit mailing list. You must manually update the main page of the Gambit Wiki so that it refers to the latest version.<br />
<br />
===== Automated procedure =====<br />
<br />
Step 1 and 2 in the above instructions are executed with the '''change-version''' make target:<br />
<br />
<pre><br />
make NEW_VERSION=v4.5.6 change-version<br />
</pre><br />
<br />
Alternatively, the '''new-revision''', '''new-minor''', or '''new-major''' make targets can be used<br />
to compute the new version number from the current version by incrementing one<br />
of the version number fields:<br />
<br />
<pre><br />
make new-revision<br />
</pre><br />
<br />
<br />
[[Category: Development]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Creating_tags_from_Gambit_library_C_files&diff=348Creating tags from Gambit library C files2008-10-25T20:57:05Z<p>Jonathan Arkell: </p>
<hr />
<div>==Overview==<br />
<br />
Work in progress. See also [[User:dpeschel]].<br />
<br />
The hand-written C files in the Gambit <code>lib/</code> directory contain many small functions, so it would be useful to have a list. The GNU <code>etags</code> program can create lists in a format that Emacs can use and in a different format that vi and Vim can use. These lists support interactive browsing within Emacs, vi, and Vim. With your cursor on a symbol, you jump to its definition. Unfortunately the lsits are not very useful to read by themselves (to get a quick overview of functions and the order they are defined in, or to get sublists of symbols sorted by type).<br />
<br />
Another program, Exuberant Ctags, has some features <code>etags</code> doesn't, but I haven't gotten Exuberant working yet.<br />
<br />
I don't think the original UNIX <code>ctags</code> is flexible enough to parse the Gambit library. I haven't tried yet.<br />
<br />
There is no point in parsing C files that were compiled from Scheme, if I can parse the original Scheme.<br />
<br />
The extensive use of preprocessor macros in the library code means <code>etags</code>'s default parser can do very little with the files. Luckily you can extend the lines recognized by <code>etags</code> through its <code>--regex</code> option. The regular expressions used must:<br />
* Match the entire text of a line or group of lines (this is not documented in the <code>etags</code> manual page).<br />
* Contain a subexpression that matches the name of the function being defined.<br />
* Handle enough C syntax to match all and only the correct uses of the macros.<br />
** <code>etags</code> doesn't tag forward declarations, so these expressions are designed not to match forward declarations.<br />
** You can't give <code>etags</code> an expression and say "treat matches as new return types" or "treat new matches as function signatures". Your expression must match everything needed to find any function definition -- return type, linkage, function name, signature, and opening brace. However, <code>etags</code> does not need to know where those parts are within the matched text, except the function name as described above.<br />
<br />
Because the regular expressions may match more than one line, a recent version of <code>etags</code> is required. Earlier versions don't allow multiline matches. The version distributed with Emacs 22.1 works, the version distributed with Emacs 21.4a doesn't work.<br />
<br />
==Library files==<br />
<br />
lib/c_intf.c<br />
lib/main.c<br />
lib/mem.c<br />
lib/os.c<br />
lib/os_base.c <br />
lib/os_dyn.c<br />
lib/os_files.c<br />
lib/os_io.c<br />
lib/os_shell.c<br />
lib/os_time.c<br />
lib/os_tty.c<br />
lib/setup.c<br />
<br />
==Parsing <code>___PVOID</code>==<br />
<br />
This expression handles the ___PVOID macro:<br />
<br />
{c}/.*\([ \t]\|\n\)+\([A-Za-z_][A-Za-z_0-9]*\)\([ \t]\|\n\)+___PVOID\([ \t]\|\n\)*{/\2/m<br />
<br />
Unfortunately, following a tag will land on the line with the brace.<br />
<br />
This expression doesn't match the opening brace. It will tag forward declarations by mistake, but following a tag will land on the line with the tag.<br />
<br />
{c}/.*\([ \t]\|\n\)+\([A-Za-z_][A-Za-z_0-9]*\)\([ \t]\|\n\)+___PVOID/\2/m<br />
<br />
==Parsing <code>___P</code>==<br />
<br />
The ___P macro takes two arguments, each of which usually contains parentheses. No regular expression can match text containing parentheses nested to an unknown depth. Howver, if you have a known depth, you can create a regular expression that matches text containing parentheses nested to that depth or less. As the known depth gets bigger, the expressions get longer, so it's wise to use the lowest depth that will work.<br />
<br />
===Finding the maximum depth of parentheses used===<br />
<br />
The maximum depth after any ___P invocation in any of the library files is four. See [[Lalr example|this page]] for the script used to find that.<br />
<br />
===Generating a regexp===<br />
<br />
===Using the regexp===<br />
<br />
<br />
[[Category: development]]<br />
[[Category: internals]]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Debugging&diff=332Debugging2008-10-08T02:49:16Z<p>Jonathan Arkell: Added the Full Debugging Cavalry instructions from the mailing list</p>
<hr />
<div>(This document is a stub.)<br />
<br />
== Interactive debugging ==<br />
<br />
Gambit features an internal source debugger, see the User Documentation. <br />
<br />
There are currently multiple interactive debuggers in development, please see the mailing list archives.<br />
<br />
== Tracking down mistyped identifiers (i.e. variable and procedure names) ==<br />
Typically you solve this through compiling your code, i.e. (compile-file X), and then load the compiled object file, i.e. (load "file") or (load "file.o1"). The typical warning message is<br />
<br />
*** WARNING -- Variable "namespace-name#identifier-name" used in module "filename.o1" is undefined<br />
<br />
In order to track down the line number of the undefined identifier, compile with the with-gvm option. The addressed row numbers are found on the rows starting with "line " above the rows with occurrences of namespace-name#identifier-name in them, in the gvm file.<br />
<br />
== Tracking down segmentation faults ==<br />
<br />
=== Typical problem sources ===<br />
Invoking anything that is not a procedure in code compiled with (declare (not safe)) does produce sigsegv:s. Thus, any of (#!void) , (#!unbound) , ("Hello") , (123) produce sigsegv:s, if evaluated in code compiled with (declare (not safe)).<br />
<br />
Addressing nonexistant variables in code compiled with (declare (not safe)) may cause this as well, i.e. (string-ref nonexistant-variable 0) or (set! nonexistant-variable 'a-value).<br />
<br />
Also, pay attention that all Gambit-internal functions without typechecks are always invoked with correct parameters. These are prefixed with ##. I.e., the car function with typechecks is (car), and the one without typechecks is (##car). Thus, (car #!void) will not be fatal in code compiled with (declare (safe)), though, (##car #!void) may be fatal in code compiled with (declare (safe)). And, as we already concluded, both these expressions are fatal to execute in code compiled with (declare (not safe)).<br />
<br />
=== Compiling Gambit for debugging purposes ===<br />
Download the latest Gambit sourcecode.<br />
<br />
Unpack it, usually you do that through executing tar xvfz gambc-v4_X_X.tgz in your shell.<br />
<br />
*Run the configure script. It is normally compiled with --enable-single-host flipped on. If you want Gambit to dump internal messages to the file "console" in the current directory, also pass the --enable-debug parameter. To see all options, run ./configure --help.<br />
<br />
*Edit the file makefile using your favourite editor. There are at least two rows that contain the sequence -O1 (i.e. dash O one), in the current version that's the two rows starting with FLAGS_OBJ and FLAGS_DYN. Replace -O1 with -g -O0 . The -g option will make your C compiler include debugging symbols on compilation, and the -O0 will force it not to do any optimizations on the assembly/binary code it generates, thus the mapping of rows of C/C++ code into memory addresses during program execution will be the most precise your C/C++ compiler is capable of generating.<br />
<br />
*Compile Gambit through typing make<br />
<br />
*If you want this Gambit to replace your current installation, run make install<br />
<br />
=== Running compile-file with debugging options flipped on ===<br />
<br />
When running (compile-file ), remember to pass the cc-opts: "-g -O0" .<br />
<br />
Also, there are the options:<br />
<br />
*track-scheme to make the C/C++ compiler use the source Scheme code instead of the source C/C++ code for debugging info. This is an option that you may want to vary during debugging work.<br />
<br />
*keep-c to make compile-file not remove the intermediary C/C++ code file.<br />
<br />
=== Run Gambit in GDB ===<br />
GDB is found on [http://sourceware.org/gdb/ http://sourceware.org/gdb/], and is typically included as an optional package with Linux and BSD distributions.<br />
<br />
From your shell, run<br />
<br />
gdb gsc<br />
<br />
GDB will start. If you want to pass gsc argument, type<br />
<br />
set args=[the arguments]<br />
<br />
for example<br />
<br />
set args=-e "(display \"test\n\")" -<br />
<br />
To start Gambit witihn GDB, type run.<br />
<br />
If your Gambit application crashes, you will get a prompt in GDB indicating so. To get a backtrace of the stack of your program, type bt . The backtrace should also be interesting for anyone who would assist you in finding the reason to the crash.<br />
<br />
To quit, type quit.<br />
<br />
=== Calling the Debugging Cavalry ===<br />
<br />
If you need to, you can cause the runtime system to write a very detailed trace of execution to the file "console" when a project linked with the runtime is run (including gsi/gsc)<br />
<br />
Just do this:<br />
<br />
% cp gsc/gsc non-debugged-gsc<br />
% ./configure CC="gcc -D___DEBUG_HOST_CHANGES" --enable-debug<br />
% make mostlyclean<br />
% make<br />
% cp non-debugged-gsc gsc/gsc # to avoid having a Gambit compiler with tracing<br />
<br />
<br />
=== Other things you may want to do ===<br />
There are ample of debug utilities, for different operating systems, that may be interesting for you to use.<br />
<br />
For instance, strace is an utility that displays all Kernel invocations your application does. Remember to run it with the -Ff options.<br />
<br />
valgrind is an utility that traces memory leaks. (Gambit will not leak memory in itself, but a faulty Foreign Function Interface library could do that.)<br />
<br />
== Memory use ==<br />
<br />
=== Object memory consumption ===<br />
==== In general ====<br />
The internal representation of objects depends on the word size of the processor. Object references are encoded in a single word, either 32 or 64 bits wide, whose lower 2 bits is a type tag giving some partial type information on the object. The upper bits are either a literal value (in the case of fixnums, characters, booleans, and so on) or an encoding of a pointer (in the case of memory allocated objects such as flonums, bignums, pairs, vectors, and other structured objects).<br />
<br />
Memory is allocated in multiples of the word size (4 bytes on a 32 bit processor and 8 bytes on a 64 bit processor) and aligned on the word size. The alignment constraint implies that (at least) the two lower bits of the address are always zero and can thus be overwritten with the type tag to form an object reference. The first word is a header whose lower 8 bits contain the type of the object, and some bits used by the garbage collector. The upper bits encode the length of the object in bytes. Consequently there is a limit on the size of objects and vectors (homogeneous or not) in particular. On a 64 bit processor this is not a problem because lengths up to 64 petabytes are possible (that's a pretty big object!). On a 32 bit processor the length is limited to 16 megabytes, which implies that vectors of more than about 4 million elements cannot be represented.<br />
<br />
==== Integer values ====<br />
Exact integer values are stored internally as fixnums or bignums, depending on their value, and depending on the word size of the processor (currently 32- or 64-bit).<br />
<br />
On 32-bit processors, exact integers in the interval -536870912 .. 536870911 (i.e. -2^(31-2) .. 2^(31-2)-1) are stored as fixnums internally, and exact integers outside of this interval are stored as bignums. For 64 bit processors, the same interval is -2305843009213693952 .. 2305843009213693951 (i.e. -2^(63-2) .. 2^(63-2)-1). <br />
<br />
Bignums are memory allocated objects. They are essentially vectors of unsigned 64 bit integers which store the bits of the 2's complement representation of the integer, in little-endian format. The most significant bit is the sign (1 = negative, 0 = non-negative).<br />
<br />
(Fixnums have a type tag of zero. The upper bits contain the integer value in 2's complement representation. For example the fixnum 15 is encoded with a word whose value is 60 (i.e. 15 * 4).)<br />
<br />
==== String values ====<br />
By default, characters in a string occupy four bytes of memory each (i.e. 32 bits). Consequently all the Unicode characters are storable in strings by default. With this representation, the maximum string size on a 32 bit processor is just over 4 million characters.<br />
<br />
Strings are memory allocated objects stored in memory as uniform vectors of 8, 16 or 32 bit unsigned integers depending on the --enable-char-size=N configure option specified when compiling Gambit from source. That is, --enable-char-size=1 for 8 bit characters, --enable-char-size=2 for 16 bit characters, and --enable-char-size=4 for 32 bit characters.<br />
<br />
In order to save memory, the character size can be decreased. Generally, a size of two bytes is ok for all purposes, except providing a complete set of asian symbols. The Gambit source code, runtime system and libraries use only ASCII characters to allow the system to work properly, including bootstrapping the system, when --enable-char-size=1 is used.<br />
<br />
The reason Gambit works with a fixed character size internally is for performance. If the size had been variable, such as in UTF-8 encoding, determining at what byte position in a string a certain character index is would be a much heavier computational operation. One way to store strings in UTF-8 while still being able to use any Unicode character, would be to maintain the default four-byte character size, store addressed strings UTF-8 encoded in u8vectors, and convert them to strings when you need access to their contents. The conversion to a string can be done like this:<br />
<br />
(read-line (open-input-u8vector (list init: '#u8(40 206 187 32 120 32 120 41) char-encoding: 'UTF-8)) #f) => "(\u03bb x x)"<br />
<br />
=== Reasons to Heap overflow exceptions ===<br />
Heap overflow exceptions are raised if:<br />
<br />
*If a maximum heap size parameter has been specified to Gambit (see the User Documentation), an exception is raised when code is executed that would require a heap bigger than that.<br />
<br />
*If Gambit fails to allocate more memory from the operating system. Generally that happens only when the operating system considers RAM and swap space to be full.<br />
<br />
*If on a 32-bit processor, when attempting to allocate an object bigger than 16MB.<br />
<br />
=== Tracking down excessive memory use ===<br />
<br />
==== Superflouous symbols ====<br />
Symbols are not garbage collected. Thus, if you do (string->symbol X) on gigabytes of string data, then gigabytes of heap space will be permanently allocated for this. If you want to use ample of symbols in your application, use uninterned symbols, generated using make-uninterned-symbol .<br />
<br />
==== Memory leaks in FFI:s ====<br />
While Gambit garbage collects Scheme objects on its own, objects created by FFI:s may not be garbage collected automatically, and, there may be bugs in FFI:s. If you use an FFI, look at how it should be used carefully, and if you suspect there's a memory leak in it, analyze its sourcecode, and use debug utilities such as valgrind.<br />
<br />
==== Garbage collection threshold ====<br />
Pay attention to the runtime options h (maximum heapsize in kilobytes) and l (livepercent). See the reference manual for more information. Setting livepercent to five means that garbage collection will take place at the time that there are nineteen times more memory allocated for objects that should be garbage collected, than there is memory allocated for objects that should not. The reason the livepercent option is there, is to give a way to control how sparing/generous the garbage collector should be about memory consumption, vs. how heavy/light it should be in CPU load.<br />
<br />
You can always force garbage collection by (##gc).</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=GambitNds&diff=331GambitNds2008-10-08T02:26:55Z<p>Jonathan Arkell: New page: This will be a page describing the efforts to build a version of Gambit optimized for NDS development. Right now it will just point to the Distributions page, and contain a few notes....</p>
<hr />
<div>This will be a page describing the efforts to build a version of Gambit optimized for NDS development.<br />
<br />
Right now it will just point to the [[Distributions]] page, and contain a few notes.<br />
<br />
<br />
<br />
== Decreasing the size of the Gambit executable ==<br />
One of the Biggest challenges is the RAM limitation on the DS (4 megs). Gambit, even when properly compressed will take 3 of those. <br />
<br />
Recently Marc sent a message about how to radically decrease the size of the executable:<br />
<br />
Actually there is another one, which consists in eliminating the whole <br />
Gambit library, except for the "essentials" (lib/_kernel.scm and some <br />
of the C files in lib/ which implement the GC, C-interface,<br />
initialization code, etc).<br />
<br />
Using this technique (see trace below) I managed to build a 300 kB <br />
executable on MacOS X from the v4.2.9 tarball. This could be reduced <br />
some more by removing some functionality. Anyway, this is just a <br />
quick-and-dirty experiment.<br />
<br />
The downside of course is that you have to implement yourself whatever <br />
you need in your application. You only have very basic functionality <br />
(the inlinable primitives like ##fx+, ##cons, ##car). This is like <br />
reinventing the wheel... but I'm sure some users will appreciate the <br />
hack value!<br />
<br />
Marc<br />
<br />
% tar zxf gambc-v4_2_9.tgz<br />
% cd gambc-v4_2_9<br />
% ./configure --enable-single-host<br />
% make bootstrap<br />
% ################ Now edit lib/makefile.in .<br />
% diff lib/makefile.in lib/makefile.in-orig<br />
< MODULES = _kernel<br />
< MODULES_SCM = _kernel.scm<br />
< MODULES_C = _kernel.c<br />
< MODULES_O = _kernel@obj@<br />
< MODULES_O_PLUS = +_kernel@obj@<br />
< MODULES_O_COMMA = _kernel@obj@<br />
---<br />
MODULES = _kernel _system _num _std \<br />
_eval _io _nonstd _thread _repl<br />
MODULES_SCM = _kernel.scm _system.scm _num.scm _std.scm \<br />
_eval.scm _io.scm _nonstd.scm _thread.scm _repl.scm<br />
MODULES_C = _kernel.c _system.c _num.c _std.c \<br />
_eval.c _io.c _nonstd.c _thread.c _repl.c<br />
MODULES_O = _kernel@obj@ _system@obj@ _num@obj@ _std@obj@ \<br />
_eval@obj@ _io@obj@ _nonstd@obj@ _thread@obj@ _repl@obj@<br />
MODULES_O_PLUS = +_kernel@obj@ +_system@obj@ +_num@obj@ +_std@obj@ \<br />
+_eval@obj@ +_io@obj@ +_nonstd@obj@ +_thread@obj@ +_repl@obj@<br />
MODULES_O_COMMA = _kernel@obj@,_system@obj@,_num@obj@,_std@obj@,\<br />
+_eval@obj@,_io@obj@,_nonstd@obj@,_thread@obj@,_repl@obj@<br />
81c87,88<br />
< MODULES_O_IN_COMPILE_ORDER = _kernel@obj@<br />
---<br />
MODULES_O_IN_COMPILE_ORDER = _io@obj@ _num@obj@ _std@obj@ \<br />
_kernel@obj@ _nonstd@obj@ _repl@obj@ _eval@obj@ _thread@obj@ <br />
_system@obj@<br />
% make clean<br />
% make<br />
making all in include<br />
...<br />
making all in lib<br />
...<br />
../gsc-comp -:=.. -f -link -flat -o _gambc.c _kernel.c<br />
*** WARNING -- "##*" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
*** WARNING -- "##+" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
*** WARNING -- "##map" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
*** WARNING -- "##string->symbol" is not defined,<br />
*** referenced in: ("_kernel.c")<br />
% ################ Note that lib/_kernel.scm depends on some Gambit<br />
% ################ library procedures that are not defined in<br />
% ################ lib/_kernel.scm. This will be fixed so that<br />
% ################ lib/_kernel.scm is self contained, as it should.<br />
% ################ Now create hw.scm .<br />
% cat hw.scm<br />
;; Make sure the compiler does not assume the standard library is<br />
;; linked in.<br />
(declare<br />
(block)<br />
(not inline)<br />
(not inline-primitives)<br />
(inlining-limit 0)<br />
(not run-time-bindings)<br />
)<br />
<br />
;; Supply the procedures lib/_kernel.scm needs (this dependency should<br />
;; be removed since it is gratuitous).<br />
(define (##map f lst) '()) ;; I'm lazy<br />
(define (##string->symbol str) 'foo)<br />
(define (##+ x y) 0)<br />
(define (##* x y) 0)<br />
<br />
;; The "hello world" program:<br />
<br />
(c-declare "#include <stdio.h>")<br />
<br />
(define puts (c-lambda (char-string) int "puts"))<br />
<br />
(puts "hello world")<br />
% ./gsc-comp -:=. -c hw.scm<br />
% ./gsc-comp -:=. -link hw.c<br />
% gcc -Iinclude -D___SINGLE_HOST hw_.c hw.c lib/libgambc.a -o hw<br />
% strip hw<br />
% ls -l hw<br />
-rwxr-xr-x 1 feeley feeley 300384 Oct 4 09:22 hw<br />
% ./hw<br />
hello world</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=SRFI:s&diff=330SRFI:s2008-10-06T20:21:09Z<p>Jonathan Arkell: </p>
<hr />
<div>Gambit has SRFIs [http://srfi.schemers.org/srfi-0/ 0], [http://srfi.schemers.org/srfi-4/ 4], [http://srfi.schemers.org/srfi-6/ 6], [http://srfi.schemers.org/srfi-8/ 8], [http://srfi.schemers.org/srfi-9/ 9], [http://srfi.schemers.org/srfi-18/ 18], [http://srfi.schemers.org/srfi-21/ 21], [http://srfi.schemers.org/srfi-22/ 22], [http://srfi.schemers.org/srfi-23/ 23], [http://srfi.schemers.org/srfi-27/ 27], and [http://srfi.schemers.org/srfi-39/ 39] built-in.<br />
<br />
Other [http://srfi.schemers.org/ SRFI:s] have been, or need to be ported.<br />
<br />
A number of SRFI's have been ported, (at least, the barebones implementation) and are available at this SVN repository: http://bunny.jonnay.net/zengarden/trunk/lib/srfi-pack/</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=SRFI:s&diff=329SRFI:s2008-10-06T20:00:25Z<p>Jonathan Arkell: </p>
<hr />
<div>Gambit has SRFIs [http://srfi.schemers.org/srfi-0/ 0], [http://srfi.schemers.org/srfi-4/ 4], [http://srfi.schemers.org/srfi-6/ 6], [http://srfi.schemers.org/srfi-8/ 8], [http://srfi.schemers.org/srfi-9/ 9], [http://srfi.schemers.org/srfi-18/ 18], [http://srfi.schemers.org/srfi-21/ 21], [http://srfi.schemers.org/srfi-22/ 22], [http://srfi.schemers.org/srfi-23/ 23], [http://srfi.schemers.org/srfi-27/ 27], and [http://srfi.schemers.org/srfi-39/ 39] built-in.<br />
<br />
Other [http://srfi.schemers.org/ SRFI:s] have been, or need to be ported.<br />
<br />
(Ideally a repository of ported SRFIs go here)</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Distributions&diff=210Distributions2008-05-20T04:17:12Z<p>Jonathan Arkell: Added Nintendo DS port</p>
<hr />
<div>=== Version 4 ===<br />
<br />
* [http://www.iro.umontreal.ca/~gambit/download/gambit/v4.2 Version 4.2]<br />
* [http://www.iro.umontreal.ca/~gambit/download/gambit/v4.1 Version 4.1]<br />
* [http://www.iro.umontreal.ca/~gambit/download/gambit/v4.0 Version 4.0]<br />
** [http://bunny.jonnay.net/gambitnds/trunk/ SVN repository for Gambit 4.0b20 on Nintendo DS ]<br />
=== Version 3 ===<br />
<br />
* [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0 Version 3.0]<br />
** Latest stable source distribution: [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0/source/gambc30.tar.gz gambc30.tar.gz]<br />
** Latest stable prebuilt distributions:<br />
*** README file: [http://www.iro.umontreal.ca/~gambit/download/gambit/3.0/prebuilt/readme readme]<br />
*** Windows 95/NT/XP:<br />
**** For '''Microsoft Visual C++ 4.0 compiler''': [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0/prebuilt/gc30-msc.zip gc30-msc.zip]<br />
**** For '''Borland C++ 5.0 compiler''': [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0/prebuilt/gc30-bor.zip gc30-bor.zip]<br />
**** For '''Watcom C/C++ 11.0 compiler''': [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0/prebuilt/gc30-wat.zip gc30-wat.zip]<br />
**** Note: any prebuilt distribution will do if you only use the Gambit Scheme interpreter, but the one for Watcom C/C++ is fastest.<br />
*** MSDOS:<br />
**** For '''DJGPP system v2.0''': [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0/prebuilt/gc30-dj.zip gc30-dj.zip]<br />
*** Mac OS Classic:<br />
**** For '''for the Macintosh CodeWarrior 11, Pro 1/2/3''': [http://www.iro.umontreal.ca/~gambit/download/gambit/v3.0/prebuilt/gc30-cw.zip gc30-cw.zip]</div>Jonathan Arkellhttps://gambitscheme.org/wiki/index.php?title=Dumping_Grounds&diff=142Dumping Grounds2008-03-19T06:07:31Z<p>Jonathan Arkell: </p>
<hr />
<div>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.<br />
<br />
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.<br />
<br />
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 <nowiki>[[media:Sort-r1.tgz|Sort-r1.tgz]]</nowiki> 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.<br />
<br />
A list of the packages and other files with statistics is available here: [[Special:Imagelist]]<br />
<br />
==Packages==<br />
<br />
# '''Sort''': Provides a simple sorting procedure for lists and vectors. The mergesort algorithm is used.<br />
#: Author: Marc Feeley<br />
#: Package: [[media:Sort-r1.tgz|Sort-r1.tgz]]<br />
# '''Pi''': Compute pi to arbitrary precision.<br />
#: Author: Marc Feeley<br />
#: Package: [[media:Pi-r3.tgz|Pi-r3.tgz]] (old: [[media:Pi-r2.tgz|Pi-r2.tgz]]) (old: [[media:Pi-r1.tgz|Pi-r1.tgz]])<br />
# '''Oops''': Object Oriented Programming for Scheme -- Dylan/Clos-like but different<br />
#: Author: Ken Dickey<br />
#: Package: [[media:oops33.tgz|oops33.tgz]]<br />
# '''TinyTalk''': Self-like object system with selector [Smalltalk like] dispatch.<br />
#: Author: Ken Dickey<br />
#: Package: [[media:gambitTT.tgz|gambitTT.tgz]]<br />
# '''MySQL FFI''': FFI for mysql. Unsure about thread-safety, and needs more work<br />
#: Author: Jonathan Arkell<br />
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/mysql/<br />
# '''Bunny Test''': A simple unit testing framework. <br />
#: Author: Jonathan Arkell<br />
#: Package: (svn repository) http://bunny.jonnay.net/zengarden/trunk/lib/test/</div>Jonathan Arkell