News for hackers. Stuff that matters.
Re:I’ve Consed Every Pair by mark_l_watson on Friday May 01, 2020 @08:35AM (#23041360)
Peter tech-reviewed the second edition of my Java AI book and made the comment that Java was half as good as Common Lisp for AI and that was probably good enough (we had both written Common Lisp books). He then went to Google and I had lunch with him; I was surprised that he was using Python.

I like his poem in the article!

A little off topic, but I retired (that is a bit of a joke) and at the age of 69, this year I decided that for maximum programming enjoyment I would only use Lisp languages (linking in Python and TensorFlow on occasion). I am approaching 40 years using Common Lisp and using the language is so much fun. I bought a license for LispWorks and using it for developing a semantic web app.

Re:I’ve Consed Every Pair by thanksforfish on Friday May 01, 2020 @08:59AM (#23041525)
You may also enjoy: https://github.com/hylang/hy
Re:I’ve Consed Every Pair by mark_l_watson on Friday May 01, 2020 @09:06AM (#23041598)
I wrote a short book on Hy last year. A very cool language and just about perfect for using TensorFlow (or PyTorch) in a Lisp language. I am working on a second edition, adding examples converted from my recent work using Common Lisp.
Re:I’ve Consed Every Pair by thanksforfish on Friday May 01, 2020 @09:41AM (#23041878)
Oh cool. I'll link the book for anyone interested: https://leanpub.com/hy-lisp-python
Re:I’ve Consed Every Pair by slifin on Friday May 01, 2020 @12:50PM (#23043996)
We have good interop into python libraries via libpython-clj in Clojure too, this was relatively recent for us

https://nextjournal.com/kommen/gigasquids-libpython-clj-exam...

Re:I’ve Consed Every Pair by theboywho on Friday May 01, 2020 @10:02AM (#23042060)
Out of curiosity, what are your thoughts on Clojure ?

Also have you heard of Janet* ? what are your thoughts on such an approach ?

* https://janet-lang.org

Re:I’ve Consed Every Pair by mark_l_watson on Friday May 01, 2020 @10:14AM (#23042158)
For a few years, most of my consulting gigs used Clojure and I donated financial support in the early days. Great community around Clojure. That said, I like Common Lisp and Scheme better.

I had not heard of Janet, thanks for the link.

Re:I’ve Consed Every Pair by PythagoRascal on Friday May 01, 2020 @10:29AM (#23042311)
If I may ask, what references would you recommend to someone interested in something like Lisp, but who has never touched a functional language before?
Re:I’ve Consed Every Pair by pcr910303 on Friday May 01, 2020 @10:42AM (#23042441)
Not OP, but Lisp isn’t really a functional language — it’s a usual language that also has some functional ideas inside. Mutation is common, don’t think Lisp will be a language like Haskell.

For resources, I would recommend Practical Common Lisp[0] and PAIP[1].

For some modern development practices, the Common Lisp Cookbook[2] is great.

[0]: http://www.gigamonkeys.com/book/

[1]: https://github.com/norvig/paip-lisp

[2]: http://lispcookbook.github.io/cl-cookbook/

Re:I’ve Consed Every Pair by munificent on Friday May 01, 2020 @12:37PM (#23043839)
> Lisp isn’t really a functional language — it’s a usual language that also has some functional ideas inside.

The idea that "functional language" means "purity" is something that was retconned onto functional programming in the 90s decades after Lisp had defined functional programming to mean programming in terms of expressions that produce values.

I like the ML/Miranda/Haskell lineage of languages a lot, but it really bugs me when people in that camp lay claim to some notion of being a "better" functional language than the older Lisp family. (Lispers, while smug about many other things, are generally less smug about how "pure" their languages' approach to functional programming is.)

This is like arguing that Lagavulin isn't "really" whiskey because real whiskeys are made in the US from corn mash.

Re:I’ve Consed Every Pair by aidenn0 on Friday May 01, 2020 @02:01PM (#23044757)
Lagavulin isn't whiskey, it's whisky (/s)
Re:I’ve Consed Every Pair by couchand on Friday May 01, 2020 @09:08PM (#23048150)
There's no true scotch, man.
Re:I’ve Consed Every Pair by DonHopkins on Saturday May 02, 2020 @04:19PM (#23054595)
Lisp is "Functiony"! ;)

But it took JavaScript to invent the concept of "Truthy".

https://www.sitepoint.com/javascript-truthy-falsy/

Re:I’ve Consed Every Pair by hedora on Sunday May 03, 2020 @09:43AM (#23058931)
Perl 5 has truthy values, and it came out a year (1994) before JS (1995). The idea probably appeared in Perl 1 (1987), and probably was borrowed from shell scripting, etc. It wouldn’t surprise me if “Truthy” predated unix.
Re:I’ve Consed Every Pair by dreamcompiler on Friday May 01, 2020 @06:59PM (#23047382)
Sigh. Immutability is a relatively recent addition to the long list of features that defines a language as "functional."

In the beginning, "functional" meant functions were first-class objects and there was little--if any--global state. Lisp passes this test. Lisp invented this test (especially Scheme which introduced lexical scoping and closures).

If you want to write code with immutable data, you can certainly do so with Lisp; it just doesn't force you to. For the most part Lisp creates a brand new data structure when you "modify" an old one. You have to work a bit harder to actually mutate things.

Where e.g. Haskell is "more" functional than Lisp is more about automatic currying than immutability. Plus the static type system that allows monadic programming, which is much more difficult in Lisp because of Lisp's dynamic typing.

Re:I’ve Consed Every Pair by PythagoRascal on Friday May 01, 2020 @10:49AM (#23042505)
> Lisp isn't really a functional language

I guess I have even more to learn then :). Thank you for the links.

Re:I’ve Consed Every Pair by 7thaccount on Friday May 01, 2020 @11:41AM (#23043169)
Common Lisp can be used as a functional language, or imperative, or extremely advanced OO (see CLOS).

There are lots of different Lisp's though. Clojure is the most popular one that runs on the JVM and idiomatic Clojure is generally pretty functional although it calls out to lots of Java which is OO.

Re:I’ve Consed Every Pair by DonHopkins on Saturday May 02, 2020 @04:33PM (#23054693)
Lisp DEFs the FUN in FUNCTIONAL.
Re:I’ve Consed Every Pair by ctdean on Friday May 01, 2020 @11:37AM (#23043104)
On Lisp is the best Lisp programming book I have ever read. Both PG’s lisp books are great and you can just read those and the CL hyperspec.

On Lisp is out of print, but can be downloaded.

Re:I’ve Consed Every Pair by mark_l_watson on Friday May 01, 2020 @12:14PM (#23043567)
I would like to recommend that after reading PG's On Lisp, that you also consider Doug Hoyt's Let Over Lambda. Both are really great books for advanced study.
Re:I’ve Consed Every Pair by mark_l_watson on Friday May 01, 2020 @12:12PM (#23043544)
I think Racket might be worth you spending one or two evening with, to see if you like it. It has an OK IDE, and a rich ecosystem.
Re:I’ve Consed Every Pair by onemoresoop on Saturday May 02, 2020 @08:41AM (#23051411)
I second this, I discovered scheme through racket and got a lot of enjoyment out of it. DrRacket is easy to install and a great platform. I’d it a week to get used to it.
Re:I’ve Consed Every Pair by w3mmpp on Friday May 01, 2020 @11:29AM (#23042982)
If I may ask, what are the benefits of building this app in LispWorks instead of any other implementation (sbcl or else)?
Re:I’ve Consed Every Pair by 7thaccount on Friday May 01, 2020 @11:36AM (#23043091)
I've never used LispWorks, but I think they have their own GUI, support, built-in logic programming (Prolog) for starters.

They also have IDE like tools that are probably ready to go outside the box. Emacs with Slime isn't for everyone (I find it to be a big initial hurdle). Although I'm sure this guy is an Uber emacs expert.

Perhaps we can summon u/lispm for an answer here. I think he possibly works for LispWorks and is usually one of the lisp users on HN & Reddit that can answer questions pretty quick.

Re:I’ve Consed Every Pair by w3mmpp on Friday May 01, 2020 @11:53AM (#23043312)
Having worked for a long time with emacs and slime, I'd have the opposite fear, to have to develop anything in lisp without them, like this is the case for LispWorks.
Re:I’ve Consed Every Pair by kgwgk on Friday May 01, 2020 @12:23PM (#23043691)
> like this is the case for LispWorks.

I'm not sure I understand what you meant there, but you can use LispWorks with Emacs/Slime.

Re:I’ve Consed Every Pair by w3mmpp on Friday May 01, 2020 @12:32PM (#23043769)
Oh then it's interesting because I thought it required to use their IDE. With Emacs/Slime, is it as integrated as with sbcl for example?
Re:I’ve Consed Every Pair by kgwgk on Friday May 01, 2020 @01:40PM (#23044555)
No, you may still want to use the IDE to access functionality that is not available through slime. But you have the choice. According to the slime documentation: "Most features work uniformly across implementations, but some are prone to variation. These include the precision of placing compiler-note annotations, XREF support, and fancy debugger commands (like 'restart frame')."
Re:I’ve Consed Every Pair by 7thaccount on Friday May 01, 2020 @01:18PM (#23044307)
I'm sure you can use them just fine, but they also have their own tools I think.
Re:I’ve Consed Every Pair by lispm on Saturday May 02, 2020 @04:35AM (#23050336)
I'm not working for LispWorks, but I use it since many years.

LispWorks is a relatively expensive commercial implementation of Common Lisp. There might be several reasons to buy it: cross platform GUI support (Windows, Linux/Unix, Mac), integrated IDE, various delivery options for applications, support for various hardware / operating systems, ... I personally also find the runtime system quite robust.

Re:I’ve Consed Every Pair by mark_l_watson on Friday May 01, 2020 @12:10PM (#23043531)
Good question, since I also use SBCL and Clozure CL (and Armed Bear when I need Java interop).

LispWorks has a very nice portable UI library. That was the selling point for me.

Re:I’ve Consed Every Pair by w3mmpp on Friday May 01, 2020 @12:24PM (#23043706)
Ah yes, makes sense, I thought it was (only) a web app so I was wondering what benefit LispWorks was bringing.

How do you like their IDE compared to emacs/slime?

Re:I’ve Consed Every Pair by dreamcompiler on Friday May 01, 2020 @07:07PM (#23047429)
Lispworks has a capable IDE. It looks like a 1995 Geocities page but it works well enough. Their editor is Hemlock which is a Common Lisp clone of emacs, so most of the key bindings are the same as emacs and you can rebind them if you wish. Or you can use Lispworks without the IDE and drive it with (real) emacs and SLIME.

Personally I prefer the CCL IDE but it only works on the Mac.