Ask HN: Could a Lisp be Blub?
1–10 of 30 posts
Re: Ask HN: Could a Lisp be Blub?
#2Re: Ask HN: Could a Lisp be Blub?
#3Who a language "caters to", who an "average" programmer is, and who a "hacker" is are all social constructs which have no relationship to the objective reality of what features are in a language. People who wish to assert their superiority are quite willing to do so regardless of the technical merits of the matter.
Thus, rather than wasting one's time with meaningless geek-on-geek pissing matches, you should probably just get back to writing software which solves problems for people. You can do that in most languages -- even in Lisp.
Re: Ask HN: Could a Lisp be Blub?
#4Re: Ask HN: Could a Lisp be Blub?
#5Could a language ... cater to average programmers and be despised by hackers? Who a language "caters to", who an "average" programmer is, and who a "hacker" is are all social constructs which have no relationship to the objective reality of what features are in a language. People who wish to assert their superiority are quite willing to do so regardless of the technical merits of the matter. Thus, rather than wasting…
"Blub" is just a derogatory word for "you only know one programming language". Become fluent in a bunch of them, and then you have the information you need to make your own conclusion.
As you write more and more of your own software, you'll see what features make that easy for you. You'll also see what features you can live without. You might even come up with ideas for new language features, and you'll see the value of being able to implement new language features without writing a new language. Very meta, but everything is related...
Re: Ask HN: Could a Lisp be Blub?
#6Could a language ... cater to average programmers and be despised by hackers? Who a language "caters to", who an "average" programmer is, and who a "hacker" is are all social constructs which have no relationship to the objective reality of what features are in a language. People who wish to assert their superiority are quite willing to do so regardless of the technical merits of the matter. Thus, rather than wasting…
Re: Ask HN: Could a Lisp be Blub?
#7Re: Ask HN: Could a Lisp be Blub?
#8Then there are languages that try to be even more powerful than Haskell, for example Epigram, which has dependent types.
Lazy evaluation is probably the language feature that is most mainstream that lisp lacks. For those not familiar with the abstraction benefits of lazy evaluation, consider a library for dealing with prime numbers. In a language without lazy evaluation, you are going to need an API with a function for getting the n_th prime number, a function for testing if a number is a prime number, a function for getting the smallest prime number larger than the number x, and a bunch of other functions.
In Haskell, the API only needs a single variable, called "primes" that is simply the infinite list of all the prime numbers:
primes :: [Integer] -- primes is of type list of Integer
Thanks to lazy evaluation, this single variable is all that is needed to support all of the above operations in an efficient way. For example, to get the n_th prime number you simply write (primes !! n)
Now, this may look cool, but what does it have to do with abstraction? Since "primes" is a regular list, I can use it with any list function and build more complex things out of it. I can also have a list of all the catalan numbers in the same way, and all my functions that I've written that do cool things with the prime numbers can now be instantly used against catalan numbers.
You can manually do lazy evaluation in languages that don't natively have it, but unless you do it everywhere you won't get the abstraction benefits, and if you do do it everywhere then the compiler almost certainly will not be able to optimize it as well as a native implementation.
Re: Ask HN: Could a Lisp be Blub?
#9Now obviously we can argue about how to define "powerful", and the whole discussion can easily become another pointless language flamewar. But let's not do that. Let's provisionally grant the essay its definition of "powerful" and the corollary that Lisp macros are currently the apex of that power. The question is, is a more powerful (in this sense) language possible? (You don't have to agree with that definition of "powerful" to find the question interesting, by the way. Just rephrase it as, could another language beat Lisp at its own game?)
In my mind I've always referred to the above argument rather pompously (i.e. half-jokingly) as "Graham's Thesis" (because it reminds me of what used to be called Church's Thesis when I studied logic - it's a non-provable-because-non-formal assertion that expresses an intuition about something - in that case computability, in this case programming languages). We can state Graham's Thesis as: Any programming language that's as powerful as Lisp is isomorphic to Lisp.
So, is this true? The critical thing is code=data. Is there a fundamentally non-Lispy way to represent code as data, that's as good or better for programming than sexps? (That qualifier is important, because there are definitely ways to represent code as data that make a lousy notation for programming, e.g. machine language.) If there is such a representation, then a language based on exposing it as notation could be as powerful as Lisp without being Lisp. But if there isn't, then variations of sexps are the only game in town, and those don't count as new languages. Replacing parentheses with different brackets, as was suggested here either trollingly or stupidly the other day, doesn't cut it.
As anyone who's seen a Lisp program and knows the first thing about a compiler knows, sexps are just the simplest notation for a syntax tree. That is, the thing that parsers turn programs in other languages into, Lisp programs just are. That makes sense, because parsers turn source code into data, and Lisp programs just are data. And any language in which you write programs as parse trees is Lisp (or will soon become Lisp as people add the obvious things you'd want in such a language).
So Graham's Thesis (man I feel silly writing that) reduces to the following: the only representation of programs suitable as both a data structure and a notation for human programmers is the syntax tree.
I'd really like to know if this is true. (Apologies to anyone who read my comment on this here the other day, as I'm repeating myself.) What languages are there whose source code gets turned into something that is fundamentally not a syntax tree? And what would the simplest explicit notation for that structure look like? I think this would be the area in which to look for an answer to the question.
There's one thing that makes me think such a representation might not exist: sexps are really just function composition, and function composition is how humans have done math for a long time. But if one does exist, I'd like to see it. There are a lot of people here with much wider backgrounds in programming languages than mine, so perhaps someone can just answer this.
Re: Ask HN: Could a Lisp be Blub?
#10There are languages that have useful features that lisp lacks. For example, Haskell has lazy evaluation and automatic compiler generated program correctness proofs (a decent type system). Then there are languages that try to be even more powerful than Haskell, for example Epigram, which has dependent types. Lazy evaluation is probably the language feature that is most mainstream that lisp lacks. For those not familia…