Hacker News new | comments | show | ask | jobs | submit login
Lisp Enlightenment and Emacs Frustration (erik-rasmussen.com)
32 points by gnosis 2491 days ago | hide | past | web | 27 comments | favorite



Oh nooo... It's a 2007 article, but I wish I had been able to go back to that time and shout, "You can use vim! It's okay!" slimv... screen, vim, sbcl in an alternate window with linedit... I think the only real things emacs ever gave me was some intellisense and a slightly enhanced debugger over sbcl's stock debugger. I do not really feel slowed down, though; maybe the problem is that I am not regularly experiencing the speed-ups. :)

But whatever the case, emacs should not be a barrier to Lisp. I might even recommend for new Lisp users: avoid emacs. First learn Lisp. Play around a bit. Most of your environment should be the REPL, and you can copy-paste from your favorite editor. You can use "(ed)" in the REPL. Go from there. Then, later on, try to get emacs to work with your Lisp. Mainly, you will want to experience the interaction, the environment with Lisp. Finally, switch back to vim when you are ready to get your real work done quickly.

I couldn't help the last line... :) Use both editors, depending on your immediate need. But learning Lisp is separate from learning emacs.


I use VIM as well to edit lisp and it works wonderfully. I, too, wanted to scream back in time at this guy :)

I do think that I'm probably missing some nice things that SLIME has that I don't currently take advantage of, because I usually just treat my lisp programs much like other programming languages: I write all my code in an editor (VIM), and then I hop over to a terminal and just run "sbcl --load file.lisp". The interactive piece is probably nice, and may be a little faster, but for what I'm doing, this is is all I need. Besides, this is pretty much how I program in every other programming language anyway.


I completely agree. I've tried doing the Lisp + Emacs combo, and it's just too daunting for someone starting out. I'm happy as can be using Vim for now. I fully intend to give Emacs a thorough chance once more, but not until I'm more thoroughly entrenched in Lisp.


My fingers are broken. I dust of emacs every now and then but I end up typing vim commands on the screen when I want to do things. :-)


One time I tried using Eclipse for a screencast, and it felt like coding with oven mitts on. However, I didn't blog about the experience, because it contributed nothing useful. I wonder if the same thought occurred to the author.


If all you want to do is learn the beauty of Lisp don't waste time mucking around with arcane (and great) editors like Vim or Emacs. I'm using LispWorks 6.0 Personal Edition to work through Norvig's PAIP - no headaches.


DrRacket (packaged with the Racket variant of Scheme) provides some indenting and paren matching that is helpful, at least compared to a basic text editor.


DrRacket isn't just helpful, it's a downright fantastic IDE if you're digging into Scheme :)


Does it have vim keybindings?


The keybindings are customizable (in a previous version I added Alt-Backspace for "Undo".). But the procedure is not straightforward, you have to create a special module: http://docs.racket-lang.org/drracket/Keyboard_Shortcuts.html...


No, for that perhaps Geiser+Viper-mode in Emacs would be suitable.


Or consider using newLisp (newLisp.org) -- easy to use and it has a very nice IDE. It's FREE too.


> Or consider using newLisp (newLisp.org) -- > easy to use and it has a very nice IDE. It's FREE too.

You may add sucking as a Lisp to that list of virtues.


Hey, Emacs keybindings suck. Why don't we fix them, instead of complaining?

Surely, it will not be easy -- there are some problems visible even from distance. One of them are people like me who grew accustomed to Emacs' idiosyncrasies -- they're small problem. The big one are people who firmly believe that C-f,b,n,p, C-y/M-y, mainly useless functions having single-key bindings and really useful ones concealed under complicated binding, like C-x b or C-x o, or without any binding at all, like replace-string or query-replace, etc, is the way to go.


As a Vim user who switched to emacs I find emacs bindings inconvenient as hell [1] however I don't think it is possible to fix them now. Most 'prominent' emacs users are simply used to them and won't change their habits, it's really unlikely that new bindings - no matter how cool they would be - would acquire much attention.

