This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

Where to start?

21 posts · 11303 views

Hey, I'm an average programmer from Australia. I've become interested in learning Lisp as I see it as a challenging and powerful language that would be useful to learn. The issue I'm having is I want a basic setup to learn and be able to create some programs in lisp or common lisp but I do not want to use an editor like emacs or vim as I simply prefer a simple text editor like Gedit or Jedit. I am on linux but also have windows avaliable if I really need it. So does anybody know of any guides or ways of creating a simple environment with command line/text editor use instead of emacs or vim?

Thanks in advance, Luke

Re: Where to start?

There's a reason lispers use integrated programmable editors such as emacs; lisp encourages an interactive programming style as opposed to the write/compile/run cycle common in other languages. Thus I can be writing code and then ask my editor to (describe 'this-function) or show me the sources for a function, and the editor simply asks the compiler for the relevant information.

Conceptually, it would be possible to write a JEdit plugin to do everything Emacs does with Slime by writing a Java implementation of the Swank protocol. However nobody seems to have gone this route; most lispers would rather write in emacs-lisp than Java...

If you don't need a sophisticated editor, take a look at ABLE.
http://phil.nullable.eu

The quickest way to use JEdit would be to start a lisp process in the console and copy/paste or LOAD code as needed.

Also take a look at the free versions of Allegro (franz.com) and LispWorks (lispworks.com); they come with IDEs.

Re: Where to start?

If you like the Eclipse editor (which is for Java) and have a powerfull machine (specially in terms of RAM), you can try Cusp. It looks really fancy. I used it for some time and I liked it (but then I learned to like Emacs :).

Re: Where to start?

lszanto wrote:The issue I'm having is I want a basic setup to learn and be able to create some programs in lisp or common lisp but I do not want to use an editor like emacs or vim as I simply prefer a simple text editor like Gedit or Jedit.
Might as well get into Emacs now. Spend a few months with Lisp and you'll be kicking yourself for not doing it sooner. Same with Emacs. :P

Re: Where to start?

If you want to have a full-featured CL environment right off the bat I would highly recommend one of two setups. Either use SBCL on some variant of Debian Linux (Ubuntu is probably the most user-friendly) or use Lispworks Personal Edition with Edi Weitz's starter pack. There's nothing actually wrong with other setups (I use ECL more than any other CL these days), but you might have some difficulties with them, particularly if you want to use a lot of libraries.

This isn't comp.lang.lisp, so I won't be gratuitously mean to you. But I will argue that your set of conditions is silly. It's like going on a culinary tour of Japan and refusing to eat fish, noodles, soy sauce, or dashi. If you come home from such a tour with the impression that Japanese food is unappealing you'll have no one to blame but yourself.

Emacs is sort of old and crufty. Slime combined with a CL implementation is still a long way ahead of most development environments, despite the emacs cruftiness. IOf you insist on your preconceptions you will fail to understand why that's true, and if you fail to understand that you will miss most of what's good about CL. If pressed as to why I persist in programming in this now obscure language I would have to say: Ruby lacks a decent REPL. Ruby lacks a lot of other things CL has, but above all.. while Ruby has irb, you can't use irb in the same way you can use the CL REPL, because no one has bothered to make tools that would allow you to. If you choose to develop as you always have- write, compile, run, or some variation of that, you will miss the point entirely.

You say that you're interested in Lisp, and in CL in particular. If you want to know what is peculiar to Lisp you will have to use the tools that Lispers use. The interactive nature of the REPL is not insignificant.

Re: Where to start?

As already mentioned, emacs is the almost only choice for Lisp programming (at the moment, at least). There are probably other ways (like ABLE or CUSP), but they are inferior to SLIME (in terms of features).
As for implementation and libraries, I highly recommend using Gentoo Linux with Lisp overlay. It contains a rich set of libraries and lisp implementations, all of very recent versions (in contrast with debian/ubuntu: the main repo contains almost ancient versions and I was not able to find other repositories). This saves a lot of time searching and installing libraries.

Re: Where to start?

lszanto wrote:Hey, I'm an average programmer from Australia. I've become interested in learning Lisp as I see it as a challenging and powerful language that would be useful to learn. The issue I'm having is I want a basic setup to learn and be able to create some programs in lisp or common lisp but I do not want to use an editor like emacs or vim as I simply prefer a simple text editor like Gedit or Jedit. I am on linux but also have windows avaliable if I really need it. So does anybody know of any guides or ways of creating a simple environment with command line/text editor use instead of emacs or vim?
Hi Luke,

