Know your tools

Just to illustrate what i meant the other day when i exhorted you to pick a powerful enough editor, and, most importantly, learn how to use it, i think this Emacs Screencast is quite adequate. It’s made by a Ruby coder, but note that Emacs plays these kind of tricks (and many more) for virtually any language out there.

The point is, if your environment is not powerful enough to make this kind of things, you should be looking for something better. The keyword here is extensibility. If your environment is not able to automate a task, you should be able to extend it; and the best way i can imagine is having a full featured lisp at my disposal when i need to write an extension (here is the list of Emacs extensions used in the screencast, by the way). Phil Windley has also made a similar point recently, in his When you pick your tools, pick those that can build tools mini-article.

And of course, when your editor and your dynamic language conspire to provide an integrated environment, you’ve reached nirvana: that’s the case of Common Lisp and Slime, as shown in other widely known videos.

As said, the message is not that you should use Emacs, but that you should use the right tool. For instance, PLT Scheme users have other alternatives, like DrScheme, which can also be easily extended, as beautifully demonstrated by DivaScheme, an alternative set of key-bindings for DrScheme that you can see in action below:

You see, as programmers, we’re lucky: we can build our tools and make they work exactly the way we want. If your environment precludes your doing so in any way, something’s wrong with it, no matter how much eye-candy it uses to hide its deficiencies. (Yes, i have some examples in mind ;-) .)

Update: Phil has just posted an interesting follow-up to his tools article. His closing words nicely summarise what this post of mine is all about:

Note that I’m not writing all this to convert the dedicated vi users or anyone else. If you’ve got something that works for you, then good enough. But if you’re searching for a editor that’s programmable with plenty of headroom, then give emacs a try. There’s a steep learning curve, but the view is great from the top (or even half way up)!

Exactly!

About these ads

9 Responses to “Know your tools”

  1. Rick Says:

    Can we get past Emacs already? The keybindings suck and the whole design is antiquated. Yeah, Stallman doesn’t like guis so let’s keep the editor in the 1970s. The whole architecture is completely FUBAR – a mixture of C and elisp.

    Those diva keybindings for Dr. Scheme are nice. Too bad that I’d prefer to stick with Common Lisp. What we need is a Common Lisp Eclipse.

  2. Craig Turner Says:

    Rick – the default keybindings in emacs do suck and that’s why I don’t use it – too much effort to configure it to work like vim for me. However, I don’t understand your cricisim of the architecture. I wish vim had that sort of elegant programmability built in. What do you dislike about it? It uses heaps less memory than eclipse, and is more easily extensible, and is available on more platforms, and is more stable, and runs from the console and is less mouse-dependent.

  3. Rick Says:

    Craig, if you delve into the Xemacs-dev mailinglist archives you’ll see the problems with a mixed Elisp-C architecture. Elisp is just too slow for many things. Also, because of Emacs console roots, it’s hard to extend into a modern development environment. Maybe there should be a fork of Emacs (Emacs-gtk) with sharing of whatever core features can be shared.

    “What do you dislike about it? It uses heaps less memory than eclipse, and is more easily extensible, and is available on more platforms, and is more stable, and runs from the console and is less mouse-dependent.”

    I’ve got 2 gigs of ram. Emacs is more easily extendible, but not as extendible. There is no way that you can turn Emacs into a RCP (Rich Client Platform). Eclipse is available on basically every relevant platform. And running from the console is part of the reason that Emacs is so antiquated – every feature has to fit into a console model.

    In my ideal world, we would have an Eclipse-like environment written in Common Lisp (or maybe Scheme) – that is built around a common gui library like SWT. In the meantime, I’ll use Cusp (a common lisp eclipse plugin), or DrScheme. I’m done dealing with Emacs – even with the viper keybindings.

  4. jao Says:

    Rick, i find some of your opinions surprising coming from someone who likes CL. Have you tried Slime? In my opinion, that should blow up any quibble about Emac’s architecture. But of course, YMMV.

    I don’t buy either your claim about Elisp being too slow. My experience is quite the opposite. Last time a tried Eclipse in an iBook it was just unusable it terms of speed. By contrast, in Emacs i could run a mail client, an IRC client, a web browser and an IDE without a glitch.

    Finally, Emacs runs in graphic, non-console mode since a long, long time ago, and most of us use it this way. Of course it started as a console application, and it is yet perfectly usable as such, but i see that as a feature, and a very useful one in many scenarios. And this ability, in my experience, by no means precludes having graphical capabilities like, for instance, being able to display images in any format (i’m not sure if Eclipse does that).

    I confess i have no clue what you exactly mean by an RCP, but i’d be glad to hear of something concrete you miss in Emacs. On the other hand, i can perfectly understand that Emacs is not for everyone and that you may dislike it. That’s perfectly fine with me. But honestly, i don’t see any solid basis to your claims about architectural deficiencies, not to mention ‘modernity’.

    But anyway, this is just my opinion (for the record). Thanks for sharing.

  5. Rick Says:

    jao,

    “Rick, i find some of your opinions surprising coming from someone who likes CL. Have you tried Slime? In my opinion, that should blow up any quibble about Emac’s architecture. But of course, YMMV.”

    I’ve used Slime. It’s great…for Emacs. More importantly though, I’m using Cusp (http://www.paragent.com/lisp/cusp/cusp.htm), which uses the Swank backend.

    The architecture of Emacs is far from ideal. A much better solution is something written entirely in Common Lisp or a decent cross-platform Scheme.

    “I don’t buy either your claim about Elisp being too slow. My experience is quite the opposite. Last time a tried Eclipse in an iBook it was just unusable it terms of speed. By contrast, in Emacs i could run a mail client, an IRC client, a web browser and an IDE without a glitch.”

    Elisp is alright when you do simple things. But as I mentioned, do a little research on the XEmacs-dev mailinglist archives if you don’t believe me about the slowness of elisp being problematic.

    The problem with Eclipse on your IBook is well….your’e running it on an iBook. Windows doesn’t have those problems

    “Finally, Emacs runs in graphic, non-console mode since a long, long time ago, and most of us use it this way. Of course it started as a console application, and it is yet perfectly usable as such, but i see that as a feature, and a very useful one in many scenarios. And this ability, in my experience, by no means precludes having graphical capabilities like, for instance, being able to display images in any format (i’m not sure if Eclipse does that).”

    Obviously Emacs runs in a “graphical” mode. But it doesn’t have a real toolkit and is constrained by the least common denominator of console versions of it. The whole Emacs interface is clunky at best. And the keybindings are absolutely guaranteed to give you carpal tunnel syndrom (look at Stallman).

    “I confess i have no clue what you exactly mean by an RCP, but i’d be glad to hear of something concrete you miss in Emacs. On the other hand, i can perfectly understand that Emacs is not for everyone and that you may dislike it. That’s perfectly fine with me. But honestly, i don’t see any solid basis to your claims about architectural deficiencies, not to mention ‘modernity’.”

    Eclipse is built out of a series of plugins. In fact that’s all it really is. It’s not an IDE, unless you want it to be an IDE. A RCP is a Rich Client Platform. Basically, that means that the Eclipse platform can be used for a whole serious of applications that are completely unrelated to programming. Just look at the plethora of Eclipse plugins to see what I mean. Obviously, it’s impossible for Emacs to do that – and yes I understand it’s just an editor.

    The bottom line is that when the lisp community ponders why “lisp is dead”, having a modern development environment is part of the problem. Of course there’s a whole host of other problems too – not having standard sockets, no decent crossplatform toolkit, a whole bunch of “batteries included” with a free, high performance Common Lisp.

    SBCL 1.0 beta should be coming out within a month or two, and when it goes final I would hope the SBCL developers start looking at tools to sway developers from lesser languages. If dynamic typing is getting traction (which I have my doubts about), then Common Lisp/Scheme is in a good position, because the obvious step-up from Ruby, Python, Smalltalk is to Lisp.

    But if people want to put their heads in the sand about development tools in 2007 and beyond, and just say “use Emacs” then there is no hope

  6. jao Says:

    Rick, I couldn’t disagree more with some of your points, but i’m sure anyone following these musings will easily spot them and imagine what my answers would be. Even better, anyone can install, and give a (serious) try to, the tools and programs we’re talking about, and decide by herself whose arguments hold water, or simply what environment better fits her needs.

    So, i’d rather leave the discussion at this point. Thanks again for sharing.

  7. Rick Says:

    jao, obviously Emacs works for you, and that’s fine. What I’m saying is that (at least for Common Lisp) there really isn’t many other options and that’s not going to sit well with people that are used to more modern development environments.

    Remember, Lisp machines had advanced development environments years before there were these fancy Java IDEs. So in that respect , we’ve been going backwards, unless you plunk down a grand for Lispworks.

  8. Know your tools… « a/Caro Says:

    […] An interesting post from a good friend of mine about the importance of using extensible tools — he is a big emacs fan, so you better be prepared to what you can expect there… […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 42 other followers

%d bloggers like this: