No video

LOOP Common Lisps Superior For

  Рет қаралды 11,120

Gavin Freeborn

Gavin Freeborn

Күн бұрын

Пікірлер: 52
@fetchmasters
@fetchmasters Жыл бұрын
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!
@numericalcode
@numericalcode 8 ай бұрын
Had no idea about the destructuring. Nice!
@GavinFreeborn
@GavinFreeborn 8 ай бұрын
One of my favourite parts of loop. Really ahead of it's time. (and in many ways behind)
@sjatkins
@sjatkins 2 жыл бұрын
Loop is a good example of the raw power and flexibility of Lisp as a person decent at macros could write it if they didn't have it and wanted it.
@AliAzizQualityEducation
@AliAzizQualityEducation Жыл бұрын
lisp process interview Q & A Latest video : kzbin.info/www/bejne/Z163nYuepNeZeq8
@jacksonmowry
@jacksonmowry 2 жыл бұрын
Great video Gavin! Learning about Common Lisp macros is very interesting
@beauteetmusculation8191
@beauteetmusculation8191 2 жыл бұрын
Waiting for the next videos on LISP! ❤
@comproprasad6438
@comproprasad6438 2 жыл бұрын
Never thought looping can be so interesting
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
And to think I only scratched the surface
@jack002tuber
@jack002tuber Жыл бұрын
Thanks for this. I was looking for how to do loop in lisp, hit the spot. 🥉🥉🥉
@tobiasthrien1
@tobiasthrien1 2 жыл бұрын
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 :)
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
That's what I meant my they end up being similar. Was pretty sure they where the same bit figured I was probably wrong haha.
@EdouardTavinor
@EdouardTavinor 2 ай бұрын
Hello :) I've been using more defun recursion with tail call optimisation to do loops recently. It's a one-size-fits-all solution :)
@ericpmoss
@ericpmoss 19 күн бұрын
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.
@AndersJackson
@AndersJackson 2 жыл бұрын
Thanks for the explanation of the loop macro. Never really looked into it.
@Oi-mj6dv
@Oi-mj6dv Жыл бұрын
The thing about lisp is that these sort of things feel very illegal but yet they obviously arent. Powerful stuff
@FUNM0DE
@FUNM0DE 2 жыл бұрын
What’s up lisp lovers!!!
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
Lol
@Oi-mj6dv
@Oi-mj6dv 2 жыл бұрын
Holy shit this is amazing
@godfather7339
@godfather7339 2 жыл бұрын
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.
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
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.
@user-cq7db9ij1o
@user-cq7db9ij1o 2 жыл бұрын
Excellent and informative. If you can give what kind of work Common Lisp is ideal ? that would be great.
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
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 kzbin.info/www/bejne/bKGwqpuoeciAsNk . 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.
@user-cq7db9ij1o
@user-cq7db9ij1o 2 жыл бұрын
@@GavinFreeborn Thanks.. looking forward.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 2 жыл бұрын
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.
@corinroyal
@corinroyal Жыл бұрын
@@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.
@lawrencedoliveiro9104
@lawrencedoliveiro9104 Жыл бұрын
@@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.
@arisweedler4703
@arisweedler4703 2 жыл бұрын
It is a CL to JS compiler, not a CL to WASM compiler? I guess why not, both can exist. JSCL - the CL implementation for JS, nice
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
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.
@aangGAD
@aangGAD 2 жыл бұрын
Awesome!
@jarusll
@jarusll 2 жыл бұрын
This was nice
@programorprogrammed
@programorprogrammed 2 жыл бұрын
3:44 to skip the getting started preamble
@ctoid
@ctoid Жыл бұрын
Oh wow, I think I discovered the true power of LOOP too late
@TheJacov
@TheJacov Жыл бұрын
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.🤔😁😁😁
@AliAzizQualityEducation
@AliAzizQualityEducation Жыл бұрын
lisp process interview Q & A Latest video : kzbin.info/www/bejne/Z163nYuepNeZeq8
@fakecrafter7448
@fakecrafter7448 2 жыл бұрын
Tutorial on sly please
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
What would you like to see? I have cool features I want to show but I'm interested in others want to see/learn
@fakecrafter7448
@fakecrafter7448 2 жыл бұрын
@@GavinFreeborn how to setup and maybe just the concept of the repl in general and how to use it
@GavinFreeborn
@GavinFreeborn 2 жыл бұрын
@@fakecrafter7448 sounds easy enough. I kinda cover the setup of sly in my stumpwm video but something dedicated wouldn't hurt.
@jwmcq
@jwmcq 2 жыл бұрын
Loop is an abomination! (This comment is sponsored by the Iterate gang.)
@lawrencedoliveiro9104
@lawrencedoliveiro9104 2 жыл бұрын
Have you got a video comparing the two?
@ericpmoss
@ericpmoss 19 күн бұрын
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.
@laughingvampire7555
@laughingvampire7555 Жыл бұрын
the least favorite macro of John McCarthy, he said "it was too much like English"
@insanecbrotha
@insanecbrotha 2 жыл бұрын
fuck polymorphism, let's loop in/across/being the hash-key of ... cl:loop is such a mess. XD
@lawrencedoliveiro9104
@lawrencedoliveiro9104 2 жыл бұрын
It’s just a macro. Don’t like it, write your own.
@insanecbrotha
@insanecbrotha Жыл бұрын
@@lawrencedoliveiro9104 t
@insanecbrotha
@insanecbrotha Жыл бұрын
@BoulderBro999 why? Honestly I find the highly polymorphic/abstract loop style of Python better than C loops.
@borschtnazi8195
@borschtnazi8195 Жыл бұрын
@@insanecbrotha because the two of the neurons comprising your 'brain' are defective.
@ericpmoss
@ericpmoss 19 күн бұрын
@@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.
@zbigniewloboda3393
@zbigniewloboda3393 Жыл бұрын
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.
@borschtnazi8195
@borschtnazi8195 Жыл бұрын
stop saying "you guys"
@davidthompson1797
@davidthompson1797 5 ай бұрын
It's so, so patronising!
Why You Should Learn Lisp In 2024
21:50
Gavin Freeborn
Рет қаралды 64 М.
Creating Your First Lisp Project - Quicklisp, asdf, and Packages
24:47
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 40 МЛН
艾莎撒娇得到王子的原谅#艾莎
00:24
在逃的公主
Рет қаралды 52 МЛН
🩷🩵VS👿
00:38
ISSEI / いっせい
Рет қаралды 24 МЛН
Why Are Lisp Macros So Great!?
16:28
Gavin Freeborn
Рет қаралды 15 М.
Unleash The REPL With Sly
14:45
Gavin Freeborn
Рет қаралды 12 М.
Rewrite Your Scripts In LISP - with Roswell
21:23
Gavin Freeborn
Рет қаралды 21 М.
What is the Curse of Lisp?
25:09
Eric Normand
Рет қаралды 27 М.
Double Your Productivity With Emacs Org-Mode
24:15
Gavin Freeborn
Рет қаралды 7 М.
LEARN EMACS LISP - Mostly The Strange Parts
29:22
Gavin Freeborn
Рет қаралды 17 М.
Learn Emacs Lisp in 30 Minutes
30:22
Gavin Freeborn
Рет қаралды 9 М.
Book review: Common Lisp Recipes: A Problem-Solution Approach (2016), by Edmund Weitz
27:15
Alone in the Kitchen — by Nino Ivanov
Рет қаралды 934
Joker can't swim!#joker #shorts
00:46
Untitled Joker
Рет қаралды 40 МЛН