What is the best Scheme implementation for (sys-admin) shell scripts? - shell

I've gone through the academic Scheme stuff (read SICP, The Little Schemer, The Seasoned Schemer, TSPL) and been playing with Scheme as a toy for a while.
But I want to get practical.
Today I needed to write a shell script to do some batch file processing, and thought "why not do it in Scheme?". I did, and it was a joy.
Now I'm forced to wonder what the best implementation is for shell script type stuff.
I know all implementations differ in terms of what they implement beyond R5RS. (Basically, they differ in all the useful and practical extensions you'd want in a scripting language).
So I'd like to pick one implementation and stick to it. I'm looking for something that:
Is cross platform (Linux, OS X, Windows).
Has extensions that are useful in day-to-day shell scripting, and those extensions are part of the base install.
Is easy to install. (e.g. there are a number of pre-built binaries, and/or it is a standard package on many distros.)
Is actively developed, with an active community.
Has Unicode support.
I've been using Gambit so far. It seems to satisfy the above constraints. PLT seems like overkill. Wondering about Guile, MIT/GNU, etc.

PLT Scheme meets all of your criteria. Since it looks like you know that already, you should to use the MzScheme package. MzScheme is the runtime on top of which all of PLT is built.
If you were to download the full PLT Scheme install it would seem large as it includes a lot of documentation and an IDE in addition to the runtime.

Have you heard of scsh? I haven't used it, but it sounds a lot like what you want.

I recommend Gauche, which is:
Running on Linux, OS X, Windows w/
Cygwin and some other UNIX-like
platforms,
The base install contains
POSIX-compliant system libraries and
useful modules such as
network protocols, file system,
DBM, multithreading, etc...
Several package system such as MacPorts, apt-get, yum are available
(or just say configure, make and
make install),
There are active English and Japanese mailing list,
Supports UTF-8 as an internal encoding.

Related

How do I write a cross platform installer script?

Instead of having a different download of a program for Windows and Linux, would it be possible to make the download be a cross-platform script/executable that can download the correct installer from an FTP server and start that? What language should I write it in? The only one I can think of would be Java, but I don't want to take the time to learn it. I can't write it in Python or BASH, because most Windows machines don't have these installed. How should I do this?
Cross-platform executable(like an exe or a.out or ELF) is out of question. An executable is never cross-platform when Windows is involved. The scripting languages(or JIT compiled) have to be brought in for this purpose. We are in a CHICKEN-AND-EGG paradox. You may have to detect the OS the downloader is using, using a Javascript script in your website page and decide on what is to be done next etc...
Although not exactly what you are looking for, below are some pointers.
The best tool I know of, for multi-platform installers, is Flexera Software's InstallAnywhere. That might be a bit costly. For free options I would look into options like:
PERL
PYTHON (but this is out of question as per your post, but look at the end of my post for more options for Python)
Although writing the installer in any of the above languages might mean a lot more work, they provide you unmatched flexibility and complete control.
Perl requires that you install Perl interpreter and modules on Windows. But this also seems to be out of question for you. So you may avoid the headache by looking into:
PAR
pp
For Python go through:
py2exe
pyinstaller

Does Mac OS X come with a Lisp environment built in with Emacs?

I have been trying to find an environment that does not involve installing anything else on my mac for Lisp, as I will not be using it after I get the homework done (who know if I continue using it). I have tried to look but I can't find anything. Anybody know if it does have it, and how to use it within Emacs?
You have a few options for one-click Lisp environments.
If you prefer an Emacs-based environment, check out LispBox. This actually installs a separate instance of Emacs, afaik, so you probably won't have your existing Emacs settings with it.
If you want to use your existing Emacs, SLIME is available both through quicklisp (which you really should be using) or through ELPA.
If you're ok with not having an Emacs environment, and you're not going to be using the language for long, look into LispWorks personal, which has a one-click environment installer in OS X.
If you were actually asking about Scheme (or could go for either Scheme or Common Lisp), take a look at Racket (not technically a Scheme, it actually has a lot of additional features, but they do support R5RS and have a fairly short list of unsupported R6RS features).
Emacs Lisp is rather different from regular Lisp, so it's probably not directly useful for classes or self-study if your target is something like Scheme or Common Lisp. But yes, Emacs has its own Lisp interpreter (or rather, is its own Lisp interpreter). You might want to read up on the differences between Emacs elisp and other dialects / variants to determine whether it might suit your needs.
Clozure CL is a available for free from the Mac App Store
http://itunes.apple.com/us/app/clozure-cl/id489900618?ls=1&mt=12
Have you checked Ready Lisp ?
Also have a look at here.

Which Scheme for Mac OS X Snow Leopard has the best support?

There are a bunch of different Scheme interpreters available for the Mac:
http://www.dmoz.org/Computers/Programming/Languages/Lisp/Scheme/Implementations/
Which one is generally supported the best? I'm also interested in 64-bit support and multi-core/processor support.
I don't know which ones are supported the best, but I've used Larceny, DrScheme and Bigloo.
I believe that Larceny is widely believed to be the fastest open source scheme compiler available. It follows the unix tools based philosophy (no IDE). I don't believe it has 64 bit support yet. I haven't used it for a while, but the web site claims R6RS support. If I was to use scheme in anger, this is probably the system I would choose.
DrScheme is the one I use the most, because it's easier to use :) It has an IDE that understands the language as well as a profiler. It fits what I want from scheme quite well (ie playing around with things to find out how they work). It's performance has improved considerably since I started using it. Large set of libraries. R6RS support (mostly). 64 bit support for Linux.
Bigloo is interesting in that it targets several back ends, including JVM, .NET and native code.
All seem to have reasonable community support, but I see DrScheme mentioned the most.
DrScheme isn't actually a Scheme dialect - it's an editor, part of the PLT Scheme distribution:
http://www.plt-scheme.org/
(The actual Scheme interpreter command is 'mzscheme', but I have no idea of the origins.)
I use PLT Scheme for web-development under OSX, and it is extremely good, with excellent library support. DrScheme is my editor of choice - most regular editors don't have S-expression indentation engines.
Gambit (R5RS) threads, 64-bit, Termite (shared nothing parallelism)
Chicken (R5RS) threads, 64-bit
Ikarus (R6RS) 64-bit
Ypsilon (R6RS) 32-bit
I'd also encourage you to try (my personal favorite) Petite Chez Scheme which comes in 32-bit/64-bit and threaded/non-threaded versions for all popular platforms.
Go for DrScheme now called Racket; it is the best. I always recommend it for beginners because of its hassle-free installation. Mit-Scheme is the most widely used but MacOsXLion may give you headaches in installation.

Recommendations for a lisp setup on Mac OS X (any dialect)?

What is your Mac OS X (Intel) based lisp setup (of any dialect), how do you like it, and how painful was it to set up? I'm looking for a versatile lisp that is easy to set up, but if you feel strongly about investing more effort, or even money, I would like to hear why you think it's worth it.
I am currently using newLisp, which was a breeze to set up and gives me simple access to things like graphics and sound. I have heard of SBCL with emacs and slime, but that seems a real pain to set up, and I'm still not friends with emacs. I want to see if there's anything I'm missing out on. I would primarily be using this for pleasure, with no commercial goal in mind.
Please recommend only one setup per answer to enable voting, but feel free to submit multiple answers.
Ready Lisp:
Ready Lisp is a binding together of several popular Common Lisp packages especially for Mac OS X, including: Aquamacs, SBCL and SLIME. Once downloaded, you’ll have a single application bundle which you can double-click – and find yourself in a fully configured Common Lisp REPL.
It’s ideal for OS X users who want to try out the beauty of Common Lisp with a minimum of hassle. It could also be used by teachers to give their Mac students a free, complete Common Lisp environment to take home with them.
The best Lisp for Mac OS X is LispWorks. It is commercial though. Installation is done with an installer in a few seconds. It is started then with a double-click from the programs folder. It has a Cocoa-Bridge and the user interface is written with it, but based on a portable substrate - so the same development environment is available for Windows and Unix/Linux/FreeBSD.
I suppose it depends on what you mean by "setup". Clozure CL (previously Open MCL) has an experimental Cocoa bridge, and you can even build a smallish IDE as well (just fire it up and do a (require "COCOA-APPLICATION") and it'll build the .app bundle for you). I use vim myself, but you're free to use whatever editor you like (+ Interface Builder), of course. CCL supports Emacs+Slime, but does not require it.
Try PLT Scheme. It is mature, has lot of libraries and comes with an IDE.
Gambit scheme is a "complete, portable, efficient and reliable implementation of the Scheme programming language":
Gambit consists of two main programs: gsi, the Gambit Scheme interpreter, and gsc, the Gambit Scheme compiler. The interpreter contains the complete execution and debugging environment. The compiler is the interpreter extended with the capability of generating executable files. The compiler can produce standalone executables or compiled modules which can be loaded at run time.
The Gambit compiler allows Scheme to be compiled to C, with some pretty cool applications, like writing an iPhone app in Scheme (with a REPL for remote debugging).
There is a FFI for Gambit so you can use external C libraries.
There is an installer or you can install via MacPorts.
You could install guile. I'd use fink.
That is easy, but it gives you a fairly lightweight scheme installation.
General Comments
Most lisps are not that hard to set up on OS X if you're used to working on the command line, though some are harder than others. I think the hardest to set up are CMUCL and Clozure; if memory serves, you need to make a symbolic link into a directory on your path if you don't want to run them from their respective directories (they don't install an executable into /usr/local/bin on installation). In any case, you'll put more work into getting Slime going in Emacs than you will actually installing a lisp. New Lisp is an easy install from the OS X gui, installed from a OS X package (making it the easiest install of all lisps except, perhaps, for PLT Scheme).
I do recommend using a some form of IDE, be it Emacs + Slime or the LispWorks or Clozure IDEs. People use other editors, but those are the ones that have been tailored most to programming in lisp. Personally, I wouldn't enjoy programming in lisp if I couldn't use Emacs + Slime, but I've put in a lot of time to learn the Emacs and Slime commands.
Implementation Recommendation
Here is a specific recommendation that is different from the others. If you are new to lisp and not too picky that it be Common Lisp, you should look at PLT Scheme. It comes with an IDE and an implementation (DrScheme and mzscheme) that can't be beat for ease of installation and use for a beginner. PLT Scheme comes with lots of extensions to Scheme that make is easier to use for more programming tasks than the other Schemes as well.
Easiest solution: (assumes you have the excellent Mac Ports installed)
Step 1:
$ sudo port install mit-scheme
Step 2:
$ scheme
Step 3:
Read Structure and Interpretation
of Computer Programs http://mitpress.mit.edu/sicp/full-text/book/book.html
Clojure is a wonderful lisp. it is truly modern lisp designed for pragmatic concurrent programming. It compiles to the JVM and can call and be called by java nativity with no wrapping and a minimum of ceremony.
clojure.org
try: XMLisp for OS X (FOSS)
3D: Open Agent Engine: scene graph based mini engine, 3D objects, animation, mouse hovering, selection, camera control, texture management
2D: controls: layout managers, buttons, sliders, text
http://code.google.com/p/xmlisp/
It is an extension of Clozure CL. IDE is included. You should be able to get this running in no time.
Alex

What is the best Scheme or LISP implementation for OS X? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
I am looking for a version of Scheme or even LISP that I can use to recover some lost Lisp development skills. Some web capabilities would be nice but not essential.
I've looked at Plt and MIT scheme and, while both look pretty good, the Plt seems to be more feature rich. I've also looked at Lisp implementations but all of the seem quite expensive.
I favor free/inexpensive implementations as this is truly likely to just be occasional hobby programming. What recommendations would you have?
I'd go with Racket. It may not be as fast as SBCL, but it does have excellent libraries and documentation, as well as an integrated environment that's designed to get you developing and running Scheme programs right out of the gate. What I really like about Racket's IDE, DrRacket, is what you don't have to do—you don't have to learn Emacs, you don't have to learn SLIME, you don't have to worry about hunting down third-party libraries, as virtually all libraries meant for Racket can be found in packages. All in all, it really cuts down on the learning curve and allows you to focus on the actual task at hand: writing great code.
Also, it comes with a web server if you want to make Racket-powered websites (which I'm currently looking into).
I did quite a bit of experimenting with this.
Clozure Common Lisp (née Open MCL) is by far the fastest; 25-30 percent faster than the next competitor on my intel Mac Mini.
MIT Scheme works quite nicely on a Mac. I think I eventually compiled it myself, but there are binaries at that site. PLT Scheme is also nice, and possibly a little better integrated into the Mac world. (PLT Scheme is now known as Racket, but I haven't experimented with it after the change.)
I'm a huge fan of Clojure, SBCL, and Clozure CL. They are all fantastic, but they are also overkill if all you want to do is refresh your Lisping chops. They all require absurd amounts of info hunting, mailing list searching, package installing, irc lurking, etc.
Dr Scheme just installs and runs. I finished the first 3 chapters of SICP four and half years ago using Dr Scheme. Nothing was more profound than defining a Scheme evaluator in itself. Once you get your head around that you'll have a lot more patience for the industrial strength brethren.
For Scheme, DrRacket is awesome (included in Racket).
For Common Lisp, Ready Lisp is great. A single dmg with SBCL, Aquamacs and Slime working out of the box.
From the Web site:
Ready Lisp is a binding together of several popular Common Lisp packages especially for Mac OS X, including: Aquamacs, SBCL and SLIME. Once downloaded, you’ll have a single application bundle which you can double-click — and find yourself in a fully configured Common Lisp REPL.
It’s ideal for OS X users who want to try out the beauty of Common Lisp with a minimum of hassle. It could also be used by teachers to give their Mac students a free, complete Common Lisp environment to take home with them.
Requirements
The current version of Ready Lisp is 20090127 and requires Mac OS X 10.5 (Leopard).
It includes the following component software versions:
Aquamacs 1.6
SBCL 1.0.24
SLIME 2009-01-23
CL-FAD 0.6.2
CL-PPCRE 2.0.1
LOCAL-TIME 0.9.3
SERIES 2.2.10
CL HyperSpec 7.0
paredit.el 20
redshank.el 1
cldoc.el 1.16
I've just started playing with Clojure. It apparently has a nice web framework, and compiles to JVM bytecode.
I also use DrScheme quite a lot. It's a simple yet useful IDE.
Depending how you define "Lisp", Clojure may fit the bill. It runs on OS X fine (it runs anywhere the JVM runs). It has web capabilities and it's free.
It also has the benefit of being new and fresh and fun to use. Might be ideal for hobby programming. It's easy to write web apps or GUI apps (using Java's Swing or even Qt).
I haven't used it myself, but Steel Bank Common Lisp has received some favourable buzz over at reddit. It's open source and free so the price is right for some hobby programming.
In the past, I've had GNU Common Lisp running on my macbook pro.
If you are looking for Scheme you can take a look at just released JazzScheme.
I do recommend Racket to new-comers, since it provides one of the nicest IDE's for Scheme beginners (or rather, programming beginners who happen to be using Scheme, or better still, working their way through HtDP).
http://racket-lang.org/
Another option, for people who are more interested in a small Scheme system in order to modify it themselves or read its source code, is Larceny Scheme, which is of interest largely because its JIT compiler, Twobit, is itself implemented entirely in Scheme.
http://www.larcenists.org/
Update: In addition, Chez Scheme has recently been open sourced:
https://github.com/cisco/ChezScheme
(It may not be as "small" as Larceny, but it has a very aggressive optimizing compiler.)
If you're just hobby programming, LispWorks has a free, personal version which is quite powerful and sophisticated. It's biggest issue is a run time limit of several hours. So, you won't be writing any long running servers in it, but that doesn't mean it's not a useful tool.
CLISP runs on most everything, and is quite nice actually, it just doesn't do threads. (Important if you want to write an actual server, but as PHP and Perl have shown us, Apache + [insert language] is a very viable platform.)
You might want to look at what's at the Association of Lisp Users or the Common Lisp Wiki to see what's there. I set myself up with Steel Bank Common Lisp and Emacs, but have done little with it so far.
Clozure CL is available for free from the mac store!
http://itunes.apple.com/us/app/clozure-cl/id489900618
I have found that Chicken works well for Scheme and is available through homebrew.
brew install chicken
Most of the code from SICP works with minor modifications.
I've been asking myself the same question lately. Having used DrScheme on OS X it would be my first choice of Scheme distribution for any platform. Very nice IDE, debugging features and a good set of libraries/frameworks (including a very nice GUI toolkit that 'just works... even on Mac' ;-) )
However, I'm now looking for a similarly comfortable environment for Common Lisp. It came down to CCL (OpenMCL) versus SBCL. SBCL seems to be the popular choice but I read that on OS X is doesn't support threading. (Is this really an issue?). Clozure CL, on the other hand, boasts good support for native threads, the obcj-bridge, etc...
I'm finding CCL a little odd but I'm going to stick at it for a while - It still looks like the logical choice for integration.
I use Emacs 23 (built from source using --with-ns) and Slime as an environment and this works well for me. :-)
Go with Racket. I'm very happy with it!

Resources