\$5

### Image of the Day Submit

IOTD | Top Screenshots

## Lisp is King

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

326 replies to this topic

### #21bishop_pass  Members

Posted 06 March 2003 - 08:45 PM

quote:
Original post by Tron3k
You could do the same thing in PERL.

I wouldn't be so quick to say that you can do the same things in Perl. While you can create Perl expressions with your Perl program at runtime, and evaluate them, you don't have at your fingertips the parse tree of the expression, giving you the ability to instantly and easily dissect and substitute functions within the evolving program. By the time you got around to coding the correct string substitution code, it would get less and less elegant, and it certainly wouldn't be anywhere as fast as the Lisp version.

But more to the point, if you really think Perl does compare to how it's done in Lisp, then you're definitely missing the differences in the paradigms between the two languages.

[edited by - bishop_pass on March 7, 2003 3:47:52 AM]

### #22SabreMan  Members

Posted 06 March 2003 - 10:21 PM

quote:
Original post by smart_idiot
Any tips and/or recommendations for anyone who would like to try it?

Yeah. Do it.
quote:
Original post by DerekSaw
I could feel that Lisp contains the most basic form of elements in programming.

Programming with Lisp is like programming directly with Abstract Syntax Trees. Lisp macros are used for performing automated transformations on the trees, and there is some amount of manual manipulation too. You can build whatever abstractions you choose around the structure, just to prevent any claims of "that sounds really primitive". The CL Standard defines a fairly hefty set of abstractions for general purpose programming. When those don''t suit your domain-specific needs, you get to define the constructs which map very closely with the domain concepts, and they fit seamlessly into the language.
quote:
Original post by evil sausage
Yeah the "what''s so great lisp?" thread only lasted 7 pages.

Gee, that was constructive.
quote:
Original post by CpMan
The only thing I have heard counter to it is that it is a broken implementation of lambda calculus.

It''s not meant to be an implementation of lambda calculus, it''s merely inspired by it. Lambda calculus is insufficient for real-world large-scale programming, and Lisp makes concessions to the real-world.
quote:
Original post by Tron3k
Yes, I would also like a good recommendation on a free Lisp implementation for Win32. There are so many, it is hard to choose! Preferably one that can compile (if that''s even possible!), and can link to external libraries so you could maybe use OpenGL and stuff.

quote:

I might really get into this Lisp stuff - it sounds exciting.

It is. Although Lisp has been around in one incarnation or other for a long time, it still stands as the most modern of programming languages.

### #23SabreMan  Members

Posted 06 March 2003 - 10:27 PM

The most commonly repeated criticism of Lisp on these boards, and elsewhere is that Lisp cannot be much good because it has not been an astounding commercial success. To answer that concern, I'd like to quote one of my favourite Usenet contributors, the inimitable genius that is Mr. Erik Naggum...

quote:
Original here
| Bottom line: The proof of which is better (C++ or Lisp) is to look at
| the commercially successful applications.

this is obviously a convenient argument as long as what you already think is better is also commercially successful. however, is your taste in music or entertainment equally likely to argue for "commercially successful" over other qualities? when does "commercially successful" break down as _the_ argument to support something? my take: when what you think is best is not the most commercially successful thing around, or when what you think is commercially successful is bad for some reason or another, like drugs.

it is extremely interesting to watch people who argue for the choice of the "people" or the "market" through whatever is "commercially successful", and see their arguments against things they don't like (popular music), think are immoral (pornography), or otherwise find reasons to consider exceptions
to their sure-fire rule of quality.

in other words, the "commercially successful" argument is a statement of shallowness on the part of he who uses that argument.

| If Lisp is such a hot language, how come most applications are all
| written in C and C++?

I have news for you: they are not written in C or C++, either.

| Is that that Lisp is not used because it's difficult to read and
| maintain? Is Lisp's problem lack of performance, portability, what?
| Must be some major weaknesses.

yes, there are major weaknesses, but as with everything else in our market society, perception is more important than facts. for instance, the negative attitude among programmers to languages they were taught by people who didn't know them, and perpetuated myths about Lisp instead of teaching. include in this "attitude problem" such articles as your own that display no interest in learning facts about Lisp, but instead insist on finding mostly invalid reasons not to look at it. no matter how good the language is, the kind of marketing that would be necessary to convince you to look at Lisp has nothing to do with your actual arguments against it.

if C and C++ are so hot, how come they haven't always been? how did they become hot? how did they overcome the "how come most applications are all written in Fortran and Cobol" argument? how does Java face the same argument?

I hope you see that your line of argumentation is utterly without merit and relevance -- the sorry fact is that it is only useful as long as your audience already agrees with you before you started to argue. since your audience is largely made up of people who have never looked seriously at any other programming languages, they won't even stop to think that your invalid argument is invalid. and _that's_ how C and C++ manage to live on, regardless of their obvious costs and problems.

[edited by - SabreMan on March 7, 2003 5:28:26 AM]

### #24bishop_pass  Members

Posted 06 March 2003 - 10:43 PM

Artificial Evolution of Implicit Surfaces : An Application of Genetic Programming. Lisp expressions are evolved to create interesting geometric surfaces.

Posted 06 March 2003 - 11:12 PM

quote:
Original post by bishop_pass
I want people to share Lisp snippets of code.

(defun brain-damage (x)        (if (eql x 1)                1                (+ (brain-damage (- x 1)) 1)        ))

