Scheme in the real world
Is anybody here using Scheme in the real world? Common Lisp has been my language of choice for a while now, but I'd like to try something a little less bulky. There are two types of projects I'm working on with very different requirements. I'm considering Scheme for both.
The first is standard webapp development. I've been using Hunchentoot, CL-WHO and friends here, and I'm experimenting with Weblocks. I generally like these tools, but I'm open to trying tools that work differently. I'd like to know what tools the Scheme users here prefer for web work.
The other project is a desktop/embedded (fairly fast PC hardware) system with soft real-time requirements (for the curious, it's a DMX lighting controller). I'm looking for speed, multithreading and some predictability in the garbage collector.
26 comments
[ 4.1 ms ] story [ 75.2 ms ] threadDon't tell if you don't want to, or if you think its too long ! Maybe paren count is more appropriate ;)
I am guessing amazingly concise.
I just ran a scheme equivalent of trav on one of my code files and get a count of 300 (on a very small file). This could of course mean that my code is bloated, but I am impressed anyway!
Just curious, but does arc have its own macro system? Or do you use MZScheme's macros?
So far, the biggest issue with Common Lisp I ran into while writing Weblocks is lack of continuations. There were other issues but they were minor annoyances that were fairly easy to overcome. Right now I'm working on a delimited continuations library for CL. Writing one really isn't as bad as it sounds - I think On Lisp unnecessarily scares people from rolling their own code walker.
Out of curiosity, other than continuations, what advantage do you see in using Scheme over CL?
I assume the person asking the question has good reasons for asking it. If I can I answer. If not, I don't.
Coming to the question proper, there are often good reasons to ask if other people use / don't use a particular technology.
To answer, I use a custom variant of scheme to write machine- learning systems on a cluster of cots machines. It compiles down to optimized C, but I write in scheme.
I ask because I'd like to get a perspective on the tools that are available from people who actually make things with them. The programming language I use might be a "secret weapon" in some situations, but most of the people it would give me an advantage over wouldn't even understand why it's an advantage.
What I don't understand is why you want something "a little less bulky"? Can't you use a subset of CL?
https://tbe.taleo.net/NA4/ats/careers/requisition.jsp?org=EA...
http://en.wikipedia.org/wiki/RScheme
Eons ago, I remember building a DMX controller by ripping out the clock from a standard RS485 card and soldering in a new (8khz?) one from Radio Shack so the baud rate would be right...
Speed didn't become an issue even Gauche wasn't a native compiler (it compiles to VM), for the network driver was always the bottleneck. Yet I did care not to cons in the inner loop.
So for the web I would use PLT and its great web server. In fact I do use it for a little internal app and love being able to write a web app in the 'direct style' ie just write a web page interaction with a user as a function execution. You can just assign a lambda to a link, saying 'when the user clicks this link, execute this lambda'. It's great. However, that links won't be bookmarkable nor indexable by search engines, so if some of your pages need to be, you have to make the links to them be traditional links. So the continuations-based stuff lends itself to the parts of your app that are private to a single user (like taking user input or showing them their email) and/or shouldn't show up in a search engine anyway. This would include anything that you would describe as a 'wizard'.
NASA (or is it just the Air Force?) is using PLT Scheme to control a large telescope in New Mexico (http://news.ycombinator.com/item?id=75219) to great success. So for soft real-time stuff you should be good. Just from using it, I wouldn't recommend the default garbage collector with PLT for anything like hard real-time stuff. But there are other GCs, so ask around. The PLT mailing list is excellent: http://www.plt-scheme.org/maillist/
I have used scheme at work and for the last 6 weeks on a private project in earnest.
One issues is that there are a lot of scheme implementations out there. Some good, great, average, and others bit rotted. Only mention two here.
DrScheme/MzScheme is pretty amazing. It is fully loaded and few know of its full capabilities. The fact that PG can just "write" Arc in MzScheme and some other pretty neat things that are doable in MzScheme is not an accident. DrScheme/MzScheme is much, much more then Scheme in a way not too many people understand.
The second implementation is Larceny. True native compiler. Plenty fast. The compiler is written in Scheme (small C runtime). Its hackable from top to bottom. Extensible and did I say fast? Threading is fair or green threads using continuations/call-cc (no O/S threads). Don't like the Scheduler? Modify it, its in tasking.sch The interrupt handler is a lambda function, just redefine it. Don't like the i386 code output, hack the assembler or the optimized 5 pass compiler. Its all in Scheme.
Don't like standard poll, I added epoll via the FFI in a few hours.
Larceny has been around for years, but is undergoing a resurgence to bring it up "closer" to the new R6RS standard.
I think it has great potential. Be advised that do to the rapid changes in development underway that there are some rough edges in certain "library" areas, however, the core compiler is solid and stable.
Awhile back Slime was ported over to Scheme48 (not a system for general real world use, but a fun hacking implementation). The compiler group should have Larceny stable with many of the libraries and features of the new R6RS standard (some will not implemented). IF SLIME scheme backend was ported over to Larceny as well. It could be the start of something special.
Also, it has a scheme-to-javascript compiler inside it...
If you really like Java, SISCWeb is also nice.