Thoughts on Perl and Emacs, technology and writing

A Modern Style of Programming

Something a casual user of a language will miss out on, is using the latest and greatest libraries of that language and generally programming in a modern style. For example, I1 still naturally use open(FH, 'filename') || die; and have to force myself to use the more modern open(my $fh, '<', 'filename') with its lexically scoped filehandle.

I have been programming Perl for 12 years or so, but aside from one conference (YAPC Muenchen 2002) I’ve never really immersed myself in the community. For this reason, I think I have missed out on quite a few niceties. Moose, DBIx and other modules bring Perl up to the level of its contemporaries if you don’t need to work with people who are not using them. I only came across POE recently (which I keep mentioning because it is so awesome).

Heck, even C++ has boost.

Modifiable Syntax

or DSLs I think they call it.

Ray Dillinger once pointed out that people write scheme in a variety of incompatible styles because the substrate isn’t pleasant for programming on directly. But it is possible to layer any sugar you like on it. This leads to a bunch of different and practically incompatible styles.

Anyway, what I see is that scheme programmers are capable of
doing a heck of a lot as individuals, and are very happy with
the personally-customized language they each work with. But
they tend not to work together on large projects because of
the cognitive overhead of learning each other’s personally-
customized languages, which may have different or conflicting
definitions.

Common Lisp programmers, by contrast, have a lot of standard
libraries and tend to forgive or ignore some small things that
may not fit perfectly with their personal style. But they do
work together on large projects, because they all have the same
set of language extensions and they can read each other’s code.

I still find eager comprehensions about the nicest way of specifying nested loops that I’ve seen. Perl syntax tweaking dudes: if you add these, I’ll never switch! What’s that? Fix it myself? It is easier to move to python or ruby I think.

Is it a coincidence that languages with fixable syntax (Lisp, Perl, Tcl, Ocaml) have ‘lost’ to those with a fixed syntax (Java, Python)? Ruby dudes beware.

Supporting Your Language

There have been a fewposts floating around the blogosphere talking about writing posts supporting perl. I put my own effort into doing something similar for Emacs. However, in my opinion, Emacs needs the help and Perl does not.

Emacs could be greatly improved if there were many more Emacs Lisp hackers creating libraries and writing examples and documentation. Perl already has all of those things. <strike>As</strike> If its popularity wanes, what is lost? I guess people are thinking about job opportunities and stuff like that, but I suspect that the outflow of former Perl programmers will outpace the loss of Perl jobs.

Share this:

Like this:

Related

7 Responses

I’ve found elisp has a fairly steep learning curve. Some of this is
due to syntactic difference with most other languages I’m familiar
with. I could also do with more self contained bitesize examples that
demonstrate specific features of the language. While there is some
excellent documentation out there a lot of it is very dry reading
(especially if your not from a Computer Science background). Things
like the emacs wiki provide a good corpus of interesting code snippets
but I suspect most get plugged into .emacs by users with little
thought to what the code actually does, just if it works or not.

Part of the reason I joined the emacs planet blog network was to pick
up knowledge in small chunks and assimilate concepts and examples. You
last post on error handling was very interesting. Hopefully some of my
basic posts
will help someone else.

Basically I agree with you and welcome more language related posts on
the network 🙂

I like the posts with actual elisp code snippets too. But for some reason my waffley posts, which take much less time and effort to produce, are more popular, or at least read by more people 😦 Perhaps the audience for learning elisp is small.

Anyway, I found playing around with and reading about other lisp dialects (scheme/CL) helpful for learning emacs lisp. Although emacs lisp is much more useful of course! 🙂

And thanks for your comment. It’s good to know you liked the error handling post.

Hear, hear, Ive found emacs to be incrediable tool for damm near everything major that I do, (techinical I browse the web from conkeror but thats emacs inspired). Ive started reading on the elisp docs that come with emacs and am quite enjoying how its teaching using actual emacs source code. Im quite glad you mentioned about the other lisp dialects being a good learning place to as both Scheme and Common lisp have certain attractions as well for different reasons thou

@Ron – yes, it is extremely useful. And it is great for making new little tools. If only there was a good API reference it would be even better.

I often look at Practical Common Lisp to get an idea of the basic lisp constructs that are available. Many of them are available in emacs lisp too although perhaps dynamic scoping gives programming in emacs lisp a very different feel.

@Alexandr – Hi. I had a quick look at the modules you mention, thanks for pointing them out. I couldn’t see an obvious way of doing nested loop which is what generators / eager comprehensions make so nice. Eager comprehensions also don’t use a huge amount of memory so I guess they don’t construct a list first.

I’m not sure I think that will be an improvement. I don’t have much experience of Scheme but it seems that Emacs Lisp (and Common Lisp) are more practical languages, at least that is what Ray’s post linked above says to me.