Live data from Hacker News

Alan Kay on Lisp

quora.com

101–110 of 207 posts

Re: Alan Kay on Lisp

#101
post #67
post #62

Earlier quoted context omitted.

I've long desired a strongly-typed s-expression syntax that has the power of Haskell or Idris, but still looks and feels like the blank canvas that is Lisp.

https://github.com/lexi-lambda/hackett https://lexi-lambda.github.io/blog/2017/05/27/realizing-hack...

Thanks!

Re: Alan Kay on Lisp

#102
post #53

Actually, I am missing the simplicity of Lisp and Smalltalk in todays languages. From what I remember, they both have a fairly simple but universal syntax, which can be written for Lisp as ([operator] [argument1] [argument2] [argumentN]) and for Smalltalk as [object] [message] So far I haven't seen anything like that for languages with the C-like syntax. Don't get me wrong. For example I love Go, but sometimes I miss…

Ruby is nice for this. It has message-passing OO and clean, minimal syntax.

Re: Alan Kay on Lisp

#103
post #5

it is the man himself :), and ofcourse, this p.o.v is worth 80 IQ points. this insight is 'One of our many problems with thinking is “cognitive load”: the number of things we can pay attention to at once. The cliche is 7±2, but for many things it is even less. We make progress by making those few things be more powerful.' just beautiful

It's probably more literally true than he intended. And 7 isn't really a cliche; it's not an opinion but a thoroughly proven, universal limitation of human working memory.

Before the advent of cheap writing instruments, and especially cheap printing, we used poetry to almost effortlessly recall and communicate large working sets of data, privately or in discourse. With poetry and similar mnemonic devices people memorized volumes of information. A student or scholar in ancient Greece would have literally memorized all the classics. Someone like Cicero would write a speech of 5,000 to 10,000 words and then, a few days later, deliver it nearly verbatim from memory. The dominate form of mass communication was through open speeches, and this is why most of the great speeches came from the ancient world. But it was limited; recalling and sharing was easy, but memorizing was still laborious, notwithstanding the fact that ancient scholars' memorization faculties seem like super powers to modern humans.

With the advent of cheap writing and printing, we were able to archive, recall, and disseminate magnitudes more information at a more rapid pace. And while slower to recall, speed of creation and dissemination, and sheer volume more than made up for that limitation. Moreover, mass communication proved far more efficient in written form.

Today computers are killing writing just as writing killed poetry. But it's not really computers, per se. With writing it was the system of creating and using written works (alphabets, printing presses, libraries) that actually realized the efficiency gain. In Alan Kay's view, Lisp is what made the promise of computers realizable, capable of supplanting the dominant form of "thinking" and of opening up new frontiers. Computers are like papyrus; it's learning how to use them that matters, and Lisp was that great leap. It's one thing to laboriously write a program using machine code; it's something else entirely to do this using an elegant, higher-order programming language. Indeed, once you use that higher-order language you can't go back; it changes how you think about programming, including how you structure programs written in machine code. Like with poetry and writing the utilitarian leap in productivity is forgotten because it becomes so effortless and seemingly obvious; instead all you see are the limitations and faults.

Re: Alan Kay on Lisp

#104
post #89

Earlier quoted context omitted.

"Compile time" is artificial, but the difference between static and dynamic is natural (in some sense, I realize these words are quite slippery). It emerges from the underlying mathematics. There's a real difference between correctness properties that I can prove without running my program and correctness properties that will introduce failures at runtime.

> It emerges from the underlying mathematics. Which mathematics? (Lisp has its own math, for instance.)

Very fundamental ideas around computability, or total vs partial functions. There are some correctness properties that we can prove without running the underlying program, such that we can always accept or reject a given program. None of this is particular to lisp.

Re: Alan Kay on Lisp

#105
post #29

There seem to be two big camps that preach a "learn this weird new programming paradigm because it'll help you see things from a new perspective and will make you a better engineer" message: the lispy languages, and the ML-like languages. Both of these languages categories give you functional programming as well as metaprogramming, which is great. Having tried both, I've found that the ML-derived languages tend to ha…

"Having tried both, I've found that the ML-derived languages tend to have a stronger type system that's more rigorously enforced at compile time. I personally find this much more valuable in practice than some of the dynamic magic that you can do with lisp." You probably meant to contrast ML's static typing (not strong typing) with Lisps's dynamic typing. See "What To Know Before Debating Type Systems" : https://cdsm…

Sure, I meant static types + Hindley-Milner type inference, leading to a "type system that I like and feel comfortable with" (per your link), i.e. a stronger type system.

Re: Alan Kay on Lisp

#106
post #100

Earlier quoted context omitted.

What on earth are you talking about? > The internet is dynamically typed. That's an incoherent claim. Dynamic typing is where types belong to values. Static typing is where they apply to terms. Really to call the former "typing" is misnomer. It's an abuse of the word "type" to mean "memory mode". It has not much relationship to typing in the logic/math/philosophy of logic sense in which types are sets and type relati…

This crosses into incivility. That breaks the site guidelines. Please re-read them and don't do that when commenting here. https://news.ycombinator.com/newsguidelines.html

I'm not sure how this is incivil?

The claim is logically incoherent: typing cannot be a property of the internet, in the same way tuesday cannot be pink nor can addition sound terrifying.

The claim is a category error: the internet cannot posses such a property.

In addition, to say, of something, that it is " is a made up thing " is a degree of hubris that is presumably reasonably met by being perplexed at overconfidence of the claim posed with such little correct information.

Is being perplexed more uncivil than hubris? Are we really policing people's language to this minute degree?

Re: Alan Kay on Lisp

#107
post #97
post #76

Earlier quoted context omitted.

Lisp, Scheme, and Racket and related languages have many distinct syntax forms, just like other languages. The syntax forms appear visually similar due to the use of parentheses, but the forms themselves are distinct. For example, here are some of the distinct syntax forms in Racket (Scheme): (+ 3 4) # Procedure call (lambda (x) (+ x x)) # Lambda expression # See also case-lambda (let ((x 23) (y 42)) # Variable bindi…

Actually, almost of those are just function calls. Some of them happen during the compile phase, some during runtime. Things that happen at compile-time, say a let function call[0] e.g. (let ((x 23) (y 42)) (+ x y)) will return data as a return and compilation will continue (or stop because some sort of error/exception occurs). The important bit is at compile-time, a function invocation passes the rest of the form to…

Most of the examples I gave above are core syntax forms. They are defined in the language grammar and are not function calls or macros. See the Racket language reference [0]:

> A core syntactic form[] is parsed as described for each form in Syntactic Forms. Parsing a core syntactic form typically involves recursive parsing of sub-forms, and may introduce bindings that determine the parsing of sub-forms.

  top-level-form = general-top-level-form
   	 | (#%expression expr)
   	 | (module id module-path
             (#%plain-module-begin module-level-form ...))
   	 | (begin top-level-form ...)
   	 | (begin-for-syntax top-level-form ...)
  
 general-top-level-form = expr
   	 | (define-values (id ...) expr)
   	 | (define-syntaxes (id ...) expr)
   	 | (#%require raw-require-spec ...)
  
 expr =  id
   	 | (#%plain-lambda formals expr ...+)
   	 | (case-lambda (formals expr ...+) ...)
   	 | (if expr expr expr)
   	 | (begin expr ...+)
   	 | (begin0 expr expr ...)
   	 | (let-values ([(id ...) expr] ...)
             expr ...+)
   	 | (letrec-values ([(id ...) expr] ...)
             expr ...+)
   	 | (set! id expr)
   	 | (quote datum)
   	 | (quote-syntax datum)
   	 | (quote-syntax datum #:local)
   	 | (with-continuation-mark expr expr expr)
   	 | (#%plain-app expr ...+)
   	 | (#%top . id)
   	 | (#%variable-reference id)
   	 | (#%variable-reference (#%top . id))
   	 | (#%variable-reference)
See section 1.2.3.2 which specifies the expansion steps. Note that the expansion model differentiates between handling transformers aka macros and core syntax forms.

To be fair, it seems that Scheme (R5RS) considers some of these forms to be "derived expression types" and specifies their definition using `define-syntax` [1]. However, its core syntax forms still include the following [2]:

  expression = variable
    | literal
    | procedure call
    | lambda expression
    | conditional
    | assignment
    | derived expression
    | macro use
    | macro block
... and there's a whole sub-grammar for specifying transformers (macros):

   =
      (syntax-rules (*) *)
   = ( )
   = 
     | (*)
     | (+ . )
     | (*  )
     | #(*)
     | #(*  )
     | 
   = 
     | 
     | 
     | 
   = 
     | (*)
     | (+ . )
     | #(*)
     | 
   = 
     |  
Being able to write or evaluate Scheme fully requires an understanding of all of these distinct syntax forms.

[0] https://docs.racket-lang.org/reference/syntax-model.html#%28... [1] http://www.schemers.org/Documents/Standards/R5RS/HTML/ [2] http://www.schemers.org/Documents/Standards/R5RS/HTML/

Re: Alan Kay on Lisp

#108
post #92
post #85

Earlier quoted context omitted.

As is LLVM's. I think JVM's might be too, but not 100% sure. Haskell is also pretty much just a lisp with a whole lot of sugar added on.

How is Haskell a Lisp? To me, a Lisp pretty necessarily needs to treat the structure of its code as mutable data, which seems kind of incompatible?

The evaluation model of both is quite similar though (reduction), and you can see it in the similarities between Core Haskell and Core Scheme.

AFAIK, there are very few truly built in types in Haskell. Most everything can be built out of data constructors and functions. That idea of many things being in language user space is pretty Lisp-y IMO.

Re: Alan Kay on Lisp

#109
post #14

I'm always blown away by how crisply is Alan Kay able to put complex thoughts into words. I feel that the level of clarity I can achieve on the scale of a sentence or two he can achieve on the scale of several paragraphs.

Counterpoint: The words he says are nice, and his depth of knowledge is profound, but he hasn't actually provided any evidence making the case that lisp is better and/or in what scenarios it is better. That this sort of rhetoric is the way almost all programmers and language designers try to find truth and communicate ideas is probably why we ended up all programming in javascript. We have no rigor, we are like Freud…

Yes. It’s similar to the difference between a mechanic and an engineer: a mechanic figures out something works, but the engineer can then take the next step to discover/know how. If someone cannot articulate or identify advantages, then they are pushing unproven, possibly wrong “religious” beliefs like a “mechanic.” Zealous communinal reinforcement is political, Macaroni and silly when there are no convincing arguments other than “because it’s new” or “because.”

Re: Alan Kay on Lisp

#110
post #92
post #85

Earlier quoted context omitted.

As is LLVM's. I think JVM's might be too, but not 100% sure. Haskell is also pretty much just a lisp with a whole lot of sugar added on.

How is Haskell a Lisp? To me, a Lisp pretty necessarily needs to treat the structure of its code as mutable data, which seems kind of incompatible?

No, it actually doesn't; that is a common misconception.

Lisp images can modify themselves at run-time by replacing global function bindings with new functions, not by mutating code.

Lisp macros must not in fact mutate the incoming source code which they transform.

Post reply on HN