Live data from Hacker News

The Nature of Lisp

defmacro.org

31–40 of 82 posts

Re: The Nature of Lisp

#31
post #9

Very good article, though I doubt it'll convince the usual mass of unbelievers. (I love Lisp, for the record, though my primary exposure has been through Emacs Lisp - so shoot me). A really great book that helps you get appreciate the concepts in Lisp, without really talking about Lisp directly too much, is "Patterns of Software" by Peter Gabriel. http://amzn.to/TxDKGG I found it to be a very enlightening read. Defin…

For whatever it's worth, this article actually convinced me to take plunge when I first encountered it.

Re: The Nature of Lisp

#32
It would seem to me that some variety of Lisp would be the ideal candidate as a sort of runs-everywhere language, a thin portable base language that runs on top of different runtimes, offering easy integration with whichever it is running on.

Basically, something like a minimalist Clojure but not just for Java. It would be able to run atop the CLR, JavaScript or the Objective-C runtime as well. The interface with the host platform may be different, as long as the core language works everywhere. Ideally the core would be tiny.

Re: The Nature of Lisp

#33
post #28

Earlier quoted context omitted.

> There's no way to abstract out that pattern in Python. I'm sure there are macros that can't be abstracted out in Python but this isn't one of them: from contextlib import contextmanager @contextmanager def temp_assign(obj, attr, val): old_val = getattr(obj, attr) setattr(obj, attr, val) yield setattr(obj, attr, old_val) class X: pass x = X() x.a = 1 with temp_assign(x, "a", 2): print x.a # prints 2 print x.a # prin…

Cool, I didn't know that could be done. Can it work for global and local variables as well?

You can do anything you want with a context manager, it's just Python. IIRC, they were first added to the language to get rid of boilerplate while acquiring/releasing locks to make multi-threading easier.

Re: The Nature of Lisp

#34

Part of the problem is that lisp evangelism sets itself up to fail. An instantaneous blinding moment of enlightenment, would you like fries with that? Haven't they heard that you shouldn't start a joke with "This is the most hilarious thing ever"? I've been doing lisp for several years now. I've built several interpreters. I've never had the enlightenment he describes. The minor epiphanies have been on par with oo de…

Enlightenment epiphanies result in proselytizing. Can't be helped, its like tapping your knee with a rubber mallet makes your leg kick out.

The 'secret' or the thing that most people don't get early on when programming, is that code is data and data is code. A binary tree is data that is carefully surrounded by the semantics of the data's relationship with its peers. Reading the structure reads out the data in sorted order. Lisp just makes that painfully clear, that there is no distinction between state and semantics as far as computers are concerned and it allows you to move the 'computation' between data structures and algorithm at any point.

A grad student at USC explained it well when he described it like learning your third or fourth spoken language, Suddenly you brain "flips" from having three or four different ways of naming 'milk' into a single concept of milk with an infinite number of ways to identify it. The relationship between the root concept and the expression of that concept change precedence in your thought process.

Once you have made that switch you can write code in any computer language.

Re: The Nature of Lisp

#35

It would seem to me that some variety of Lisp would be the ideal candidate as a sort of runs-everywhere language, a thin portable base language that runs on top of different runtimes, offering easy integration with whichever it is running on. Basically, something like a minimalist Clojure but not just for Java. It would be able to run atop the CLR, JavaScript or the Objective-C runtime as well. The interface with the…

Forth.

Constructing the basic machine is trivial, then the rest just comes along with it.

Re: The Nature of Lisp

#36

Part of the problem is that lisp evangelism sets itself up to fail. An instantaneous blinding moment of enlightenment, would you like fries with that? Haven't they heard that you shouldn't start a joke with "This is the most hilarious thing ever"? I've been doing lisp for several years now. I've built several interpreters. I've never had the enlightenment he describes. The minor epiphanies have been on par with oo de…

Enlightenment epiphanies result in proselytizing. Can't be helped, its like tapping your knee with a rubber mallet makes your leg kick out. The 'secret' or the thing that most people don't get early on when programming, is that code is data and data is code. A binary tree is data that is carefully surrounded by the semantics of the data's relationship with its peers. Reading the structure reads out the data in sorted…

Very nicely put. imho, it could serve as the tl;dr for the op, which was also excellent.

Re: The Nature of Lisp

#37
post #4

Earlier quoted context omitted.

Yes, for me the first time I read about the lisp syntax I was thinking: "oh cool, it makes (+ 2 2) exactly equivalent to the syntaxic tree + / \ 2 2 " But I don't find it particularly enlightening and I still don't see what cool stuff you can do with macros that you can't do elsewhere.

If you've ever used C#, imaging being able to implement LINQ in pure C# (as in, it's not part of the language, but the language itself gives you the ability to add it with the exact same syntax as it exists as part of the language). That is what macros give you. You can extend the language's syntax to your liking. If you haven't used LINQ, then I'd have a hard time thinking of another example, since most languages ha…

Although LINQ is basically pure syntatic sugar. I actually prefer the method syntax as it's consistent with the rest of the language. Extension methods are all that is needed for it.

http://msdn.microsoft.com/en-us/library/bb397947.aspx

Re: The Nature of Lisp

#38

It would seem to me that some variety of Lisp would be the ideal candidate as a sort of runs-everywhere language, a thin portable base language that runs on top of different runtimes, offering easy integration with whichever it is running on. Basically, something like a minimalist Clojure but not just for Java. It would be able to run atop the CLR, JavaScript or the Objective-C runtime as well. The interface with the…

So something like Clojure, but that runs on the CLR and Javascript as well?

CLR - https://github.com/richhickey/clojure-clr JS - https://github.com/clojure/clojurescript Python - https://github.com/halgari/clojure-py Lua - https://github.com/raph-amiard/clojurescript-lua C - https://github.com/schani/clojurec

(Sorry, couldn't resist.)

Re: The Nature of Lisp

#39
post #3

To understand Lisp is to understand interpreters. With that understanding you can create domain specific languages which is extremely powerful. But I wouldn't recommend using Lisp itself.. macros in particular are unhygienic.

then, here's an old classic for you: https://groups.google.com/forum/?fromgroups#!msg/comp.lang.l... ;)

Re: The Nature of Lisp

#40
post #19
post #9

Very good article, though I doubt it'll convince the usual mass of unbelievers. (I love Lisp, for the record, though my primary exposure has been through Emacs Lisp - so shoot me). A really great book that helps you get appreciate the concepts in Lisp, without really talking about Lisp directly too much, is "Patterns of Software" by Peter Gabriel. http://amzn.to/TxDKGG I found it to be a very enlightening read. Defin…

Richard Gabriel. Though Peter Gabriel would be good too :)

It would be weird to have Peter Gabriel write about software. My favorite book of his is http://books.google.com/books/about/Introduction_to_Algebrai...
Post reply on HN