Re: Very poor Lisp performance
- From: Ulrich Hobelmann <u.hobelmann@xxxxxx>
- Date: Fri, 19 Aug 2005 20:07:08 +0200
Jon Harrop wrote:
Ulrich Hobelmann wrote:Jon Harrop wrote:Joe Marshall wrote:Infix macros are *hard*.Do you mean it is difficult to implement infix in Lisp?No, others mentioned that *there are* infix parsers (reader macros) for Lisp. Most people don't use them I guess :D
Then why are they "hard"? Perhaps I misunderstood Joe. I thought he meant it was difficult to implement infix operators in Lisp. Now I'm thinking maybe he meant it is easy to implement infix operators but it is then difficult to write macros that use infix syntax?
It's difficult to integrate infix syntax into Lisp. Maybe the best possibility would be to keep the sexp form with its () and whitespace conventions, but keep them as lists to convert to prefix form. That way you could still use macros etc. But again: with n-ary operators prefix makes more sense, and even C, ML, Python ... use prefix for everything except math and iteration constructs (i.e. function calls). Lisp macros for converting infix-math to Lisp exist, but it's not fun to do normal programming that way.
Presumably that is a Lisp-specific problem because Mathematica has no problem using infix notation...
Maybe because math is different. I don't know about Mathematica's macros either...
So Lisp is rather tied to the built-in prefix notation.You need to learn the prefix notation *anyway* (because code that operates on code needs to operate at the abstract syntax level, which in lisp is naturally prefix-notated lists).Not at all. Implement whatever syntax you want. If you don't like Lisp syntax at all use a complete, different syntax (and language) like Dylan.
So you disagree with Joe saying that "lisp is naturally prefix-notated lists". You believe that prefix/infix/postfix makes no difference in Lisp?
No, the language is prefix, but you can easily use (but not integrate) something else in it. Integrating infix with macros and functions in Lisp would be just as hard as integrating macros into other languages (see M4, CPP).
True, an experienced C coder probably doesn't make syntax mistakes, or just ()s the code to be sure. But I feel like in a straight-jacket when coding C. Not because of memory management, but because of syntax (like the inability to use if and switch as an expression, the need to create a named function in order to pass it as a parameter, the awkward syntax for creating structures that I want to pass as arguments...).
Yes. To be fair, you are trying to do functional programming in an imperative language. Most people do the converse, trying to do imperative programming in a functional language. :-)
I'm not even good at FP, I'd say. I don't really use combinator functions, just a function as parameter once in a while, some recursion... But everything just when it's appropriate. It's sad that C gets in the way when you try to express compact, straightforward algorithms in it. Java is hardly better.
-- I believe in Karma. That means I can do bad things to people all day long and I assume they deserve it. Dogbert .
- Follow-Ups:
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- References:
- Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Svenne Krap
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Ulrich Hobelmann
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Förster vom Silberwald
- Re: Very poor Lisp performance
- From: Michael Sullivan
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Hartmann Schaffer
- Re: Very poor Lisp performance
- From: Jamie Border
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Christophe Rhodes
- Re: Very poor Lisp performance
- From: Joe Marshall
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Tayssir John Gabbour
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Joe Marshall
- Re: Very poor Lisp performance
- From: Jon Harrop
- Re: Very poor Lisp performance
- From: Ulrich Hobelmann
- Re: Very poor Lisp performance
- From: Jon Harrop
- Very poor Lisp performance
- Prev by Date: Re: Very poor Lisp performance
- Next by Date: Re: Very poor Lisp performance
- Previous by thread: Re: Very poor Lisp performance
- Next by thread: Re: Very poor Lisp performance
- Index(es):
Relevant Pages
|