9 ms·
What's the difference between Chicken and Gambit[1]? I've been reading about/playing with the latter for a few weeks, because of its interop with C (and therefo
by tehwalrus 14y ago
What's the difference between Chicken and Gambit[1]? I've been reading about/playing with the latter for a few weeks, because of its interop with C (and therefore potential for integration with other C-friendly code, which is why there is an iPhone app that runs the repl.) My interest is that I'd like to write an application core in Scheme, and then write a GUI for iPhone, OS X, Linux and Windows, and I figured Gambit was best for this.
If I should be playing with Chicken instead, tell me why! :)
[1] http://gambitscheme.org/wiki/index.php/Main_Page http://gambitscheme.org/wiki/index.php/Main_Page
- csl 14y agoOne thing is the relatively large number of packages available for Chicken, especially for C libraries on UNIX. Therefore many use Chicken for systems and desktop programming on UNIX. A list of packages (called "eggs") is available at http://wiki.call-cc.org/chicken-projects/egg-index-4.html http://wiki.call-cc.org/chicken-projects/egg-index-4.html (Disclaimer: I don't know much about Gambit, and cannot comment on their respective implementation capabilities.)
- MatthewPhillips 14y agoGambit is extremely fast, that's its main benefit over the competition. It's ecosystem is... very rough, though.
- mark_l_watson 14y agoTrue enough. I have used Gambit for several apps in the last 10 years or so, but always for things that don't need a lot of 3rd party libraries. I wrote an article a long time ago on using Gambit for command line utilities and other small apps.
- bitwize 14y agoGambit also has (imho) a much easier FFI. (Once you get used to all the ___arg1 and ___result stuff.) So it really is easy to bolt on C -- and even C++ and Objective-C -- code to a Gambit app.
- sea6ear 14y agoMy sense from looking at this same question before (although not doing anything, so this is just impression not experience) is that Gambit is being used more for embedded uses like what you are describing. I've been interested in Gambit because it seems to allow fairly direct intermixing of Scheme and C code. I don't recall seeing Chicken being able to mix the two in the same file. Chicken seems to have more libraries available and might be better for use doing things like Unix scripting or system tasks. By the way, if you are interested in Gambit, and are on Debian/Ubuntu, I would suggest building Gambit from source rather than using the gambc package in the repo. It looks like that package is very out of date at this point. (It's actually been orphaned in Debian and I've been considering adopting it to bring it up to date.)
- tehwalrus 14y agoThanks. I thought this was the case, but Chicken claiming that it compiled into portable C files rang a bell! In principal, my app doesn't need much more than a couple of local databases (files with S expressions in..) so I don't think extensive system library support would be much advantage. I have built Gambit from source on both OS X and my Debian VM - no problems using them, but I haven't done anything remotely advanced yet.
- outworlder 14y ago> I've been interested in Gambit because it seems to allow fairly direct intermixing of Scheme and C code. I don't recall seeing Chicken being able to mix the two in the same file. Actually, it can. Just use a 'foreign-lambda' to embed your C code as a string, if that's what you want. In fact, Chicken and Gambit's FFI are so similar that I managed to use an OpenGLES FFI from Gambit on Chicken with just a couple of macros to convert between them.
- nickmain 14y agoFrom the Chicken documentation [1] it appears that it does not include bignums in the core but as a separate package that requires GMP [2] to be installed. Since GMP is LGPL licensed this might cause an issue if you are sensitive to such things. Gambit includes bignum support without external dependencies. [1] http://wiki.call-cc.org/man/4/Deviations%20from%20the%20standard http://wiki.call-cc.org/man/4/Deviations%20from%20the%20stan... [2] http://gmplib.org/ http://gmplib.org/ (I use Gambit but not Chicken)
- ZaneA 14y agoFYI, this hasn't been true for 3 years now: http://lists.nongnu.org/archive/html/chicken-users/2010-03/msg00038.html http://lists.nongnu.org/archive/html/chicken-users/2010-03/m...
- nickmain 14y agoThanks for the pointer. This note in the documentation for that egg looks worrisome [1]: "IMPORTANT: This only works when the code will be run on exactly the same platform as the Scheme compiler ran on. Cross-compilation and compiling to C and compiling that on the target platform is not supported. (You will get an error message when you try to do it anyway)" Does this mean that cross-compiling for iOS would preclude using this bignum egg ? [1] http://wiki.call-cc.org/eggref/4/numbers#compiled-code http://wiki.call-cc.org/eggref/4/numbers#compiled-code
- ZaneA 14y agoI have no experience with it personally, so that might indeed be the case. If anyone mentions otherwise on IRC (#chicken on freenode) I will update this accordingly.
- tehwalrus 14y agoI remember some horrible compilation issues with this library while I was trying to get some academic code running - they used the rationals in GMP.