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 (…
Expressions are limited, because they can only return one result. In stack based languages like Forth and PostScript, any function can take and return any number of parameters. In fact they can decide at runtime how many to take and return. PostScript is a lot like Lisp in that it's purely and simply homoiconic: PostScript code is just normal PostScript data. The "ifelse" operator takes a boolean and two expressions…
The Idea of Lisp
251–260 of 348 posts
Re: The Idea of Lisp
#252Re: The Idea of Lisp
#253I 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.
Re: The Idea of Lisp
#254Earlier quoted context omitted.
Unfortunately not. I had to surrender publishing rights, and the university only publishes about 10 submissions a yeaar... So unlikely to appear anytime soon.
> I had to surrender publishing rights Even as a pdf on your own webpage? What kind of university would do that? Even the most abusive CS publishers have a more relaxed policy…
And CS publishing usually happens only within STEM, not as a standalone, within this circle of Universities.
No, not in America. There is far less interest locally in CS, and so a sort of mild tyranny rules in academia.
Re: The Idea of Lisp
#255Earlier quoted context omitted.
Well, actually *Lisp was a thing. I think it is also a matter of culture, probably if the likes of AMD and NVidia cared, they could invest some money into making such languages run properly on GPGPUs, instead of leaving it to researchers alone how to target PTX and ROCm. On the other hand something like C++17 would already offer many of the Lisp benefits, even if a bit uglier.
Wouldn't it be harder to get Lisp to run in a GPU, though? Or perhaps my point is, wouldn't it be harder to get old-style (symbolic) AI to run in a GPU than ML-style AI? (If I understand correctly, the old style is a lot of walking data structures, and the new style is largely matrix operations. The latter seems like a much better fit for a GPU than the former.)
Re: The Idea of Lisp
#256Earlier quoted context omitted.
In Lisp, "def..." macros, like defclass, defun, etc. return the symbol to which is bound the definition. Not essential, but useful at times. I tend to find Lisp is full of details like this.
Well, Common Lisp! In the Scheme language, many imperative forms have an unspecified result. For instance, see R7RS 4.1.6: "the result of the set! expression is unspecified". Also, a related misfeature is that function arguments can be evaluated in any order.
But for those of you who aren't scheme programmers, it gets worse: because when RnRS says that the result of something is "unspecified" many implementations take it literally. That's right: in many Schemes, `set!` returns the literal value #. I swear I'm not making this up. It's awful.
To quote Jonathan Gabriel of Penny Arcade: "Baby, why you always gotta make me hit you?"
Re: The Idea of Lisp
#257Earlier quoted context omitted.
...And with TTK, you can finally have easy-to-write cross-platform UIs that actually look native. Seriously. If you want a decent cross-platform UI system with minimal effort, which has bindings in just about every language, TK is really worth your time now.
I have looked at it but don't find examples that truly look convincing,and the info in the official page look very sad. http://wiki.tcl.tk/9485
Re: The Idea of Lisp
#258Earlier quoted context omitted.
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 res…
ANSI Common Lisp is rather a design-by-committee monstrosity which was forced on the unwilling Lisp vendors by the Defense Department. Most of the feature set was designed via backroom political horse trading ("We'll let you include pet feature X if you support us for our pet feature Y".) There is no coherent overall plan or design to it at all. (Source: personal communication from a member of the committee that desi…
CL is still very good at what it does: all current implementations have solved many of the problems you mentioned, and there are a lot of libraries that will run across implementations.
CL is a beast, but clojure is a mess. Scheme is elegant, but has a radically different, more ALGOL mentality than CL, at least in some respects. Some of it is good, some is bad. I love it, but there are things that I would rather program in CL any day.
IMHO, clojure has neither the practicality of CL nor the elegance of Scheme. It has its advantages, but it's not ideal.
Re: The Idea of Lisp
#259Earlier quoted context omitted.
But then again, there's Scheme ...
Even Schemes can take a practical turn, e.g. Racket.
At present, there are only a few Schemes that are practical: Chicken, Guile, Chez, and Gambit seem to be the big players, with Cyclone, Chibi, and Bigloo bringing up the rear.
Re: The Idea of Lisp
#260Earlier quoted context omitted.
There's a lot here, but this one jumped out at me: > You can indent a Lisp program in any way but the language doesn't require any at all. Off the top of my head, isn't this true of basically all languages? Except one, and it got a lot of criticism for it (Python).
After I wrote that statement I started thinking that C programs can be formatted so that they don't read very well also. In C, an 'if' is always an 'if' (unless you use the pre-processor to screw it up) but in Lisp an 'if' could be anything. I do like the idea of Lisp macros where you can run a Lisp program at compile time to generate the code that is then compiled inline. What I should have said was that Lisp has no…
You will have a better time on HN if you swap these two more often than not.