Live data from Hacker News

The Idea of Lisp

dev.to

11–20 of 348 posts

Re: The Idea of Lisp

#11
post #8
post #6

Does anybody have a few examples of DSLs people make in a lisp (ideally clojure because I have worked with it a tad)? I've seen plenty of cases where people make a pseudo-dsl via optional arguments, but not seen this so-oft mentioned "yeah we just wrote a dsl for it because lisp" sort of deal.

http://beautifulracket.com/appendix/domain-specific-language...

Hmm, I guess I have seen datascript / datalog. My main question is more about how many articles seem to suggest that it's basically par-for-the-course in lisp programming to just make a DSL in your projects, so was wondering when that might actually occur.

Re: The Idea of Lisp

#12
post #4
post #3

Lisp was developed because McCarthy needed a tool for experimenting with AI. Found a video of McCarthy talking about AI: https://www.youtube.com/watch?v=Ozipf13jRr4 And if anyone cares, here is nice Shirt with McCarthy on it ;) https://www.teepublic.com/t-shirt/666689-john-mccarthy-lisp-... I think it should be mandatory for CS students to implement their own little Lisp using the building blocks McCarthy described!…

Is there a kind of walkthrough/tutorial about how to develop a little Lisp interpreter? That sounds like a fun experiment. PS: Sorry, I am a Java OO developper. But I like to learn :)

>Is there a kind of walkthrough/tutorial about how to develop a little Lisp interpreter?

At least as many as there are TODO app examples for web frameworks...

Re: The Idea of Lisp

#13
Nice article. Check out Paul graham's The Roots of Lisp for a similar exploration in which he shows how to build the metacircular interpreter.

> John McCarthy wrote 6 easy things in machine code

It was actually Steve Russel, McCarthy's grad student, who had the idea of writing McCarthy's eval function in machine code.

Re: The Idea of Lisp

#14
post #2

The conditional expression or more specifically everything being an expression is my favorite thing about Lisp. I did not know that McCarthy pushed to add it to Algol which apparently today is the ternary operator for most languages. It is annoying that so many languages (C, Java, C#, etc) have both a conditional statement (if-else) and conditional expression (ternary ?:). Really the if-else should be an expression (…

In Rust, if-else is an expression, and there's no separate ternary operator.

Re: The Idea of Lisp

#15
post #8
post #6

Does anybody have a few examples of DSLs people make in a lisp (ideally clojure because I have worked with it a tad)? I've seen plenty of cases where people make a pseudo-dsl via optional arguments, but not seen this so-oft mentioned "yeah we just wrote a dsl for it because lisp" sort of deal.

http://beautifulracket.com/appendix/domain-specific-language...

As mentioned in this list, Ihaka and Gentleman's R implementation of S begain like this but quickly grew into a larger system. R's source code today is still full of lispisms.

Re: The Idea of Lisp

#16
> This is a proof by construction that the language is computationally complete.

The definition of Turing completeness in the article is not correct. A language being able to execute programs written in itself is not a sufficient condition of Turing completenes. Trivial example: define a language with one pre-defined term, x, which is a routine that takes as input a string, checks if it's "x", and executes it if it is. The empty language is a counter-example as well, but that's cheating.

I'm also not sure if the use of the phrase "fixed point" is a misunderstanding of the definition of a fixed point or just an unfortunate use of a term that already has great significance in LISP.

Re: The Idea of Lisp

#17
post #14
post #2

The conditional expression or more specifically everything being an expression is my favorite thing about Lisp. I did not know that McCarthy pushed to add it to Algol which apparently today is the ternary operator for most languages. It is annoying that so many languages (C, Java, C#, etc) have both a conditional statement (if-else) and conditional expression (ternary ?:). Really the if-else should be an expression (…

In Rust, if-else is an expression, and there's no separate ternary operator.

Yep I know. Rust although syntactically looks like an Algol [1] like language it actually barely is one :) . It is more akin to a ML language [2].

[1]: https://en.wikipedia.org/wiki/Generational_list_of_programmi...

[2]: https://en.wikipedia.org/wiki/Generational_list_of_programmi...

Re: The Idea of Lisp

#18
I wonder why lisp isn't as popular as say python for AI, ML, and stuff. I see these fields as having a strong academic tone, and it feels like racket or clojure could be bigger when it comes to that.

Re: The Idea of Lisp

#19
post #3

Lisp was developed because McCarthy needed a tool for experimenting with AI. Found a video of McCarthy talking about AI: https://www.youtube.com/watch?v=Ozipf13jRr4 And if anyone cares, here is nice Shirt with McCarthy on it ;) https://www.teepublic.com/t-shirt/666689-john-mccarthy-lisp-... I think it should be mandatory for CS students to implement their own little Lisp using the building blocks McCarthy described!…

While ML was the meta language for a theorem prover. Funny how these were side effects.

If there's one thing I've learned from programming it's that to build anything good you have to be driven by real use cases.

Re: The Idea of Lisp

#20

I wonder why lisp isn't as popular as say python for AI, ML, and stuff. I see these fields as having a strong academic tone, and it feels like racket or clojure could be bigger when it comes to that.

The "base rate" popularity of Python is much higher than all those others. This leads (via many mechanisms) to Python being more popular than these others.

(The reason it's Python and not another popular language is another matter - I think for various reasons Python was a more popular language for scientific computing).

Post reply on HN