[1] Well, I may be biased, however I already use emacs commands automatically e.g. acquired some muscle memory and some things actually are better in vim - after long coding I can actually feel some strain from pressing C-M, and navigation still is much slower, and I doubt it will get faster with time.


It'd be a small annoyance but literally every Emacs user customizes Emacs and has a config file. The veterans would grumble and drag their feet to upgrade to the "broken" version, and then we'd simply bind C-[npfbae] and forget about the switch. Changes can be made there just needs to be a lone decision maker who can say "this is the way it's going to be, like it or lump it".


You're not trying to change the habits of other people, you're trying to improve the keyboard shortcuts for yourself. This isn't about getting the GNU people to change the kbd layout for the next major release, it's about making some adjustments to your own personal .emacs file. Erik Naggum called it the "emacs aptitude test", where you have to change the keybindings before they change you. A surprisingly large number of people don't operate with the standard shortcuts.

And what's the downside of customizing this? Not being able to use someone else's Emacs? How often does that happen? (Never mind that you could – for the sake of your co-workers – switch between overridden and default bindings).

As a first simple step: Sticky keys. This way nobody has to hold down any modifiers for a long time. Easily enabled in most operating systems (or with a bit more trouble within Emacs itself).




There are already various attempts at this. That they have not caught on may be instructive (if not particularly constructive to point out :-( ).


Emphasis seems odd here. Keybindings are just about the most trivially (and commonly) customized part of Emacs, and things like CUA-mode and customized Mac builds of Emacs are common ways of dealing with the issue. Whereas the major benefit of Emacs for Lisp development---having your development environment written in Lisp, by Lispers, who have collectively spent 30 years or so improving its Lisp editing/development capabilities both in included and in third-party elisp libraries---is not mentioned.

I think the poster implicitly points out something interesting---that Java and Common Lisp are both large languages that require sophisticated tools to use effectively. I'm not talking about Emacs versus Eclipse here, I mean the toolset in your brain. Money quote:

"IntelliJ makes Java programming as easy as it can possibly be. It more or less compiles your code as you type it, points out most bugs as they occur, intelligently suggests code completion to finish your words for you. I generates all the annoying repetitive code, like getters and setters and equals() methods for you. Without it, Java would be much more laborious to program in..."

So to Java users, writing annoying repetitive code is a life-saving feature of the IDE, whereas for Common Lisp it would simply be bad style.


Hm.

I'm using emacs just several days.

I've used: vim, visual studio, Delphi/CBuilder IDEs, PyScripter, notepad++, PL/SQL Developer, TOAD, others.

What I found pleasant in emacs: It does not have learning curve at all.

All I need to figure is just Alt-x (M-x). Than it became fun.

I've read documentation only for cua-mode. Everything else was found through guessing and experimentation.

Of course, maybe I'm just novice and I do not know some hidden emacs dangers, one day they will pop up and bite my ass. Dunno.


Ha! Editing Clojure source with UltraEdit over a WinSCP SSH connection to my server! There is no need to force yourself to using either emacs or vi (both of which I use sometimes).


Poor guy, I hope he stuck with it. After all, doesn't pg use vi?

Eta Someone indeed pointed this out as the first comment in 2007.


It baffles me whenever someone announces their discovery that Java didn't invent objects and garbage collection as though that invalidates the whole language. I wonder what rock they have been hiding under. How could any true language enthusiast not have an understanding of their language's history?

====

Java has very few original features. However, it did serve as a sort of 'feature aggregator', where it pulled in a very large pile of features from other languages and housed them all under one roof.

What I (vaguely) remember about Java from the early days as being it's (other) main advantages were:

(1) incredibly easy networking (compare sockets with C for example)

(2) applets (yes they suck(ed), but no other language had that browser adoption)

(3) it wasn't Microsoft (not such a big deal now, but back in the day Microsoft were a lot more aggressive)

(4) it was open(ish) (you could look at the library code to figure out how it was doing stuff) (compare with Visual Basic where everything either magically works or magically doesn't)

(5) Threads (compare again to semaphores)

(6) Free (as in beer)

In some cases, such as early Java, I think a feature most people don't really take into account is not what was put into the language, but what was left out. By hiding pointers behind the curtain, it made the language a lot easier. Easier to write, and easier to read. Even then it had its wrinkles, the people I know who were uber-productive in Java tended to use a small subset of the languages features.

Over the years of course feature creep has slipped in, so it now has bits of perl (regex) and bits of C++ (templates/generics). A lot more of the base code is a lot uglier than it used to be....

====

As for Lisp, I don't really buy the argument that lack of a good IDE held it back. I think the following reasons are more to the point:

A) butt ugly syntax (I'm talking about the random lengths of indents, not the ()s - to understand why this is bad, go learn you some usability)

B) greedy corporate interests (if the developer kit for Java had cost $10,000 no one would ever use it either) (early on)

C) language fracturing and speciation (there are too many 'little lisps' for any one of them to gain momentum) (later on)