check out this collection of links: http://stackoverflow.com/questions/1101 ... 22#1102422

I've written those answers for Vim users, but for most of it you can just substitute your favorite editor.

I also recommend clbuild under GNU/Linux for library management.

Leslie

Re: Where to start?

duncan wrote:You say that you're interested in Lisp, and in CL in particular. If you want to know what is peculiar to Lisp you will have to use the tools that Lispers use. The interactive nature of the REPL is not insignificant.
He won't miss the nature of REPL using Cusp or Able, they both provide a load-expression command and a prompt REPL.
dmitry_vk wrote:As already mentioned, emacs is the almost only choice for Lisp programming (at the moment, at least). There are probably other ways (like ABLE or CUSP), but they are inferior to SLIME (in terms of features).
As for implementation and libraries, I highly recommend using Gentoo Linux with Lisp overlay. It contains a rich set of libraries and lisp implementations, all of very recent versions (in contrast with debian/ubuntu: the main repo contains almost ancient versions and I was not able to find other repositories). This saves a lot of time searching and installing libraries.
I may be wrong, but Cusp actually implements all features of Slime (except perhaps contribs), or at least tries to. The problem is it is that Eclipse doesn't have Emacs' features. I'd say that Cusp will be a good environment for learning CL, it comes with everything (editor and implementation) out of the box. Once he learns CL and understand what Lisp is all about, then learning Emacs would be naturally the next step, but I'm afraid that learning Emacs and CL at the same time will do nothing but confuse him more that it is needed.

Re: Where to start?

dmitry_vk wrote:As already mentioned, emacs is the almost only choice for Lisp programming (at the moment, at least).
I don't think that's strictly accurate. You *can* write Lisp code with any editor you like, cutting and pasting to the REPL. Although newbies especially will probably be less productive in this mode, lacking auto-indentation and a readout reminding them of functions' parameters. But some people have been doing it in vi for ages.
gugamilare wrote:Once he learns CL and understand what Lisp is all about, then learning Emacs would be naturally the next step, but I'm afraid that learning Emacs and CL at the same time will do nothing but confuse him more that it is needed.
What makes Emacs so confusing compared to Eclipse? It sure looks simpler to me. A window, some code. And a menu and tool bar for people who haven't turned them off yet.

Re: Where to start?

Paul Donnelly wrote: What makes Emacs so confusing compared to Eclipse? It sure looks simpler to me. A window, some code. And a menu and tool bar for people who haven't turned them off yet.
Emacs is different and its concepts confuse people who are used to Eclipse, Visual Studio and similar environments.

Re: Where to start?

I love when people answer "What can I use to write Lisp other than Emacs?" with "Emacs".
lszanto wrote:Hey, I'm an average programmer from Australia. I've become interested in learning Lisp as I see it as a challenging and powerful language that would be useful to learn. The issue I'm having is I want a basic setup to learn and be able to create some programs in lisp or common lisp but I do not want to use an editor like emacs or vim as I simply prefer a simple text editor like Gedit or Jedit. I am on linux but also have windows avaliable if I really need it. So does anybody know of any guides or ways of creating a simple environment with command line/text editor use instead of emacs or vim?

Thanks in advance, Luke
To answer your question:
~ $ cat hello.lisp
(write-line "Hello, world")

~ $ sbcl --script hello.lisp
Hello, world
http://www.sbcl.org/manual/Shebang-Scripts.html

Other implementations often have similar ways of running from the command line. As others have said, the REPL is a better commandline in Lisp than a shell prompt. Lisp is usually written and compiled and run one function at a time rather than one file at a time. This takes a while to get used to but it has a lot of advantages. It's easier to inspect and debug things, for example.
Paul Donnelly wrote:What makes Emacs so confusing compared to Eclipse? It sure looks simpler to me. A window, some code. And a menu and tool bar for people who haven't turned them off yet.
The arcane terminology (frame, window, point, buffer), non-standard keybindings, kill ring, undo system, buffer model, configuration system, etc. Learning Emacs was one of the most painful things I can remember doing. I think it was worth it but I also understand when non-masochistic people don't want to go there.

Re: Where to start?

dmitry_vk wrote:
Paul Donnelly wrote: What makes Emacs so confusing compared to Eclipse? It sure looks simpler to me. A window, some code. And a menu and tool bar for people who haven't turned them off yet.
Emacs is different and its concepts confuse people who are used to Eclipse, Visual Studio and similar environments.
And vice versa...I've never been able to understand how anyone could bear to use such horrible editors. I'd commit suicide inside of a week if I had to use a non-Emacs editor for anything more than 10 lines of code...

