Emacs, Dilemma

posted on September 21, 2006

Due to a post I made to ruby-core, I have received an invitation to join an elite group of Emacs-using Rubyists (Ruby-using Emackers?) in a concerted effort to improve the state of Emacs' Ruby support. O joy, that I am not alone in desiring and striving toward such a goal! But there is a fly in my oyster...

A few days ago I had been chatting with a friend about the possibility of writing a new Emacs-like editor using Ruby as the extension language. He proposed the idea, I shot it down like the Red Baron taking pot-shots at pots.

It would be beautiful, rapturous even. Most of Emacs' Lisp code does text-processing, which is not one of Lisp's strength. Hell, most Elisp is so straight-up procedural that it barely looks like Lisp. But Emacs just has too much code — existing, useful, and well-tested.

Every line of text or code I write in any language, I write in Emacs. I read my e-mail in Emacs. I write for and post to my blog from Emacs. In fact, the XHTML for these entries — including the syntax-highlighting — is generated by Emacs1. Re-producing all that functionality would be like re-building New York city out of crème brûlée — tasty, but not ultimately worth the effort2.

But then I stumbled across this blogessay. M. Yegge makes essentially the same points, but also demonstrates that other people have been thinking about it. I am not alone in wishing and yearning for Emacs, but with Ruby. It would be a massive effort to replace the code produced over GNU Emacs' twenty years as a free software project, but it wouldn't have to happen all at once, and those other people would help.

Hence, my dilemma — contribute to the pile of excellent Elisp which will eventually need to be re-written in Ruby, or suck it up now and begin (find? join?) the project which will eventually make Emacs obsolete? Choices, choices...

1 Using muse-mode, htmlize, and some custom Elisp glue.

2 Did I mention I'm trying to find the worst analogy? Because I am.

Commentary most sage

Hi Marshall:

As the inviter, and I'm both flattered and hope to live up to the desciption "elite." I have to say myself, I would really love it if I could do emacs extensions in Ruby. That being said, we have some plans to modify el4r, so that might be a reality. Regardless, given the scope of some of the things I'd like to accomplish, I'm certainly planning to have a helper process in Ruby. So possibly, you could work in Ruby and it'd be reusable.

Another option would be to embed Ruby into emacs, I know it's been done for Perl and Python, though I'm sure I'd want to tackle that, but we may have/find someone who is.

Ultimately, emacs support for Ruby still has something to be desired, and we all code Ruby in it, so it seems that it's in our own best interest to improve, and hopefully the concerted effort will yield good results much quicker than any of our indvidual efforts.

So I'm hoping you'll join us.

Forrest

Forrest: Well, I've decided that I (at least presently) lack the hubris necessary to attempt "Rubymacs." So join you I will. :-)

A good example might be plruby for PostgreSQL. It's smallish and will likely represent the bare minimums required to plug in Ruby.

> I have received an invitation to join an > elite group of Emacs-using Rubyists > (Ruby-using Emackers?)

We prefer the term Emaculates. =D

There's always Diakonos, an editor written entirely in Ruby. It's pretty new and still console only. I actually haven't gotten to the point where I love Ruby that more than Lisp to start hacking on it; I'd rather stick with what we've got.

I was also considering writing a rubymacs but never had the time to really try it .. However there are some editor written in Ruby that might worth it. For example Diakonos (http://purepistos.net/diakonos/) ;)

In ten more years there will be another language that makes ruby obsolete, and everybody will be talking about how to rewrite emacs (which will STILL be using lisp) to use that new language.

Better to submit a change to emacs that allows for plugging-in the language of your choice. Now THAT would be useful!

And would have about as much chance of being accepted into the distribution as a snowball in hell.

"...I read my e-mail in Emacs..." - I'm thinking that you dress like Strong Bad when you sit at your computer.

(I'm only noticing this blog post / comment thread now, but...) well, two years later, Diakonos development is still chugging along, and yes, you can script it in Ruby. You can do nifty things like highlight some lines and execute code like:

lines.sort

or give a block body like this:

'# ' + line.downcase.gsub( /todo/, 'DONE' )