Live data from Hacker News

The Idea of Lisp

dev.to

121–130 of 348 posts

Re: The Idea of Lisp

#121
post #61

Earlier quoted context omitted.

Picolisp can match it in dynamism. Seriously, Picolisp is absolutely insane.

I just read a bit of documentation from the Picolisp page. It looks really cool, but can it reach arbitrarily far up the call stack? That's the quality of tcl that I don't see other places. The capabilities of 'upvar' and 'uplevel'. [Edit] I should say "one of the qualities." The other important one is that Tcl has no types. Even all the lisps I know have types.

The functions you're looking for are called `up` and `run` in picolisp.

And before you ask, yes, picolisp has list interpolation (or quasiquoting, in lisp parlance), so you can control which parts of a certain chunk of code will be run when, and in which contexts. It also includes the `macro` fexpr, which makes interpolation more convenient.

Re: The Idea of Lisp

#122
post #61

Earlier quoted context omitted.

I just read a bit of documentation from the Picolisp page. It looks really cool, but can it reach arbitrarily far up the call stack? That's the quality of tcl that I don't see other places. The capabilities of 'upvar' and 'uplevel'. [Edit] I should say "one of the qualities." The other important one is that Tcl has no types. Even all the lisps I know have types.

The functions you're looking for are called `up` and `run` in picolisp. And before you ask, yes, picolisp has list interpolation (or quasiquoting, in lisp parlance), so you can control which parts of a certain chunk of code will be run when, and in which contexts. It also includes the `macro` fexpr, which makes interpolation more convenient.

Wow, very interesting. Thanks for pointing out picolisp!

Re: The Idea of Lisp

#123
post #70

This article has many misstatements in its first half. > John McCarthy wrote 6 easy things in machine code, then combined them to make a programming language. John McCarthy didn't implement Lisp in machine code. Steve Russell did. Implementing Lisp properly in machine code is not easy; you have to write a garbage collector. To do that in the early 60s, you had to first invent garbage collection . Lisp was and is bril…

The article is called "the idea of Lisp" conveying the broad concepts. It's mean as something that can be digested as a newsletter or an email. He even mentions his email list in the article.

I don't think it was meant to be an encyclopedic reference on the language.

I think its odd that you spent that much effort tearing it apart. I for one enjoyed reading it while I was waiting for a coffee.

Who actually wrote the machine code is arcana that's lost to the dust bin of history anyway. What isn't lost are the high level ideas presented here.

Re: The Idea of Lisp

#124
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 :)

https://danthedev.com/2015/09/09/lisp-in-your-language

A Lisp implemented through JavaScript arrays.

Re: The Idea of Lisp

#125
post #75

Earlier quoted context omitted.

I see two issues with the ternary operator. One, the syntax is much less readable, and two, the consequent and alternate are both single expressions, so you can't do something like: x = if(something) { a = foo(); baz(a); } else { b = bar(); baz(b); }

I've always read ternary statements to myself as a question. some_condition ? this : that some_condition? then this, otherwise that Typing this, I realize how hard it is to explain without speaking it :)

Is the color red? If so, this; otherwise, that.

It's a little tricky, because in the above, the `if` keyword appears after the question mark.

Is the color red? Yes-- this: no-- that.

Trying to make a parsimonious English sentence while maintaining the syntax elements : P

Re: The Idea of Lisp

#126
post #22

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.

Because Common Lisp was the language for AI before the big AI-winter hit and it's now associated with approaches to AI that don't actually work. Also a lot of the latest AI is hyper optimized data crunching on GPUs which isn't necessarily one of lisp's strengths.

There was no "AI winter"; that's a myth. Well, or least a big exaggeration when used to explain why certain things are the way they are.

The main force which explains everything is the procession whereby mainframes were replaced by minis, were replaced by workstations, were replaced by microcomputers.

At each stage, the new wave of hardware started small, bringing in its own approaches, tools and languages. As each wave matured, certain software technologies made "the jump". Some didn't. Some made the jump, but their popularity was destroyed. Those approaches which started each wave had a certain edge, even if they were inferior. For instance, the BASIC language was very widely available on the first 8 bit microcomputers that burst onto the scene in the late 1970's, putting computing into the hands of non-institutional users for the first time. In computing ivory towers of that time, nobody considered BASIC viable at that time any more. Yet, because of this boost that BASIC received, riding the microcomputer wave, it still persists with us in the form of Microsoft's VB.