Re: Where to start?

Unne wrote:The arcane terminology (frame, window, point, buffer), non-standard keybindings, kill ring, undo system, buffer model, configuration system, etc. Learning Emacs was one of the most painful things I can remember doing. I think it was worth it but I also understand when non-masochistic people don't want to go there.
You're either exaggerating or you haven't learned vi. :P It's just some memorizing. I'll never understand why some people freak out when they see something they don't already know. Me, I say if it's weird, there must be a good reason for it. Aside from the C++ incident, I'm usually right.

Re: Where to start?

It's a reasonable request; I felt rather liberated programming in Java using something like notepad.

I'd want a usable commandline REPL. If you're running CLisp, I recall it has a usable commandline built in, with history and whatnot. For others, like Clojure or SBCL, rlwrap should give you this. (Clojure instructions, SBCL instructions.) Once you have a nice REPL, it should be easy to load/build your files at the REPL, as well as being able to experiment at it.

Dr Scheme is nice as it comes with its own handy GUI. Same with LispWorks.

I should note that I don't use these; I'm merely aware of them. So YMMV.

(For what it's worth, I happen to be writing this post in Emacs, as I always do. The hyperlinks in it were simple to create. However, some good Lisp programmers have never learned Emacs, except the bit about how to quit it when they accidentally start it up. The ones I know use LispWorks.)

Re: Where to start?

Thanks guys, I think I eventually will have to learn emacs it's just at the moment I have exams and such so only have a little bit of time to dabble in and play aroudn with Lisp. I've really enjoyed it so far and have just used clisp to much around. I'm thinking after exams I'll dedicate a fair bit of time to really get into it and learn how to really use this stuff.

Re: Where to start?

lszanto wrote:Thanks guys, I think I eventually will have to learn emacs it's just at the moment I have exams and such so only have a little bit of time to dabble in and play aroudn with Lisp. I've really enjoyed it so far and have just used clisp to much around. I'm thinking after exams I'll dedicate a fair bit of time to really get into it and learn how to really use this stuff.
Learning Emacs will pay numerous dividends in your programming career, far beyond any Lisp programming you might do. It's very much worth it. If I had to be dropped on a desert island with only a single programming tool, it would be Emacs.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

Re: Where to start?

dmitry_vk wrote:As already mentioned, emacs is the almost only choice for Lisp programming (at the moment, at least). There are probably other ways (like ABLE or CUSP), but they are inferior to SLIME (in terms of features).
I should disclose to the OP that I'm the author of ABLE ;)

First of all, ABLE is massively inferior to SLIME in terms of features. A one man project can never come close to the scope of a project like Emacs (and SLIME) which has probably had millions of man hours spent on it over the last few decades. SLIME is without doubt the most powerful way of programming Common Lisp and as others have said, learning Emacs is definitely time well spent. But some of us find Emacs a little difficult to get along with and it certainly isn't the only way to program in Lisp. I use ABLE every day in my job and I find it a very productive way to program.

ABLE also has one big advantage for new Lisp programmers: the download contains everything you need to get started including a compiler and a set of good libraries for GUI, XML, compression and regular expressions. Also, it's worth mentioning that adding libraries requires nothing more than downloading and unpacking them into a directory. This may seem fairly inconsequential but one of the biggest complaints new Lispers have is that finding and installing libraries is very difficult so it was something I tried to make as easy as possible. (I think that LispBox has similar benefits so that may be worth looking at too but I'm not sure if the project is still maintained; perhaps someone else can provide info on that).
Phil - http://phil.nullable.eu/

Re: Where to start?

phil wrote:This may seem fairly inconsequential but one of the biggest complaints new Lispers have is that finding and installing libraries is very difficult so it was something I tried to make as easy as possible.
Another good hint on this subject is using clbuild, it facilitates the download of libraries.

Re: Where to start?

I've already learnt a bit of lisp, from reading around and from some of the free online books and such. Am I best to go and learn emacs before going any further, or are there guides available to learn emacs in combination with lisp?

Re: Where to start?

To start with Emacs, just use the built-in tutorial (C-h t). I then printed out some Emacs Cheat Sheet and put it on the wall beside my working place. I think that I saw a SLIME Cheat Sheet somewhere, too. Both also have a quite complete manual, don't be afraid to read them.
"Just throw more hardware at it" is the root of all evil.
Svante