Chicken Scheme
call-cc.org
call-cc.org
Learn more about the features it provides: http://wiki.call-cc.org/man/4/Getting%20started
An index of the many libs it supports: http://wiki.call-cc.org/chicken-projects/egg-index-4.html
Why another lisp? http://wiki.call-cc.org/man/4/faq#why-yet-another-scheme-imp...
Getting good performance: https://news.ycombinator.com/item?id=5381472
[0] http://thintz.com?hn=t [1] https://a.keeptherecords.com/demo
Also, I'm really interested in the debug-ability of Chicken. Instead of a stacktrace, which sort of captures "where you're going", a stacktrace in Chicken captures "how you got here", which in conjunction with using immutable data structures would make the most absolutely amazing blob of data to be sent back by a customer - you could potentially restart execution with their data and step thru.
Another one I think is interesting is Lua's with the "upvalues" -- objects are on the stack unless they survive the frame they live in, in which case they are moved to the heap. But they implement it with a double dereference, so it has its own downside.
(No problem for a lot of people, but my particular area of interest is making SMP/ccNUMA systems sing. In Lisp. :-)
I don't know if Chicken Scheme allows multiple distinct instances of the run-time in one process -that would be very cool, and if anyone knows please do tell here-, but it can't safely support multi-threading any more than any standard Scheme can.
To get what you want in a Lisp you need to apply either Erlang concepts (threads with distinct global namespaces, exchanging serialized data via messaging) or Clojure concepts (immutable state + COW techniques + special top-level, mutable variables with synchronization for all mutable state; but I repeat myself, since that's roughly what COW implies).
> To get what you want in a Lisp
Several Common Lisp implementations expose pthreads-style shared memory threads (SBCL, ECL, Clozure, Allegro, etc). It works just fine. The problem of synchronizing access to the closed-over variables in a closure is precisely the same as the problem of synchronizing access to instance variables of a class, and has the same solution: use a mutex.
Same way you do it in C/C++/Java etc with their threads? Not really a unique to closures problem.
>(To get what you want in a Lisp you need to apply either Erlang concepts (...) or Clojure concepts
Or this fancy CSP thing? (Is it similar to Erlang? I don't know Erlang).
Chicken for Ruby programmers: http://wiki.call-cc.org/chicken-for-ruby-programmers
Chicken for Python programmers: http://wiki.call-cc.org/chicken-for-python-programmers
Chicken for PHP programmers: http://wiki.call-cc.org/chicken-for-php-programmers
Chicken for C programmers: http://wiki.call-cc.org/language-comparison
If I should be playing with Chicken instead, tell me why! :)
A list of packages (called "eggs") is available at 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.)
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.)
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.
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.
Gambit includes bignum support without external dependencies.
[1] http://wiki.call-cc.org/man/4/Deviations%20from%20the%20stan...
(I use Gambit but not Chicken)
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 ?
http://en.wikipedia.org/wiki/Racket_(programming_language)
Are these compatible?
Strict R5RS code that don't use eggs (chicken libraries) has good chances to run on Racket. But note that Racket support stuff that is not even Scheme, hence the change of name from PLT Scheme
The largest one is a basic CRM for a small niche. It runs super fast and development was a breeze. I run it compiled with a number of optimizations enabled.[0]
My personal website is also built in chicken scheme and runs fast even though it is running in interpreted mode.[1]
[0] https://a.keeptherecords.com/demo, source code: https://github.com/ThomasHintz/keep-the-records
If you prefix your program with "#lang racket", you get the definitions for the full Racket language, with all of the extensions and libraries that Racket provides.
But if you want to preserve compatibility with the standard and with other implementations, you can prefix your program with "#lang r5rs". It derives from the same base language as Racket.
I'm evaluating racket, clojure, even IronScheme over mono.
Do you recommend using Chicken Scheme, what are his advantages/disadvantages over the other languages mentioned earlier?
It's also BSD-licensed -- not so important for a personal project, but nice if you want to build a commercial product in Scheme. Gambit Scheme also has this (it's available under the Apache 2.0 license).
-Compiles to C, so it's highly portable and you get the performance optimization benefits of whichever C compiler you're using
-Lots of libraries
-Good packaging system, with packages that are cutely referred to as "eggs" (similar to Ruby's "gems" system)
Racket is great too, though, and DrRacket is an excellent IDE with minimal install/configuration difficulty. It just works.
I'm not really sure what tools exist for Chicken Scheme. With Clojure, you're probably going to need to configure emacs or another text editor for syntax highlighting and REPL. I write Clojure in Sublime Text 2 with SublimeREPL but that requires some config and isn't technically free. There are Eclipse and NetBeans plugins, but I dislike Java IDEs for their enormous memory footprint.
This is basically the same thing you do for every other language when using vim/tmux.
Feel free to replace vim/tmux with $EDITOR/$TERMINALMUXER of your choice here, outside of emacs, which kinda does this already as long as you don't care about updating your repl buffer at the same time as you are editing code (say, whatever code you send doesn't return immediately because it's doing something time-consuming). vim+conque has this same issue as emacs, making $EDITOR/$TERMINALMUXER the only alternative if you want to use the repl to hack/dispatch big jobs.
Why do I love it? It can be fast, very fast. You can embed C code if it isn't fast enough.
It is very practical, there are many libs. It compiles to C which makes it pretty easy to add support for many popular libs that are written in C/C++.
A lot of schemes sacrifice speed and practicality for academic reasons, chicken scheme doesn't do this.
The community is fantastic. Everyone is reasonable and kind and helpful.
That all said, I've become quite enamored of Clojure's various data types. Does anyone know if there has been an attempt to create things like immutable maps, vectors, and whatnot for scheme (esp Chicken Scheme)? I found a blog post a while back that talks about FSet for common lisp, but have failed to find an analogue for scheme. http://blog.thezerobit.com/2012/07/21/immutable-persistent-d...
Not too sure about the others though.
So you're throwing away most of the computing power of a modern CPU. But other than that it's totally awesome I'm sure, after all who needs computing power.
Sounds more like a toy to me.
I read some development notes a while back and one of the key features planned for 4.8.0 was a new optimizer based on flow-directed lightweight closure conversion; this is the same technique used in STALIN Scheme, which is widely considered to be one of the fastest known Scheme implementations (i.e., it produces the fastest compiled code).
More info on this, for anyone who's interested: http://stackoverflow.com/questions/8859486/other-references-...
For instance:
https://news.ycombinator.com/item?id=2241015
This is similar to if somebody would post stuff like:
Mono C# compiler [http://www.mono-project.com/CSharp_Compiler]
Pypy [http://pypy.org/]
Those are interesting implementations for well known languages that aren't new. If I post them without explanation of why I found them interesting and relevant now, then I would mislead people and they might conclude that it is advertising.
Am I alone with this?
So it is good to share knowledge from old stuff.
- People get amazed at Go compile speeds, when Modula-2 and Mac/Turbo Pascal compilers were already doing that in the mid-80's
- People are talking about live coding and REPL, when it was already possible in the early 80's within Smalltalk and Lisp environments
- Some assume C is the only way to write operating system kernels, when there was a time operating systems were made using different system programming languages and C was just UNIX's language
- ...
This is why I think young generations need to learn about old technology.