Live data from Hacker News

Alan Kay on Lisp

quora.com

91–100 of 207 posts

Re: Alan Kay on Lisp

#91
post #89

Earlier quoted context omitted.

> more rigorously enforced at compile time 'Compile time', like everything in the artificial science of computing, is a made up thing. We might reconsider if it's a useful idea to keep. Why must there be a specific point in time, when we verify interconnections within a little bundle of code, but later when the bundle of code integrates with a larger system we are completely fine with very different, loosely coupled…

"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.)

Re: Alan Kay on Lisp

#92
post #85

Earlier quoted context omitted.

gcc’s IR, “GIMPLE”, is also commonly printed in s-expression form.

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?

Re: Alan Kay on Lisp

#93
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?

> How is Haskell a Lisp?

... both communities care a lot about rose trees?

Re: Alan Kay on Lisp

#94
post #57
post #10

A similar recent answer on Smalltalk: https://news.ycombinator.com/item?id=15518746 .

Well, there are surprisingly few CS graduates who actually understand Object Oriented Programming as Alan Kay designed it for Smalltalk, which in turn lowers the probabilty that any of them will build a qualitatively better language. I mean there are a lot of other skills a programmer needs to have than to understand what OOP is, but sometimes I think it would be better if more young students would learn Smalltalk to…

OOP was taught to me using Smalltalk (VisualWorks actually). It was a PL class, so it didn’t go deep, including also Lisp, Prolog, and SML.

I wonder, though, how my OOP thinking would differ if my first exposure was through BETA or Eiffel.

Re: Alan Kay on Lisp

#95
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.)

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 relationships are those between sets.

It is the Curry-Howard isomorphism (https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...) which defines the correspondance between types in computer science and mathematics.

This is "static" only because the "dynamic" alternative isnt really an alternative at all, and really just a different kind of thing all together.

Re: Alan Kay on Lisp

#96

This is really well written and seems to agree with the traditional FP lore. I'm curious what led Alan Kay then to OOP in Smalltalk.

The Early History Of Smalltalk is a good discussion of this stuff: http://worrydream.com/EarlyHistoryOfSmalltalk/

A trivial but cute detail is how the author’s email address is specified in this 1993 paper:

kay2@apple.com.Internet#

A year or two later, there would be practically no other email systems than “Internet”.

Re: Alan Kay on Lisp

#97
post #76
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…

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 the function as arguments without first evaluating them. Thus there is no syntax for quoting the list of binding forms. At runtime, a function invocation passes the rest of the form to the function as arguments but will evaluate all arguments before doing so. Knowing what is and isn't a macro is a bit tricky in some lisps (and in others there are sigils, reified tables listing the macro symbols, or metadata to let you know what you're dealing with).

The only distinct syntax elements you provided are:

    quote - 'small
    strings - "hi"
    function call - (function arg0 arg1 argN)
    dotted pair - (datum . 10)
    sharp dispatch - #%datum
Lisps do have syntax. Some provide notations for alternate data types like keywords or fixnums; data structures other than lists like hashes, sets, vectors, etc; or ways of dispatching at read-time. It is worth pointing out that all of the things you mentioned as syntax (which certainly are syntax in most other languages) are merely function calls in lisp.

[0] There isn't a significant difference between a macro and a special form here. One is looked up in the application or prelude and is written in lisp, the other is provided by the compiler and possibly not written in lisp.

Re: Alan Kay on Lisp

#98

Earlier quoted context omitted.

smalltalk cutest feature is the named parameter syntax trick (I don't like tricks but let's make an exception). make-range from: 10 to: 20 calss (make-range.from:to 10 20) or something similar. Free nanodsls smalltalk simplicity lies in that the metamodel is actually human reasoning friendly, even while dynamic, you have a clear picture of what's gonna happen in case of errors etc. It didn't please visual age users,…

"smalltalk cutest feature is the named parameter syntax trick..." make-range from: 10 to: 20 calss (make-range.from:to 10 20) or something similar. Free nanodsls For the uninitiated among us, what does that do and what's so magic about it?

It's keywords as sentences. It basically allows a function signature to be spelled out as a sentence with infix operators. These days you can see the lineage of smalltalk in keyword arguments. For example, python vs. smalltalk:

    obj.do_thing("string", with_factor=8, log_to=logger)

    obj do_thing: "string" with_factor: 8 log_to: logger
One of those reads as a sentence a little better. But to be fair python learned this from languages that had already taken this idea from smalltalk.

Like most older languages smalltalk's implementation is more powerful than the bastardization that other languages learned from it. Library interfaces in smalltalk are built around this syntax feature. Note how the function call looks the same as the keyword argument. This shared syntax makes the language read better. It makes function calls and keywords look like a normal infix language (e.g. the math expressions in most languages). Where parens are used like any other infix language (rather than be overloaded for function calls):

    (obj do_thing: "string" with_factor: 8) log_to: logger
would then call ".log_to(logger)" on the result of the parenthesized expression. The same way in (2 + 4) * 5 multiplies the result of the parens by 5. A single syntax structure for all these concepts - rather than mixing multiple syntax - allows it to express new ideas in the same syntax as everything else. Like lisp does.

Re: Alan Kay on Lisp

#99
post #42

Earlier quoted context omitted.

There are also plenty of Lisp programmers that think that it's a real tool to solve real problems, not just an educational oddity. There are a bunch of Lisps out there, and plenty of them are by no means toys. My laptop's initial RAM disk and init system are Scheme programs.

And it's not a Lisp per se, but WebAssembly's text format uses s-expressions[0]. It's likely that the "oddity" of Lisps will seem less odd as adoption increases if they stick with that. [0] https://developer.mozilla.org/en-US/docs/WebAssembly/Underst...

I had no idea they did that! Thanks!

I was just thinking this morning about making Arc work in web assembly sometime.

Re: Alan Kay on Lisp

#100

Earlier quoted context omitted.

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

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

Post reply on HN