### #26Jeff D  Members

Posted 07 March 2003 - 12:19 AM

Jeff D

### #27Diodor  Members

Posted 07 March 2003 - 12:48 AM

I have the trial version of the Corman Lisp IDE. Has less menu entries than Notepad yet it's very powerful. The one command I need to use, "Execute Selection", shortcut SHIFT+Enter will execute the current selection, or whatever code lies between the paranthesis at the cursor position and it's corresponding opening paranthesis. I get access to all global variables, simply by moving next to them and pressing Shift+Enter, just as easy as executing just a part of a function (just make sure the local variables needed by that partial code are defined as global variables before). The IDE also shows the syntax for each function or macro as you type it, and it matches paranthesis.

I'm learning by inching through Paul Graham's On Lisp book (as was mentioned here before, it's available on his site, paulgraham.com) and checking the functions and macros in the Common Lisp the Language reference guide.

I'm just starting to learn macros, but it's going to be a lot easier because of the functions macroexpand and macroexpand-1 which show the output of a macro on the spot (macroexpand-1 performs just one step of expansion - eventual macros called from within then top level macro are not expanded). I would have wanted this for C macros for a long time, but getting the preprocessor output was as close as I came to.

[edited by - Diodor on March 7, 2003 7:48:56 AM]

### #28rmsgrey  Members

Posted 07 March 2003 - 01:03 AM

quote:
(defun brain-damage (x)        (if (eql x 1)                1                (+ (brain-damage (- x 1)) 1)        ))

I''m sure that could be optimised further... I don''t know any Lisp (except what I''ve gained by osmosis on gamedev forums) but I''d try:

(defun brain-damage (x)
(x
)
)

and leave the obfuscation where it belongs: here

### #29Dauntless  Members

Posted 07 March 2003 - 01:29 AM

What are the differences between Python and Lisp? I''m debating between spending more time on another language, and I was thinking Python because lots of people seem to talk about how easy it is and its excellent extensibility features. But the concept of Lisp sounds intriguing too. Are there many game-function style libraries for Lisp?

And being a pretty newbie programmer, how complex is Lisp to learn compared to Python and C++?

### #30SabreMan  Members

Posted 07 March 2003 - 02:49 AM

quote:
Original post by Dauntless
What are the differences between Python and Lisp?

http://www.norvig.com/python-lisp.html

### #31bishop_pass  Members

Posted 07 March 2003 - 08:52 AM

quote:
Original post by Diodor
I get access to all global variables, simply by moving next to them and pressing Shift+Enter...

Or just type the name of the variable whereever you are in the editor and press Shift + Enter. Actually, pressing Enter on the numeric keypad is easier in my opinion.

### #32bishop_pass  Members

Posted 07 March 2003 - 09:20 AM

Reflection

This is what this webpage has to say about Common Lisp with regard to reflection:
"Common Lisp
The state of the art. It has a standard builtin metaprogramming interface, by having a standard representation of code as data. It has a standard way to absorb new language constructs, with its standard syntactic macro system, and a standard way to extend the language syntax with "reader macros". This language extension is powerful enough to allow the implementation of arbitrary sublanguages, including new object systems, logic programming, etc. However, as far as object systems are concerned, CommonLISP already has the most sophisticated one, that is also customizable through a Meta-Object Protocol. Very powerful, standardized, high-level, etc."

### #33trzy  Members

Posted 07 March 2003 - 11:34 AM

Maybe a bit OT, but: How about ML? bishop and Sabre: Have either of you used it?

----
Bart

### #34Dreddnafious Maelstrom  Members

Posted 07 March 2003 - 11:56 AM

taken from a bishop_pass linked article higher up

"You know, the universe is the only thing big enough to run the ultimate game of life. The only problem with the universe as a platform, though, is that it is currently running someone else''s program."

thought it was cool.

Dredd

### #35CWizard  Members

Posted 07 March 2003 - 12:26 PM

quote:
Original post by Dreddnafious Maelstrom
"You know, the universe is the only thing big enough to run the ultimate game of life. The only problem with the universe as a platform, though, is that it is currently running someone else''s program."
U:\> format u:

### #36neurokaotix  Members

Posted 07 March 2003 - 12:33 PM

LISP is almost as good as Visual Basic. Almost...

Join the World Wide Revolution:

### #37bishop_pass  Members

Posted 07 March 2003 - 01:07 PM

Who owns the fish?

### #3863616C68h  Members

Posted 07 March 2003 - 01:17 PM

bishop_pass, could you post a simple Lisp example and its C evuivalent? I mean, do it!

### #39bishop_pass  Members

Posted 07 March 2003 - 01:27 PM

quote:
Original post by 63616C68h
bishop_pass, could you post a simple Lisp example and its C evuivalent? I mean, do it!

I have a better idea: You show me the C or C++ equivalent of this Lisp program:

(setf fruits ''(apples oranges pears bananas))

Have fun. I know I wouldn''t.

### #4063616C68h  Members

Posted 07 March 2003 - 01:39 PM

um yeah, you see, you''re the only one I know that knows both languages. First of all, setf doesn''t make itself obvious as to what it does...set format? This is what I''ve translated so far:

  //set all of the fruits: /*apples, oranges, bannanas, ran buttans, mangos, jack fruit*/

It''s bug free but it doesn''t do anything. I''m sad now

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.