They don't even serve pork lunch in Porky the movie!

lisp really is a stupid language

There's a good reason almost no software has been written in lisp. Lisp sucks. Not just lisp, but the whole way the logic is arranged as nested things. The simplest problem becomes a mind-bending puzzle.

Instead of easy to understand:

if (a equals b) {
  c = not d;
} else {
  c = d + b;
}

You have this nested inner to outer logic where if is a function.

c = if(equals(a,b), not(d), plus(d,b))

The first is definitely more readible and it reads like we think of the logic. No one thinks of if as a function that takes three arguments, and forcing you to work that way just makes you crazy.
Permalink CC 
July 13th, 2010 1:14am
Looks like C's conditional operator although I wouldn't be surprised if Lisp's if() is older. Anyone care enough about Lisp to arbitrate?
Permalink less is more 
July 13th, 2010 1:30am
http://code.google.com/p/lighttexteditor/

I wrote my text editor in a lisp.  If I had more time to spend with it, I would definitely use Lisp combined with another static language like Java/Scala.

Why?  Because the language is simple.  As opposed to complicated language constructors, with Lisp, you are mostly working with language functions that YOU defined.

You just haven't learned basic Lisp yet.

Your arguments are flawed:

This isn't lisp>
c = if(equals(a,b), not(d), plus(d,b))

I think you mean:

(let c (if (= a b) (not d) (+ d b)))

...or some variation.

Look at the left parens and then the function name and the result of the function call.  You simply have a "function name" and the arguments. ALWAYS, unless you defined a macro.  The language is simple.

...

if (a equals b) {
  c = not d;
} else {
  c = d + b;
}
...

if -- what is this?  Is this a function?
(a == equals b) -- is this a function?
{ -- what is this?
) -- what is that?

else -- is this a function?

c = d + b -- is c being over written?  do I lose the state of c at any point.
Permalink Bot Berlin 
July 13th, 2010 1:36am
I bet it would easier to explain Lisp to a kid than it would to explain a Java/C/C++ style language.

Of course,  the person explain Lisp should actually know Lisp.

Start with the basics.

This is the simplest Lisp construct:  ()

This is a function call PLUS operator with two arguments:
(+ 1 2)

The result is 3.
Permalink Bot Berlin 
July 13th, 2010 1:38am
Infix (C, Basic, ...) : c = if(equals(a,b), not(d), plus(d,b))

Prefix (lisp): (setq c (cond (equals a b) (not d) (plus d b)))


Fun fact: AutoCAD's macro language is a Lisp so the bulk of practical lispers on the planet are draftsmen and engineers.

http://en.wikipedia.org/wiki/AutoLISP

It's VERY versatile.
Permalink trollop 
July 13th, 2010 1:56am
The remainder being the users of Brief and emacs of course:)
Permalink trollop 
July 13th, 2010 1:59am
Yea, I used the html textarea.

It is so funny, some people see Lisp as crap.  I see Lisp as an amazingly concise, powerful language.

My only issue with Lisp is writing large applications.  They are hard to refactor during the maintenance cycle.  If you start moving around code, copying code, it becomes difficult to get the application working again.

I can see if you are working with a DSL (AutoLisp?) and you are writing 100-200 line modules.  But, if you are writing a 100k line app.  That must be rough.  shrug.
Permalink Bot Berlin 
July 13th, 2010 2:04am
With Lisp you're writing what would be the parse tree in other languages.  The intermediate step in compiling most languages looks a bit like Lisp -- just flatten out the tree and add parenthesis.  It's a bit like writing code in assembler -- but that's the end part of compilation, Lisp is the middle part.

There's some measure of "purity" working at that level of abstraction -- not a lot of messy syntax in the way.  Of course, the reason we don't work at that level is humans are syntax machines.  Lisp is more machine-level than human-level.
Permalink Wayne 
July 13th, 2010 2:30am
Factor, Forth are the postfix equivalents of Lisps and are in fact used as machine languages.

Good points, Wayne.
Permalink Bot Berlin 
July 13th, 2010 2:48am
It ain't called "Lost In Stupid Parentheses" for nothing.