Lisp was very successful in the 1980's. However, it didn't run very well on microcomputers. If Lisp hackers wanted to make an application to sell on the mass market, the faced the prospect of their customers having to buy expensive workstations and minicomputers. So they did the obvious thing and re-wrote the logic in C or what have you, making it workable on an 8 Mhz PC with a meg of RAM. Once someone has "made it" by doing such a thing, they stop learning. Twenty five years later they are still telling the same story to new recruits about how they rewrote some Lisp thing in C to make it actually run, and made a business out of it, hence forget Lisp.

By the time the next wave of hardware gets to the point that it exceeds the previous generation in capacity and power, it's too late to try to revive most of the stuff that didn't make the jump. The people moved on to something else (or have even become irrationally permanent naysayers), plus other things have obviously changed in the world.

Lisp is doing very well all things considering, because of great expressivity and abstraction, machine independence and overall enduring value. Also, its adaptability: the ability to be reshaped into new dialects. Nothing that old has anywhere near the clout.

As far as the AI winter goes, basically the spiel is that certain funding money dried up for certain types of AI. Even if that is true, what does it tell us? That certain people were dependent on that type of money. They were dependent on it because their stuff only ran on institutional hardware; they were not able to wean themselves off the institutional teat and do something in the mass market. At least, not without changing toolchains.

Re: The Idea of Lisp

#127
post #117
post #92

Earlier quoted context omitted.

They have gradual typing but I believe they're still enforced as runtime contracts, making them not static types.

Technically, the Common Lisp standard leaves it up to the implementation what to do with type declarations--in practice, I get compile time warnings for violating them (as well as for violating inferred types). Type declarations will not lead to runtime checks, you need to use CHECK-TYPE or similar for that. Typed Racket is more extensive and gives errors at compile time. I don't know very much about how it works in…

In SBCL, type declarations are treated as assertions. If the compiler is sure the assertion is valid without doing runtime checks, it can remove them. The optimization levels are also taken into account (http://www.sbcl.org/manual/index.html#Handling-of-Types).

Re: The Idea of Lisp

#128

It's interesting, I'm reading Black Swan at the moment by Nassim Taleb, and one of his big rants is about how we get blinded by idealized, platonic forms and ideas when the real world is messy and inherently unpredictable. E.g. trying to explain the forms of nature with platonic archetypal shapes like circles, rectangles and triangles. Lisp and the community around it kinda has that flavor - getting lost in a world o…

I don't think actual Lisp programmers share this obsession with purity and ideal forms. It's more something that shows up in blog posts about Lisp by people who probably don't actually use it. The title of this one is telling: it's about "the idea of Lisp."

On the other hand, if you look at, say, ANSI Common Lisp, it's not at all some kind of perfectionistic attempt at divine elegance. It's a pragmatic compromise resulting from years, decades, of actual use on real computers.

Just browse around the SBCL compiler source code and you'll see that this stuff is developed by people who definitely aren't afraid of the messy practical reality of hardware:

https://github.com/sbcl/sbcl/tree/master/src/compiler/x86-64

Generally spend some time within the Lisp community and see how many people you see fretting over Platonic archetypal shapes and compare to people solving actual problems and using the language as just a nice way to program a computer.

Emacs is another example that demonstrates the spirit of actual Lisp programming as opposed to armchair theorizing about lambda calculus fundamentals.

Re: The Idea of Lisp

#129
post #70

This article has many misstatements in its first half. > John McCarthy wrote 6 easy things in machine code, then combined them to make a programming language. John McCarthy didn't implement Lisp in machine code. Steve Russell did. Implementing Lisp properly in machine code is not easy; you have to write a garbage collector. To do that in the early 60s, you had to first invent garbage collection . Lisp was and is bril…

Garbage collection is not necessary for lisp. Garbage collection only provides the illusion of infinite memory. Just like malloc/free.

Re: The Idea of Lisp

#130
When I was a kid they made us learn C and Lisp as part of Cognitive Science degree. I don't really use either language, unless you count C++. But I do feel that between those two languages you can understand two ideals really well. One is the idea of a clean symbolic expression, the other is the idea of a portable language that lets you get to the core of what the machine is really doing. Both are useful ways to think about programming.
Post reply on HN