social.solarpunk.au

social.solarpunk.au

Hey ancient tech people: is #Lisp still worth learning? Asking for someone who needs more parentheses.

@jackdaniel @knapjack 100% lisp imho gets even a little more traction nowadays. No clue why but the community is quite active @shinmera is one of those pushing it. So yes learn it even if don't use it. It is eye opening.

@knapjack Lisp, and the better version Scheme, are very worth learning and using now. They're advanced languages that make it easier to build what you want. Start with SICP
https://web.mit.edu/6.001/6.037/sicp.pdf
and see how quick you pick it up.

@mdhughes @knapjack There's a very nice (unofficial) HTML/EPUB version of SICP here: https://github.com/sarabander/sicp

Also @spritelyinst have a great "Scheme Primer" which is a more direct introduction to : https://spritely.institute/static/papers/scheme-primer.html

@knapjack
I obviously agree with @mdhughes though I would say lisp24lyfe.
Beginner-friendly starting points... The lisp community is the great barrier reef of computer science and lisp is the coral.
Find one of any number of entry points, which you won't understand the context of for a long time. Then tough it out until you can basically answer questions for yourself, and your senior lisp users will tell you what they recollect that you seem to have missed.
@flatwhatson @spritelyinst

@knapjack It will change the way you think about what programming can be -- so yes. You need to learn it the right way, but fortunately (and not coincidentally) it's the subject of the only computer science book worth reading twice https://simondobson.org/2010/05/14/cs-book-worth-reading-twice/

@pkw @knapjack @screwtape Of course I'm just snarking a bit about Scheme. Common Lisp & Scheme are effectively the same: tools, resulting code, shippable programs are very similar.

Scheme does it in 5% of the language spec, libraries are a bit of a mess. CL is a gigantic hyperspec to study, but has ASDF/Quicklisp which is nice.

@mdhughes @pkw @knapjack @screwtape Are the tools really the same? I keep on reading that Scheme (Racket for instance, less so for Guile or MIT Scheme) is MUCH LESS interactive: https://gist.github.com/vindarel/c1ef5e043773921e3b11d8f4fe1ca7ac

«[Racket:] authoritarian module system that prevents modification to the system, no condition/restart but just print you a trace, and little runtime inspector/debugger support (and it's probably impossible to add […]»

@vindarel @pkw @knapjack @screwtape The DrRacket GUI is awful, it deliberately impedes interactive programming and they say "toplevel is hopeless", because they've inexplicably made it so bad.

Racket command-line works just fine, like any other interactive Scheme, you can use slime or vlime or whatever with it.

Every other Scheme has a normal REPL. Chez, which Racket is built on, has a really great in-line editor and environment. MIT Scheme ships with edwin, an "emacs in Scheme".

@mdhughes @pkw @knapjack @screwtape you can easily see that the 5% number is one or two orders of magnitude wrong. Check the Racket documentation: it has more features and more operators than the Common Lisp spec. Up to R5RS the Scheme report was only a small core language for education. R6RS and R7RS have more features. Then see how many SRFIs each Scheme implementation provides. Similar for Common Lisp, actual implementations describe (much) more features in their manuals.

@lispm @pkw @knapjack @screwtape Racket is not a "Scheme", they specifically renamed it from PLT Scheme because it's its own thing now.

R5RS/R7RS are 5% the size of the CLHS. R6RS, depending on how much non-spec stuff you include, is ~7%. All 3 are very usable, complete languages.

SRFIs and libraries are equivalent to ASDF/Quicklisp. You want to count all of that in "lisp"? No.

Before the former chair gave up, R7RS-large might've become as large as CLHS, but that's no longer planned.

@lispm @pkw @knapjack @screwtape The state of Racket is weird, because it also includes multiple Scheme & non-Scheme langs, and is now built on Chez (R6RS) instead of a bad mix of C++ and itself. There is no spec for Racket, just one impl and then the sub-langs.

@mdhughes @pkw @knapjack @screwtape R7RS is not 5% of Common Lisp. The Common Lisp spec has roughly 1000 (operators, types, classes, ...). R7RS has more than 50 symbols . Check the massive GUILE manual. The Chicken documentation. They have many more than 50 symbols. Real Scheme implementations will have between 50% and 200% of the Common Lisp specification implemented in a different way... Errors, OOP, Reader, Printer, Streams, …

@lispm @screwtape @knapjack @pkw @mdhughes
CLHS looks big because of the formatting, but you are right on Scheme, no one uses supposed
'core' features. In the end you have to use far more than R7RS.

@anthk

I think it would be fair to say that Scheme (or RnRS) is a language seed, and that the practical implementatioms built around Scheme with their communities are gardens, and that people can decide to either grow their roots in some particular implementations, or to be able to easily travel between those gardens.

@lispm @screwtape @knapjack @pkw @mdhughes

@PaniczGodek @anthk @screwtape @knapjack @pkw @mdhughes that's the same for other Lisps, though sometimes the gardens can be parks: my Lispm has 45976 functions, of those 5933 are exported. The CL standard defines 'only' 660 functions.

@lispm @PaniczGodek @anthk @screwtape @knapjack @pkw @mdhughes
I think it's also important to look at portability too rather than just raw size.

For instance, with Common Lisp, I have gotten a program I wrote this year developed targeting SBCL, without portability in mind, running on Macintosh Common Lisp (1992) with zero modifications. Well, other than a custom loader script because the de facto standard build system (and a lot more), ASDF, isn't available on an implementation that old.

Conversely, it's basically impossible to get any nontrivial Scheme program running on any implementation other than the one it was written on, unless it was written *very* carefully and likely omitted features that would've been nice to have (because R5RS and R7RS-Small are so minimalist that they're missing a bunch of stuff practical programs need).

There are a lot of nonportable things in CL but it's also much more common than in Scheme for there to be wrapper libraries that unify the API of all the different implementation extensions: https://portability.cl/

Maybe it doesn't necessarily matter to you (people are just fine with Rust and Python really only having one “real” implementation), but I do think it's an important point to bring up that precisely zero people do lol

@nytpu @lispm @PaniczGodek @anthk @screwtape @knapjack @pkw I routinely move utility code from Chez (R6RS) to CHICKEN (R5RS++), Gauche (R7RS), or LispPad (R7RS) with very little conversion or library shims. The only problem is import/library forms which vary between specs (or don't exist), and lack of some list/hashtable/hash-table tools.

The much more minimal language makes that easier.

@mdhughes @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw

wow, the GNU GUILE manual has 981 pages, documenting much more than ANSI CL.

That's minimal. ;-)

https://www.gnu.org/software/guile/manual/guile.pdf

@lispm @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw … By including the Guile manual, and all the available SRFIs and other libraries in one file. So it's the equivalent of CLHS, SBCL manual, and every ASDF document page, and is, again, probably 5% as long.

@mdhughes @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw it has much more functionality than ANSI CL. Just read the manual. The language implemented by GNU GUILE is 300% of ANSI CL.

@lispm @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw It's an R6RS++, but the libraries are NOT core language. You don't have to use any SRFI to use Scheme, just like you don't have to use ASDF to use CL. And the Guile manual also includes the C API!

> SLIB is not included in the Guile distribution, <

Cherry-picking a giant blob of all libraries ever made, and a native integration manual, does not make CL look less bloated.

@mdhughes @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw It's the distribution documentation of a real Scheme implementation. Not the "minimal language" you cherry pick. Basically every feature (and more) of ANSI CL (which is a language and a core library in one), which is not in R6RS, is then provided via SRFIs, which then are bundled/implemented by Scheme implementations.

@lispm @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw
Finally (FOR REAL), let's look at my bookshelf:

Practical Common Lisp, Peter Siebel: 887 pages.

Anatomy of LISP, John Allen: 470 pages.

Land of LISP, Conrad Barski MD: 508 pages, a mere trifle, a wafer-thin mint.

Scheme:

The Scheme Programming Language, ANSI Edition, R. Kent Dybvig: 276 pages.
4E, web pages: 380 pages?

Little Schemer, Friedman & Felleisen: 211 pages.

SICP, 2E: 657 pages. An entire CS course.

@mdhughes @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw these are random programming books. Land of Lisp is about implementing games. The same book exists in a Racket (Realm of Racket), a variant of Scheme. The books are about the same length.

What does that say to me?

replies
0
announces
0
likes
0

@mdhughes @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw

actually looking at Realm of Racket, btw. a very good book, it's actually a slightly shortened variant of Land of Lisp. It's also in the programming style improved, compared to the earlier original. Thanks to the new co-authors.

I would recommend both books. :-)

@lispm @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw I do like Barski's peculiar solutions to things. Attack the problem backwards and from a REPL first.

@mdhughes @nytpu @PaniczGodek @anthk @screwtape @knapjack @pkw REPL first. It looks a bit like an annotated REPL history. With lots of drawings...

Generally the design is well done. There are also many simple things. Example: He puts numbers in to the code and references the numbers in the explanations...

@mdhughes @lispm @nytpu @PaniczGodek @screwtape @knapjack @pkw

On Common Lisp books:

- Common Lisp, an Interactive Approach

- A Gentle Introduction to Symbolic Computation

- Paradigms of Artificial Intelligence: Programming

With these anyone can learn Common Lisp up to any level.