Last century I wrote a Lisp prettyprinter in Lisp to untangle the nested horror it presents to a dumb text editor. AutoCAD's VLIDE now takes care of all that housekeeping and comes with all sorts of fancy debugging aids.
Permalink trollop 
July 13th, 2010 4:49am
>The first is definitely more readible

only coz you're used to it.
Permalink Send private email Colm 
July 13th, 2010 5:31am
Wayne has summarized it well.
Permalink CC 
July 13th, 2010 7:26am
Languages like Lisp were adopted because companies did not want to invest money in a real language. It is easy to write a parser for a Lisp-like language. The parser pushes the token into a stack, and pops up when right parenthesis is found. Those languages are not suitable for human consumption, difficult to read and maintain.
Permalink Rich Tsang 
July 13th, 2010 7:38am
++ Rick knows what's up.
Permalink CC 
July 13th, 2010 8:26am
Brief was written in Lisp? Really? I loved Brief at the time.

Can't say if Lisp is "good" or not, but I can tell you that those parentheses are butt-ugly.
Permalink not CC 
July 13th, 2010 9:35am
I seem to remember there was some implementation that would detect an imbalance in parens and would just add the needed number on the right when you moved on to the next line.

I've never used Lisp, so maybe I am remembering wrong.
Permalink Aaron 
July 13th, 2010 10:04am
The parens are bad but could be fixed with better syntax.

The real problem is everything is stack oriented prefix, which makes things impossible to write or read in a natural way.
Permalink CC 
July 13th, 2010 10:34am
Common Lisp doesn't call its conditional operator "if"; Scheme does. It is called COND in Common Lisp.
Permalink Send private email Water Cooler v2 
July 13th, 2010 10:47am
Did I say Common Lisp? I am talking about lisp, the category of languages. They all retardedly require use oy the retarded prefix notation for all operators and require function/message notation for conditional logic. It's completely stupid.
Permalink CC 
July 13th, 2010 11:07am
Not only is it a stupid language but its deficiencies are so severe and obvious that anyone who doesn't see them should be kept far far away from software development.

Fortunately, few fans of lisp have ever contributed anything of consequence so this is not much of an issue.
Permalink CC 
July 13th, 2010 11:08am
In the 1980's they tried to make a schematic design package using Lisp as the implementation language -- this failed, they couldn't get the performance to be acceptable.
Permalink SaveTheHubble 
July 13th, 2010 11:15am
http://www.n-a-n-o.com/lisp/cmucl-tutorials/LISP-tutorial-17.html

Common Lisp has an if function.
Permalink Bot Berlin 
July 13th, 2010 11:21am
Ok, I was trying to chime in. I stand corrected.
Permalink Send private email Water Cooler v2 
July 13th, 2010 11:31am
With Lisp you might be writing what is the parse tree in other languages, but I think the power of Lisp comes from being able to manipulate those parse trees as an integral part of the language.

In other languages like C# the ability to access and work with internal parse trees is limited, if available at all, and requires special features to be added on to the language.

By having such a deep introspective ability, Lisp has a unique level of expressiveness that makes it well suited for tasks that are cumbersome to perform in more traditional languages.
Permalink Q 
July 13th, 2010 12:16pm
I agree.  But with great power comes great responsibility... and who wants all that fucking responsibility.  Most of the time, it's just not worth it.
Permalink Wayne 
July 13th, 2010 12:18pm
One of my favorite languages is JavaScript. Now Javascript is equivalent to Common Lisp and I like it. What is the difference? One retains the few advantages of Lisp, but these come in addition to the ability to do normal infix operations and a readable syntax.
Permalink CC 
July 13th, 2010 12:28pm
How is JavaScript equivalent to Common Lisp?  I've heard this before.  What Q says, "I think the power of Lisp comes from being able to manipulate those parse trees as an integral part of the language." doesn't apply to JavaScript.  So where does this comparison come from?
Permalink Wayne 
July 13th, 2010 1:19pm
javascript is more functional than procedural or object oriented.

"natural" javascript looks a lot like lisp code with a different syntax.  Take a look at the various jquery examples online to see what I mean.
Permalink Fake Programmer 
July 13th, 2010 1:53pm
"javascript is more functional than procedural or object oriented."

JavaScript can be functional, Lisp can be functional, C++ can be functional.  I'm not sure why the strong argument that JavaScript is Lisp-like.  I just don't see it. 

"Take a look at the various jquery examples online to see what I mean."

Looks more like ML to me.  :)
Permalink Wayne 
July 13th, 2010 2:19pm
I think CC is musing on the similarity between Lisp's (eval ...) form and Javascript's eval(...) function which both allow code to build and directly interpret code:
http://en.wikipedia.org/wiki/Eval

.NET offers nothing as succinct:
http://dotnetslackers.com/articles/csharp/dynamic-binding-in-a-static-language-part-1.aspx
Permalink trollop 
July 13th, 2010 7:51pm
Most, if not nearly all, scripting languages have eval.  That doesn't make them Lisp-like.  PHP has eval!
Permalink Wayne 
July 13th, 2010 7:56pm
Of course. Read my first link.
Permalink trollop 
July 13th, 2010 8:01pm
I'm not sure that was really what CC meant, though.
Permalink Wayne 
July 13th, 2010 8:09pm
Going back over it all I admit it's more a wail about Lisp's syntactical knarliness than about what can be done with it.

You can store structured data in Lisp. XML, JSON offer similar nested data storage syntax but don't seem to attract the hate. Maybe because they're new.
Permalink trollop 
July 13th, 2010 8:54pm
No, I hate XML.
Permalink ASDF 
July 13th, 2010 9:11pm
In JS and CL functions are objects.

In JS you can make a big collection of things and each thing can individually have a pretty much random structure, with fields identified with hash tags, and introspection. So you can say for item #1781 (and yes even array indexing is a hash lookup) does it have a field named "blue", and what is that field? It's a boolean? Do this. No, it's an integer, ok, do that. Wait, now it is a function, well call that function and get the integer from the result.

This sort of functionality is extremely useful for object oriented programming, thing are trivial to subclass on an item by item basis.
Permalink CC 
July 13th, 2010 10:38pm
"XML, JSON offer similar nested data storage syntax but don't seem to attract the hate."

I think a programming language based on XML or JSON would gather significantly more hate and yet is really the same concept.  Using a format for data storage for code is a very ugly thing.

"In JS and CL functions are objects."

And Python, Ruby, and maybe Perl.  Everything in Perl is everything, so it's entirely possible.

"This sort of functionality is extremely useful for object oriented programming, thing are trivial to subclass on an item by item basis."

No, it's fucking crazy for object-oriented programming.  You know how humans manage a complex world?  We organize it.  Tossing out all the organization isn't a huge benefit.  JavaScript is a mess to code anything particularly large and complicated in.  It does, however, excel greatly at small tight code and meta-libraries -- for which, I agree, that sort of duck typing is very useful.
Permalink Wayne 
July 13th, 2010 10:45pm
No.
Permalink CC 
July 14th, 2010 12:01am
Two reason to why I see Javascript as a very Lispy language is 1) Javascript was in fact designed by one of the creators of Scheme 2) It is trivial to compile Scheme to Javascript; almost every construct in Scheme can be mapped one-to-one to a construct in Javascript.
Permalink Send private email Per 
July 14th, 2010 7:07am
oh, it seems I remembered wrong about my first point. Forget that.
Permalink Send private email Per 
July 14th, 2010 7:11am
I don't know if you guys are familiar with this http://www.lambdassociates.org/blog/bipolar.htm concerning Lisp developers and the people it attracts but it's a good thought provoking read BUT it in no way denigrates Lisp as a language.

It seems that basically Lisp is too good not to have succeeded, same as Smalltalk.
Permalink Send private email Anonymous Coward 
July 14th, 2010 9:44am
I don't know if you guys are familiar with this http://www.lambdassociates.org/blog/bipolar.htm concerning Lisp developers and the people it attracts but it's a good thought provoking read BUT it in no way denigrates Lisp as a language.

It seems that basically Lisp is too good not to have succeeded, same as Smalltalk.

