PDA

View Full Version : Lisp-style Opinions?



Aparavoid
06-03-2009, 01:55 PM
What is your opinion on Lisp-style syntax? I personally think it is really nice but I can also see both sides.

ಠ_ಠ
06-03-2009, 02:14 PM
(+ 1 2)
is about as sexy as it can get

sean
06-03-2009, 02:16 PM
There's several main things I absolutely love about it, I may edit when I think of others. Being fairly new to Lisp, I still have a hard time reading it very well, but here are my thoughts:

1) It's perfectly consistent. Everything is broken down into a list, or a list of lists, almost like how XML is tags, and tags inside other tags. It's a nice clean way of making complex structures in a consistent way. It's also like OO language where literally EVERYTHING is a first class object: functions, classes, programs, etc... In Lisp, everything is a list (or an atom - a single element list) I like consistency, and I like nested lists.

2) Macros - they're awesome in Lisp. You can have a lot more creativity than you can with macro functions in C, or any other language I've seen.

3) Very easy to implement a whole language - mainly because of the two features above.

4) The ability to execute run-time generated code, and delay evaluation of a list


One thing I don't like about it (and this would depend on the situation) is the amount of abstraction away from the system. I really like the way C (or more specifically the everything-is-a-file philosophy found in some UNIX-based systems) has abstracted things into files, where you can open, close, read from, and write to anything (again - I like consistency). To me, that's the perfect level of abstraction. But programming in Lisp, you don't consider what's happening at the physical/system level, like you do when you work directly with memory and pointers. I've seen Lisp enthusiasts argue that this is a good thing, but it still feels weird to me. I've also heard Lisp enthusiasts argue that this means some Lisp implementations can run faster than C - but I fail to fully understand the arguments there. Also, I don't care for the fact that there's no standard way of working with command-line-arguments, threads, etc... With so many dialects, etc... it's a much more confusing world than "Standard C". If I get serious about one dialect, it'll probably be CMU-CL, where I can still work with UNIX system calls.

CornedBee
06-03-2009, 02:47 PM
I don't like Lisp's uniformness. There is no syntactic distinction between, well, anything. A function definition has exactly the same syntax as a condition handler as an addition. This means that distinction between such concepts is entirely reliant on programmer discipline, a good convention, and familiarity with that convention. The last point makes it hard for beginners to read, the first is simply unrealistic.
Never got into the language, really. I prefer Haskell for my functional needs.

Ronix
06-03-2009, 02:58 PM
The deep nesting of parens is sometimes hard to grok, but otherwise, I love Lisp's regular syntax. I agree with sean in that Lisp macros are one of the most powerful tools in any language, basically allowing you to completely redesign the language (Something that practically requires prefix syntax).

brewbuck
06-03-2009, 02:59 PM
Lisp syntax is very close to the lambda calculus, and that's intentional.

The lambda calculus, being a tool for formal analysis and proof about computation, is probably not the best formalism to describe real world problems. Yet there are quite a few Lisp junkies out there.

I never bothered to learn it beyond a little bit of dabbling in Emacs Lisp. One of these days I'll pick up OCaml or Haskell.