Re: How To Learn Lisp
- From: Tim X <timx@xxxxxxxxxxxxxxx>
- Date: Fri, 21 Sep 2007 16:15:46 +1000
Rainer Joswig <joswig@xxxxxxx> writes:
In article <87fy19sosn.fsf@xxxxxxxxxxxxxxxxxxxx>,
Tim X <timx@xxxxxxxxxxxxxxx> wrote:
I did find Rainer's response to the question of why he uses emacs and slime
when he dislikes it so much interesting. On the one hand, he discounts it
and says not to use it, yet when asked why he does, he admits that for some
of the free implementations, it is the best solution on offer.
Best solution does not mean that I think it is a 'good' solution
for, say, a newbie. A few weeks ago I gave somebody an introduction
into Aquamacs/SLIME/SBCL. He was already using Lisp for quite interesting
stuff. I could see his cognitive overload after a few hours
explaining the basics. I mean the 'basics'. I was like
fearing that he stops using Lisp because this stuff
looks all so insane.
I guess we have different views. I've only been using emacs and slime for a
relatively short time and just haven't found it that much of a problem. I
suspect we are coming from two opposite extremes and reality for most
probably lies somewhere in the middle.
When you are in that maze, you don't see how twisted it is. Step
back a little. Try to explain this stuff to newbies and
you will see that you will reach only a small percentage of
people with it. There is a good chance that a large percentage
will never come back.
I actually still consider myself to be a newbie when it comes to CL and
emacs slime. I've not done any customization of emacs and slime and still
find it the best integration I've seen for the free implementations.
I find these
two positions a bit inconsistent. Wouldn't it be better to say that if you
plan to use free implementation X, then the best thing to use is
emacs+slime, even with its problems, but if your going to use a commercial
implementation, you will probably find the IDE it provides to be the best
solution.
I really hope for 'free', 'open source', no-cost, whatever Lisp users
that we get something better than SLIME/Emacs. For newbies and
for advanced users.
I don't disagree, but hoping doesn't change now and that is the situation
new users are faced with.
We now have some many extremely good 'free', 'open source',
no-cost, whatever Common Lisp
implementations, yet we are stuck with Emacs.
Don't get me wrong. It is good that there is a widely used
Emacs mode for Common Lisp and people have invested a lot of
time. But sometimes it would be nice if there was some
'design' and not just hacking of new features or
reorganizing of sources. From many programming languages,
Common Lisp probably has one of the best Emacs modes.
But it deserves something better.
Upon thinking why I actually use Emacs, I think say that I mostly
like DIRED and browsing text files (sources, ...) via the DIRED
these days. I don't use GNUS (tried it), planner mode (tried it).
Sometimes I use the outliner.
Also I use the shell in Emacs. But, when I want
to try out something in Common Lisp, I often use just a Terminal
and OpenMCL. If I want to try out something, I usually don't type M-x slime
(or something similar) to Emacs or try to find the last
SLIME REPL buffer (which has a shortcut, I know).
I'm more of an Emacs user than a SLIME user, I think. If
I have the choice (depending on what kind machine/OS I work)
I tend to avoid Emacs for Common Lisp programming.
When I reflect about my Lisp usage and see that I wanted to try out something,
write a code snippet or do some longer sessions and I tend
to not use SLIME/Emacs in those situations. I'm intuitively
using to some other tool.
Maybe I'm old-fashioned? But I grew up with Emacs, too.
A few days ago I ported some benchmark code to Open Genera.
Got some errors. But it felt like home. It was fun to
fix those errors. Stuff did help and did not stand in
the way. It is so much more relaxing to work with it.
It is recreational hacking. Emacs is stress.
Emacs violates all kinds of human interface principles.
If you look around you see that people are concerned
with productivity. There is lots of 'Getting Things Done'
advice you see. The main principle to get things done
is to simplify. Get rid of muda. Current Emacs is full of muda.
Too many options. Too many commands. Too many useless
ways to help the user while it actually stands in the way.
Maybe the problem here is that to some extent you were
spoiled by Genera and evrything else now seems to be poor in comparison? I
feel similar regarding packages I used many years ago that to me have never
been done by anyone else as well as the original, but the original is no
longer viable given changes in OS, libraries and hardware.
Also, while I've not encountered all the problems Rainer has outlined and
some of the behavior he found frustrating doesn't bother me, I suspect that
most of those issues will not be relevant until the OP has progressed a
fair way down the road to lisp, at which time, he will be in a better
position to evaluate which direction to take anyway.
Double click MCL. A listener and an editor. Both written in CL
in one app. Type a form. Press enter. Done.
Newbie time to REPL with MCL? A second. With Installer for MCL
30 seconds.
How many commands distract you from Lisp code? Zero.
Now Emacs. Let's take Aquamacs.
Double Click Aquamacs. Now what? Ten thousand commands and
a million lines of Emacs Lisp. But no Common Lisp.
Now install Common Lisp. The usual Unix stuff. Not that
hard, but it takes some minutes. Then do some basic
setup so that you can call the implementation with
some simple command. No double clickable app. Okaaaaaay.
Now SLIME. Take the SLIME that comes with Aquamacs.
Outdated. Good chance that it will not work and you struggle
for some time. Time to get a newer version. But which one?
I use CMUCL on an Intel Mac. Need to get the newest or
patch it yourself. Try one from the source repository?
But which one? What is a useful version? The latest
source currently seem to broken in some features quite
often. Which was the last stable version. Okay, we
will find out.
We got SLIME. Now how to integrate it with Emacs. Read
the instructions. We are now typing Emacs Lisp - but
we just wanted to do Common Lisp. Now how to call
Common Lisp from Emacs. We find out.
Newbie time to REPL with SLIME/Emacs? A day.
How many stuff distracts you from the Common Lisp REPL?
A zillion! Learned new useless concepts? Hundreds.
I think you have made that a pretty biased outline to be honest and it
certainly doesn't reflect my experience at all. In fact, your outline of
emacs and slime setup reminds me very much of a co-worker, who having been
programming since the days of PDP-10/11 and was still in the mindset of
building everything from sources and had yet to make the transition to
modern day package management.
My experience (only a couple of years ago)...
Woke up Saturday morning and decided this was the day to start looking into
learning CL. Logged into my Debian GNU Linux box and typed
apt-cache search "Common Lisp"
a heap of entries pop up with brief descriptions. There are numerous CL
implementations. Not sure which one to choose, but I had heard from a
friend they liked SBCL, so I decide on that one. I've already got emacs
installed and I see SLIME, so I'll grab that as well. There are a heap of
cl- packages, such as cl-pcre, decide not to install them just now - I want
a simple setup to begin with. I do notice packages for a PDF of "On Lisp',
"ANSI Common Lisp', Common Lisp The Language, 2nd Edition and an HTML
reference called the 'Hyperspec". Decided you can't have too much
documentation, so I select all of those as well. Time so far, less than 5
minutes.
Type apt-get with the list of packages. Apt tells me its also installing
some other packages that are required. I enter 'y' and the process
starts. Around 5 minutes to download and install these packages from the
net.
I start emacs and type M-x slime in the mini-buffer. A buffer pops up with
some comment about this being the beginning of a wonderful experience and I
have a REPL prompt cl-user>. I enter (+ 3 2) and hit enter and get the
result on the next line.
Time to get from nothing to a REPL and enter my first lisp expression, just
over 10 minutes. Number of emacs configuration steps required, none. Number
of elisp expressions required, none.
I then spend a while exploring the environment, seeing what the various
menu options do. Discover handy little features, such as looking up a
definition in the hyperspec, describing the value/symbol/thing under point
etc. At this point, I've not used any special emacs commands apart from M-x
slime. I've been using the menus to explore the environment and while I've
noted the short cuts printed in the menus for things like describe symbol
etc, I've not used them yet. I've pretty much just used the mouse, arrow
keys and keyboard. I have enabled paren matching from the 'Options' menu
and I have enabled font locking (from the options menu).
I do admit that later I did do considerable customization and created elisp
to add to load hooks etc. some of this was not trivial and required the
sort of knowledge that only comes after using emacs for quite some
time. However, the point is, none of this was required initially. I was
able to get up and running with a REPL in not much longer than your MCL
example and most of that time involved download and deciding which of the
many CL related packages I wanted.
The basic 'out of the box (package)" setup was fine to start with. In fact,
many of my customizations came from searching places like the emacs wikki
and posts to groups like this one. None of them were required in order for
me to start using CL or SLIME and in fact many would make no difference
given the type of stuff I was doing initially. This is the main point I
think is often lost with experienced emacs users. Emacs actually provides a
pretty good default setup. Its actually the fact it is so powerful and
configurable that it can become a bit of a monster if you let it. For
example, the often cited 'weird' key bindings. Given that emacs has more
key bindings than any other editor I've ever seen, its no wonder that some
(even a lot) of key bindings are to key combinations that seem really crazy
or difficult to use. However, if you restrict yourself to the basic key
bindings that you would find in most editors, you find that there is a
rationale behind them and the basic ones are pretty good in that they are
logical and easy to use.
When you first start doing CL, you are not that concerned about being able
to move around by sexps, manipulate things on a sexp level or have parens
inserted/deleted in matched pairs. This comes later, once you are doing
more complex coding. By this time, you probably know about additional
modes, such as paredit and advanced key bindings for evaluation etc. You
are probably familiar enough now to customize some of the key bindings for
the mode to make them more comfortable or natural to how you want to work
and you know which key bindings you don't use and therefore can re-bind to
different commands that are more convenient. You may even find some of the
default SLIME configuration with respect to windows, buffers etc to not be
what you want and may decide to start more serious customization, possibly
involving writing elisp etc. However, you don't *need* to do this to get
started and with modern package management, you can actually get started
without doing a single bit of emacs customization or writing elisp.
If there is one mistake I see more than any other when it comes to emacs,
its the user who starts up emacs and within the first 5 minutes decides
that they want to start changing everything. I think this is a mistake
because in that short amount of time, they really don't understand either
the rationale that underlies many of the decisions of why something has
been done the way it has been done or have enough understanding to actually
do the customizations correctly. My advice to all new emacs users is to
just use it 'out of the box' for a few weeks before doing any
customization. Give it a chance and look at it as something new rather than
something you need to force into being like everything else you have ever
used. In the end, you are likely to extensively customize it, but by
waiting, you give yourself the chance to possibly discover new and better
ways of dinig things and you give yourself the time to learn it
sufficiently to actually customize things in the right way and not
introduce weird unexpected side effects that drive you nuts for the next 12
months while you work out that the 'bugs' and problems are actually due to
things you have done incorrectly. Like all powerful things, it takes time
to learn how to harness that power.
There is also possibly another approach with Emacs that may still be
worthwhile, especially for those who really don't like SLIME, ILISP. This
was the mode emacs use to use before SLIME. I don't think it is maintained
any longer, but as it was quite a simple mode compared to slime, it
probably still works. Being much simpler, it may suit those who feel SLIME
tries to do too much or gets too much in the way. You can also get a fair
amount of functionality by just running an inferior lisp process within
emacs and forget about SLIME or ILISP. You would only get a REPL and the
only way to send commands from a CL code buffer would be using cut and
paste, but maybe that is a nice very simple way to get started if iether
your distro doesn't have a SLIME package and you don't want to install from sources.
I also am amazed at comments regarding CVS versions of SLIME being
unstable. What do people expect if they use the latest CVS snapshots - this
is development code and its bound to be unstable at times. SLIME is an
active, udner development package and at times it will go down paths that
either create instability or change features in ways that it later turns
out are unpopular or just were not well thought out. Welcome to the world
of distributed open source development and remember the code is in CVS, so
you can always revert to an earlier release should you find the changes to
much or the latest version to be too unstable and if you really don't like
it, don't use it, but unless you are prepared to work to improve it, pull
your head in and shut up (BTW, this is not directed at any specific
individual, so don't take it personally unless you really want to, in which
case, pull your head in and shut up)..
Tim
--
tcross (at) rapttech dot com dot au
.
- Follow-Ups:
- Re: How To Learn Lisp
- From: Rainer Joswig
- Re: How To Learn Lisp
- References:
- How To Learn Lisp
- From: Carlo Capocasa
- Re: How To Learn Lisp
- From: Rainer Joswig
- Re: How To Learn Lisp
- From: Carlo Capocasa
- Re: How To Learn Lisp
- From: Rainer Joswig
- Re: How To Learn Lisp
- From: David Trudgett
- Re: How To Learn Lisp
- From: Rainer Joswig
- Re: How To Learn Lisp
- From: David Trudgett
- Re: How To Learn Lisp
- From: Pascal Costanza
- Re: How To Learn Lisp
- From: David Trudgett
- Re: How To Learn Lisp
- From: Slobodan Blazeski
- Re: How To Learn Lisp
- From: Tim X
- Re: How To Learn Lisp
- From: Rainer Joswig
- How To Learn Lisp
- Prev by Date: Re: Lisp and OCaml
- Next by Date: Re: How To Learn Lisp
- Previous by thread: Re: How To Learn Lisp
- Next by thread: Re: How To Learn Lisp
- Index(es):
Relevant Pages
|
|