4 ms·
Thanks for all fan love :-) One of the interesting things about LISP is that it's actually a pretty easy language to parse, interpret, and compile. This isn't
by agavin 15y ago
Thanks for all fan love :-)
One of the interesting things about LISP is that it's actually a pretty easy language to parse, interpret, and compile. This isn't actually an accident as the S-expression syntax I'm sure was initially chosen for it's machine regularity (in those early days of underpowered machines). Newer languages are syntactically much more complicated. Ironically most normal programmers, being human, seem to find the more complicated syntax easier and the "simple" S-expression syntax confusing (being backward much of the time to normal human convention). I always found it unambiguous, but go figure. It's also precisely this regularity that makes the awesome macrology of LISP possible. In Ruby you can manually build up strings and feed them into the interpreter, which is equivalent to simple backquote. But you can't do the kind of cool nested constructions that are trivial in LISP.
- kamaal 15y agoIts really not about the syntax. Its about writing in AST. Availability of large set of libraries. And especially I find it very difficult to use it for my day to day uses(Places where I use Awk, sed and Perl) or in other words everyday practical needs. I still don't know How to start learning lisp as a beginner and use it for my day to day needs? I don't think anybody today has the time to study the science behind lisp and then see where its useful to them. We want some thing that we can browse through and straight away go and use now! Is there a recipe book?
- KaeseEs 15y agoI don't know about recipe books, but for a general introduction I've found Conrad Barski's _Land of Lisp_ to be very good and loads of fun, although the commentary gets a little triumphalist at times. You can grab it through NoStarch or Amazon iirc.
- Davertron 15y agoPractical Common Lisp (http://www.gigamonkeys.com/book/ http://www.gigamonkeys.com/book/) by Peter Seibel is an awesome book and free online.
- jules 15y agoIf you want to learn Lisp from a more practical perspective, you should probably learn Racket or Clojure. Racket comes with excellent tutorials and documentation as well as an IDE with debugging, REPL, etc. You can read How to Design Programs to learn the basics of Racket (Racket started out as Scheme and still contains an implementation of standard Scheme). Clojure is an even more practice oriented Lisp. It is a bit harder to set up and get started with, but there are books on Clojure, e.g. Programming Clojure and The Joy of Clojure. Compared to Clojure, Racket is a bit more academic and has many advanced language features like contracts and first class modules, but is also has a good standard library. Clojure's strong points are functional data structures, concurrency and using generic operations (meaning that you don't end up with vector-ref and list-ref and hash-ref, but just a single function to index into anything). Clojure's syntax is also a bit terser. If you then decide you want to learn Lisp more deeply: How to Design Programs is a book that teaches basic Scheme programming. It is oriented towards beginners, so if you want to understand recursion, higher order functions and data structures this book is for you. Conversely, if you already understand those things, this book is not for you. http://www.htdp.org/2003-09-26/Book/curriculum.html http://www.htdp.org/2003-09-26/Book/curriculum.html Structure and Interpretation of Computer Programming is a more advanced and probably challenging book that goes through all aspects of recursion, data structures, symbolic mathematics, generic operations & implementing an object system in Scheme, continuations, writing a Scheme interpreter, writing a Prolog interpreter, and writing a hardware simulator and a compiler that compiles Scheme to that hardware's assembly language. http://mitpress.mit.edu/sicp/full-text/book/book.html http://mitpress.mit.edu/sicp/full-text/book/book.html While Structure and Interpretation of Computer Programming all about code=data, it doesn't actually teach you about macros. For that you could read Paul Graham's On Lisp, which is essentially a whole book on macros. It is a good book to learn about macros which are useful in any Lisp but it uses Common Lisp which I'd not advice using.
- DanielRibeiro 15y agoBut you can't do the kind of cool nested constructions that are trivial in LISP. In ruby you can[1] do this, and in python more natively[2]. It is not pretty though. [1] http://bit.ly/sVYe8l http://bit.ly/sVYe8l [2] http://docs.python.org/library/ast.html http://docs.python.org/library/ast.html
- draegtun 15y agoAnd in Perl you can use Devel::Declare - https://metacpan.org/module/Devel::Declare https://metacpan.org/module/Devel::Declare