Regards Me.
Permalink Send private email Anonymous Coward 
July 14th, 2010 9:45am
Not succeed is a bit inaccurate. While both Lisp and SmallTalk have both dwindled to niche applications, the innovations that they implemented have migrated successfully to more successful languages.
Permalink ASDF 
July 14th, 2010 11:17am
Wayne,

you'll note I stated "with a different syntax".

What I was referring to was not the syntax, it was the style.  Well written javascript uses first class functions, lambdas, and closure's heavily.  The one big exception to that is when accessing the DOM, which is basically one big global data structure.  Regardless, outside of that, writing side effect free javascript is more natural than the alternative.  hence it's comparison to functional languages like lisp, and my observation that it is more functional than procedural or OO.


> I think a programming language based on XML or JSON would gather significantly more hate and yet is really the same concept.  Using a format for data storage for code is a very ugly thing.

XSL Transforms.

If you use it as a functional language and use it only to manipulate XML documents you'll find it's damned good at what it does.  The biggest issue people have with it is trying to treate it like a procedural language.
Permalink Fake Programmer 
July 14th, 2010 11:49am
"the innovations that they implemented have migrated successfully to more successful languages"

Well you can write a compiler or operating system in basic, but will it scale. No so eventually you have to move to languages more suitable for serious production work.
Permalink CC 
July 14th, 2010 4:37pm
Why JS is object oriented.

First, I think some confusion comes from people thinking that C++ is in any way OO. C++ is one of the least OO languages in existence. It's just not OO in any meaningful or practical way.

JS you can pass an object to someone. You don't have to say what it is, and no header file is needed. It doesn't need to inherit from anyone. The recipient can say "does this have a method called eat? it does? Ok, I will feed it then".
Permalink CC 
July 14th, 2010 4:42pm
C++ supports OO in the same manner that javascript supports OO.  ie, they're multi-paradigm languages.

It's easy to point to a language and claim any language that doesn't act exactly like it isn't really "OO".  It's also easy to be wrong.
Permalink Fake Programmer 
July 14th, 2010 5:09pm
Wrong.
Permalink CC 
July 14th, 2010 7:04pm
English really is a stupid language.

Instead of easy to understand:

リスプが好きです。

You have this flat left to right logic where you need a verb and a subject:

I like Lisp.

The first is definitely more readible and it reads like we think of the logic

-- 
Or maybe your versatility showed its limits?
Permalink Send private email Ax 
July 15th, 2010 4:19am
YENS ATNY OTE MHO CDOENS NOW LUV LISYP OBVIOUSLY IS NOT ELITE ENUF
Permalink CC 
July 15th, 2010 5:11am
"Flat left to right order" seems pretty simple and straight-forward to me.
Permalink SaveTheHubble 
July 18th, 2010 5:43pm
>> SaveTheHubble

You're obviously not Japanese…
Permalink Send private email Ax 
July 21st, 2010 2:33am
"Fortunately, few fans of lisp have ever contributed anything of consequence so this is not much of an issue."

http://www.itasoftware.com/
Next time you book a flight in the US, check if they use ita's software, and btw, google bought them recently.

Viaweb (now known as Yahoo! stores)
written in lisp originally, yahoo decided to re-write it cause they had idiots like CC working there.

http://www.naughtydog.com/
Wrote Crash Bandicoot in GOAL (Game oriented assembly language, a lisp). Bought by Sony, people like CC get involved, and the studio has to start using c++.

http://www.flownet.com/gat/jpl-lisp.html
NASA, Remote Agent
"Remote Agent (remote intelligent self-repair software)(RAX), developed at NASA Ames Research Center and JPL, was the first artificial intelligence control system to control a spacecraft without human supervision"
Written in lisp, but once again idiots like CC get involved and can't see past the parenthesis.

I'd list more, but its late :-)
http://xkcd.com/386/

I believe you sir, should be kept "be kept far far away from software development".
Permalink antiCC 
July 21st, 2010 3:14am

This topic is archived. No further replies will be accepted.

Other topics: July, 2010 Other topics: July, 2010 Recent topics Recent topics