Saturday, March 5, 2011


Having installed Guile 2.0, I was finally able to try out Geiser. For those who came in late, Geiser is an Emacs mode that provides a Slime-like IDE for Scheme. I've been yearning for something like Geiser for a long time. As I explained in Dragged kicking and screaming to Emacs (Pt. 1) (Pt. 2), I moved from being a lifelong Vi user to Emacs specifically to have a comfortable Lisp/Scheme hacking environment. Slime fills the bill nicely for CL, but until Geiser there was nothing as nice for Guile, my preferred Scheme dialect.

Here are some of the features of Geiser taken from the on-line documentation:

  • Form evaluation in the context of the current file's module
  • Macro expansion
  • File/module loading and/or compilation
  • Namespace-aware identifier completion (including local bindings, names visible in the current module, and module names)
  • Autodoc: the echo area shows information about the signature of the procedure/macro around the point automatically
  • Jump to definition of identifier at point
  • Access to documentation (including docstrings when the implementation supports it)
  • Listings of identifiers exported by a given module
  • Listings of callers/callees of procedures
  • Rudimentary support for debugging (when the REPL provides a debugger [which Guile does, of course —jcs ]) and error navigation
  • Support for multiple, simultaneous REPLs

Another useful feature is that Geiser starts automatically as soon as you enter a scheme buffer. You can then evaluate whatever portion of the buffer you like and a quick C-c C-z pops you into the REPL—very nice.

I've just started playing around with Geiser but so far everything looks well done. The only problem I've found is that Geiser does not load the .guile file and there isn't any way of making it do so. The idea is that you should use the .guile-geiser file instead, but that doesn't work for me. That's presumably because my .guile loads a reasonably complex environment including my version of autoload functions. I was able to work around this problem by putting a local copy of geiser-guile.el in my init.el file after the form loading geiser. In this copy, I removed the -q switch in the geiser-guile--parameters function by replacing the line

"-q" "-L" ,(expand-file-name "guile/" geiser-scheme-dir)

with the line

"-L" ,(expand-file-name "guile/" geiser-scheme-dir)

I wrote and submitted a patch to allow the -q switch to be a configuration option, so perhaps the problem will go away in future versions.

If you're a Guile user, Geiser is well worth trying out. I think it's better than anything else that's available for Guile.

Update: Fixed broken links
Update 2: The newest version of Geiser now supports loading .guile

No comments:

Post a Comment