Where to start?

Discussion of Common Lisp

Re: Where to start?

Postby Unne » Tue Jul 21, 2009 12:18 pm

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:

Code: Select all
~ $ 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.
Unne
 
Posts: 32
Joined: Sat Jun 28, 2008 6:10 pm
Location: Oregon

Re: Where to start?

Postby Paul » Tue Jul 21, 2009 6:49 pm

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...
Paul
 
Posts: 106
Joined: Tue Jun 02, 2009 6:00 am

Re: Where to start?

Postby Paul Donnelly » Wed Jul 22, 2009 12:30 am

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.
Paul Donnelly
 
Posts: 148
Joined: Wed Jul 30, 2008 11:26 pm

Re: Where to start?

Postby tayssir » Wed Jul 22, 2009 1:19 am

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.)
tayssir
 
Posts: 35
Joined: Tue Jul 15, 2008 2:33 pm

Re: Where to start?

Postby lszanto » Wed Jul 22, 2009 4:43 pm

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.
lszanto
 
Posts: 3
Joined: Sun Jul 19, 2009 5:51 pm

Re: Where to start?

Postby findinglisp » Fri Jul 24, 2009 5:00 pm

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/
findinglisp
 
Posts: 440
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX

Re: Where to start?

Postby phil » Sat Jul 25, 2009 12:32 pm

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
 
Posts: 27
Joined: Wed Aug 13, 2008 1:23 pm

Re: Where to start?

Postby gugamilare » Sun Jul 26, 2009 6:40 am

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.
gugamilare
 
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil

Re: Where to start?

Postby lszanto » Mon Jul 27, 2009 1:39 am

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?
lszanto
 
Posts: 3
Joined: Sun Jul 19, 2009 5:51 pm

Re: Where to start?

Postby skypher » Mon Jul 27, 2009 1:53 am

skypher
 
Posts: 34
Joined: Thu Jul 03, 2008 6:12 am

PreviousNext

Return to Common Lisp

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests