Live data from Hacker News

Lisp from Nothing, Second Edition

t3x.org

11–20 of 109 posts

Re: Lisp from Nothing, Second Edition

#11
tug2024 wrote: > Doesn’t lisp extend lambda calculus (abstraction . application)? As a consequence, lisp (abstraction . application . environment)!

Another valid question downvoted into oblivion.

The environment in (lexically scoped) LISP is an implementation detail. Lambda calculus does not need an environment, because variables are substituted on a sheet of paper. So lambda calculus equals lexically scoped LAMBDA in LISP.

Sure, you could view LISP as LC plus some extra functions (that are not easily implemented in LC).

Re: Lisp from Nothing, Second Edition

#12
post #9

Looking at file church.scm from the provided zip file [1], I see the following functions used to construct lists: (define kons (lambda (x) (lambda (y) ((pair false) ((pair false) ((pair x) y)))))) (define kar (lambda (x) (first (second (second x))))) (define kdr (lambda (x) (second (second (second x))))) (define nil ((pair true) ((pair true) false))) (define null first) (define atom (lambda (x) (first (second x)))) T…

But then (ATOM NIL) is neither TRUE nor FALSE.

Re: Lisp from Nothing, Second Edition

#13
post #3

Second edition, with a new chapter on lambda calculus.

Thanks. I recently had to reinvent LISP to script my CRDT database. That was not much work, because I already had the notation (I use RDX, a JSON superset with CRDT types). Still, I stumbled at the idiosyncratic LISP bracketing. Luckily, RDX allows for different tuple notations. So, I styled it to look less alien to a curly-braced developer. Like this https://github.com/gritzko/go-rdx/blob/main/test/13-getput.j... Fo…

Yes, and it has never stuck. Even the great John McCarthy, the very creator of Lisp, couldn't manage it: https://en.wikipedia.org/wiki/M-expression>.

Re: Lisp from Nothing, Second Edition

#14
As somebody who read a couple of the author's books, and also somebody who spent almost a decade studying compilers, I am genuinely curious about the author himself.

These works are something I both understand and would never achieve myself. These are cultural artifacts, like deeply personal poetry, made purely for the process of it. Not practically useful, not state of the art, not research level, but... a personal journey?

If the author is reading this... can you share your vision? Motivation?

Re: Lisp from Nothing, Second Edition

#15

As somebody who read a couple of the author's books, and also somebody who spent almost a decade studying compilers, I am genuinely curious about the author himself. These works are something I both understand and would never achieve myself. These are cultural artifacts, like deeply personal poetry, made purely for the process of it. Not practically useful, not state of the art, not research level, but... a personal…

I second this, would be great if someone did a long form video interview with the author.

Re: Lisp from Nothing, Second Edition

#17
post #3

Second edition, with a new chapter on lambda calculus.

Thanks. I recently had to reinvent LISP to script my CRDT database. That was not much work, because I already had the notation (I use RDX, a JSON superset with CRDT types). Still, I stumbled at the idiosyncratic LISP bracketing. Luckily, RDX allows for different tuple notations. So, I styled it to look less alien to a curly-braced developer. Like this https://github.com/gritzko/go-rdx/blob/main/test/13-getput.j... Fo…

I sometimes wonder if the issue is really the parentheses or the ease of nesting. In LISP it’s natural to write (f (g (h x))). Whereas most people are used to. a = h(x); b = g(a); c = f(b);

In C/C++ most functions return error codes, forcing the latter form.

And then there are functional languages allowing: x -> h -> g -> f but I think the implicit parameter passing doesn’t sit well with a lot of programmers either.

Re: Lisp from Nothing, Second Edition

#18
post #3

Second edition, with a new chapter on lambda calculus.

Thanks. I recently had to reinvent LISP to script my CRDT database. That was not much work, because I already had the notation (I use RDX, a JSON superset with CRDT types). Still, I stumbled at the idiosyncratic LISP bracketing. Luckily, RDX allows for different tuple notations. So, I styled it to look less alien to a curly-braced developer. Like this https://github.com/gritzko/go-rdx/blob/main/test/13-getput.j... Fo…

https://en.wikipedia.org/wiki/Apple_Dylan

Re: Lisp from Nothing, Second Edition

#19
post #9

Looking at file church.scm from the provided zip file [1], I see the following functions used to construct lists: (define kons (lambda (x) (lambda (y) ((pair false) ((pair false) ((pair x) y)))))) (define kar (lambda (x) (first (second (second x))))) (define kdr (lambda (x) (second (second (second x))))) (define nil ((pair true) ((pair true) false))) (define null first) (define atom (lambda (x) (first (second x)))) T…

But then (ATOM NIL) is neither TRUE nor FALSE.

I forgot to add the atom boolean to the nil representation. I made some changes that hopefully fix that.
Post reply on HN