D) lack of well written textbooks (compare to the veritable explosion of books for Java in its early days. Back when I was actually interested in Lisp I used to pick up books on it, and they'd invariably spend the first 2 pages showing some vague equivalency to lambda calculus and then it seemed as though they felt their teaching duty was done)

speaking of the lambdas...

E) programmers got better at naming variables and functions (having anonymous functions may be a neat party trick, but nowdays when we put on our big boy pants we like to name stuff)

F) missed the OO boat because they were too caught up in their own cleverness (early OO implementations in Lisp were butt ugly and broken (didn't do encapsulation and/or inheritance well)).

You may argue (as the author of the original article does) that currently Lisp does wonderful OO, but you have the same problem as say Java does, overcoming the slowness myth(s).

I wonder if it is possible to predict the critical junctures where the myths about a language solidify. In any case, it doesn't help to make a new lisp with more/better/faster features (in an attempt to create new myths), because that just feeds the confusion (see point C above)

edit for irony: missed a )


> D) lack of well written textbooks

1. How do I program? I dont know how to build abstractions. I dont know how to write correct, modular and reliable codes. I'll start with "How to Design Programs"

2. I want to learn more about recursion. I want to master thinking recursively because I have found that they solve a lot of my problems. Let me see "Little Schemer".

3. I want to learn more powerful constructs like continuations, tail calls and what not. I want to learn to solve harder problems in Scheme. Let me pick up "Seasoned Schemer".

4. Wow macros are pretty nice. I want to learn more about them. Let me first see how to write unhygenic ones. Paul Graham's "On Lisp" is amazing!

5. Constructing higher levels of abstraction is something that I really want to master. What kinds of abstractions can I build? What are the ways to construct large programs? What is the way to organize programs? What is programming? Let me read SICP

6. What is a loop? Why doesn't scheme have it? How can I build it? How do I build these kinds of abstractions? Wand's EOPL is my bible at this stage.

7. Let me do something useful in Scheme. How do I write much more powerful macros? I love my types. I love my modules. I love my libraries. Racket, I think you are the most powerful thing out there.


I don't know what was the programming like in the early days of java, but none of the original featurs of java is unique to java anymore - whereas lisp has some unique features. C is pretty bad language to compare Java to - they are designed to write different kinds of programs actually. It shouldn't be surprise that doing stuff with sockets is much harder in low level language as C. Also, threads and semaphores are two different things, (by the way, there is some threads support in C), so point (5) is simply invalid.

Considering lisp - I don't see what is wrong with indentation - they actually have something to do with logical structure of code, (also I don't get whats wrong with their usability - for me this 'random indented code' is readable). Speaking of too many lisps - one could as well say that there are too many C-like languages : C, C++, C#, Objective-C. They are all different languages, no some forks of 'The Lisp'. Considering books - well, I've read few of them and none mentions lambda calculus (unfortunately, I'd eagerly learn something about that) - e.g. PCL, 'On lisp'. Also, I think you completely miss the point with lambdas - they are necessary when you are using higher-order functions and naming them would be pointless.




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: