I've been playing with CL now for about a year, and I've *NEVER* seen the loop macro explained in this declarative fashion. Really helped me understand better what is going on under the hood. Best loop tutorial out there in my opinion. Thank you!
I was kind of disappointed that you didn't notice at 11:39 that the values are all the same (i.e. 11). Gauss certainly would have noticed it (maybe someone gets the reference). But I shouldn't blame you. I guess this is the equivalent of backseat gaming for programming tutorials :)
There are several cute things included in the loop extensions that make certain toy problems trivial, but it is so un-Lispy that I avoid them all. It's more than just an aesthetic issue -- a DSL, especially a non-Lispy one, belongs in a loadable library, not the language core. Because of the syntax of this DSL, it is tricky and sometimes impossible to add type declarations without violating that syntax. Similarly, it is tricky and sometimes impossible to instrument the code with things like counters and accumulators and conditional breakpoints. I think it is much better to write one's own specialized iterator macros that look and behave more like the core built-ins of map, reduce, and do, but with whatever specializations and optimizations that apply to the problem at hand. I also think it is better to do that because it lets me be a programmer, not a configuration technician.
Really good video, I'm new to lisp and your explanations are really nice. Maybe do a video on CLOS? I've heard that's lisp has a very good object system, but I can't find 1 good video on it.
The Atlanta Functional Programming youtube channel has on but you have to sit through a lot to get to it. I've been a little hesitant to talk about it since the works "Object Oriented Programming" tends to scare people away from Common Lisp even if it's a much better system than you see in other languages. Java has single handedly destroyed the term haha.
I'd say nearly everything! CL is a truely general purpose language. It's performant (around the speed of Golang), it's quick to develop with (like Python), it's crazy flexible (more so than nearly any language), it supports both a functional object oriented and procedural style. Though if I had to narrow it down to a few use cases I would say rapid prototyping. I don't get to show it off in this video but CL's repl is unlike any other. Here is an example of what it can do ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-6pMyhrDcMzw.html . If you look into companies using Common Lisp you will find most of them are focused on non trivial problems. This is really where lisp can shine. Sometimes you go into a problem with an idea of a solution but don't have information or experience to account for all the possible issues you may face. Hopefully this answers your question. I plan on going into this further in a future video.
Are there any Common LISP implementations that are not purely garbage-collected? I’m thinking of a hybrid reference-counted/garbage-collected implementation like Perl or CPython.
@@lawrencedoliveiro9104 Not as far as I know. There are different garbage collection strategies in different implementations and garbage collection can be tuned, but it's an essential feature of Common Lisp. There are non-garbage collected Lisps though. I don't use them.
@@corinroyal I’m not talking about getting rid of garbage collection, I’m talking about adding a prior reference-counting pass to take care of common cases.
JSCL is actually CL implemented in JS. There is also parescript a set of macros for CL that compiles to javascript as a string. Useful for adding some client side code to your CL server. Though for something like a single page web app you may be better off with ClojureScript. There is JACL which is intended to fill this gap.
The only problem I had with sly and emacs was that sly doesn't quote it's repl definition string when you M-x sly. Generally this is not a problem if you are running Linux, but just now I'm stuck on Windoze 10 for my sins. Turns out that if you do a default install of sbcl as I did then your path contains spaces and therefore must be "quoted". So far the only work-around that I've found is to C-u M-x so that I can insert the required quotes. It's not a game-killer, but it was a royal pain in the ass to figure out, and it remains a minor annoyance. Maybe one day I'll be able to figure out how to make sly quote by default so I don't have to deal with this.🤔😁😁😁
Loop itself is fine, but the extensions don't belong in the core language spec, especially since they are so un-lispy. We'd be much better off writing our own macros if map/do/reduce aren't terse enough, and sharing the ones that seem generally useful.
@@lawrencedoliveiro9104 I agree with the "write your own" part, and I wish the committee had adopted that approach rather than wedge a non-Lispy DSL into the core of the language spec -- especially when it duplicates existing functionality, isn't instrumentable, and turns a programmer into a configuration tech. We would all be better off rolling our own and sharing loadable libs of them.
0:42 Too much self... Clisp. The main difference between clisp and Python is that average world monthly pay of Python programmer is about $250. Why? Because i Python everybody can program this for which algorithms are already created. But try to do the same thing where first you have to first learn proprieties of the domain before you can arrive at the algorithm.