Just a note at the beginning. CL, Scheme and Clojure are not "implementations" of LISP but rather different languages in the Lisp-family of languages, or more simply different Lisp dialects, and as you've mentioned each of them have multiple implementations. Also Clojure is by far the most popular Lisp nowadays.
Ya I definitely should have called them dialects haha, Ya probably should have been clear that when I say popular more people likely have used CL just because many universities used to use it for AI classes.
Scheme is very different from traditional LISP. Traditional LISP has separate namespaces for function names versus variable names (i.e. you can have one of each with the same name), while Scheme unifies the namespaces. Also, traditional LISPs don’t seem to have continuations, Scheme does.
Still, the popularity of Clojure has been waning in recent years. As of this month, Clojure is outside of the Top 50 at TIOBE. Clojure is no longer on PYPL's list, nor on RedMonk's list. And Clojure is at #39 on IEEE Spectrum's list. At least regular Lisp is #30 at TIOBE. 😄 That's something.
I had looked into lisp early last year, and couldn't wrap my head around the bracketing syntax. It all makes sense after you explained it as building an abstract syntax tree! Thanks for the paradigm shift!
I've been using Autolisp and Visual Lisp for almost 20 years, it's one of the most elegant programming language I've known. This come from a person who also know C, C# and Visual Basic.
I just imagine a Pac-man-like entity nibbling the expression from its opening. Each s-expression is a list. Each list is a chain of cons cells. Eats it one by one. And each list hides an empty list () at the end. It's like a portal for the said Pac-man to burp his result down.
is just function invocation/application, a simpler function application syntax std function invocation syntax: my_fun(arg0, arg1) Lisp function invocation syntax: (my_fun arg0 arg1) so if you have something a bit more nested like std: f1( f2(arg0), f3(arg1) ) lisp: (f1 (f2 arg0) (f3 arg1))
To cut a really long story short, frustration with some other languages have lead me to make my own language, with the compiler written in Common Lisp. The language is also s-expressions, so we just use the lisp reader and walk the AST right into LLVM. We basically get to skip writing like 80% of the compiler, and honestly I'm wondering why on Earth anyone bothers with other syntaxes at all. Using Common Lisp has been a blast and honestly I am wondering if I should just drop the new language and do everything in CL.
While I love CL idk if I'd write everything in it. I do find the ecosystem to be a bit overwhelming. I find myself wishing there was a standard project and build system. asdf+ql comes close but often projects mix and match too many things. You end up with autotools/makefiles trying to hide it all from the user resulting in a ton of system incompatibility. I think Roswell while still in its infancy is a reasonable option. Though it's lack of adoption and lack of community interest gives me the feeling it's not going anywhere.
@@openroomxyz you can approach that by giving compiler hints to go for full speed vs debuggability/safety: il will remove many safety nets (errors cheking..). you can program more with arrays, too if you'd like to go in that direction. The recommend way, though, is to write a correct, featureful program first (keeping a conscious eye on perf), and then only, if necessary, go to optimize the critical parts ...
@@GavinFreeborn I use Common Lisp mostly for "creative programming", i.e. I have an idea I want to see in action quickly. What you refer to sounds a bit more like "writing a serious application which ends in a binary". Since I did not seriously try to accomplish something like that, I take away from your post, that it seems to be more involved than just (save-lisp-and-die). The one thing I would love to see better supported in the CL ecosystem is the ability to use it as a scripting language in other applications. ECL kind of promises that, but when playing with integrating CL into some C++ application it is not as fun an experience as I would have hoped for. SBCL on the other hand, you can build as shared library. But the amount of tutorials and examples out there on the internet is quite sparse. No free lunch. I think, CL is a perfect fit for the "scripting language in other application" use case and someone should turn it into a free lunch, so it is easy for everyone to do it.
Wow. I haven't touched this one for 30+ yet. Back then, it was one of the best AI languages. The fastest machine that was available to us was x286 (the IBM AT) and we were running common lisp.
I remember working on a project in the mid 2000s where I was trying to build a lab inventory management system using LispWorks. The app was killed before it was ever finished, but the time I spent learning lisp and it’s features was time incredibly well spent for helping me to learn how to think about solving problems and it educated me about how a language can influence the the thoughts you can have and the solutions you can come up with. I always tell people that lisp bent my mind in all the best ways and I always think of it fondly.
I my experience you can always use that experience to write small and dirty "programs" with clisp, for instance... that's what I do: dev. is as fast as python (when you still have lisp "in your fingers"), and more fun
I have no idea why Kent Dybvig called his implementation "Chez Scheme", but "chez" is a French word, meaning "at the house of" or "at the home of", and is pronounced "shay". As in, for example "Chez Panisse", Alice Waters' famous restaurant in Berkeley, CA.
This is only a guess, but Proust wrote a very famous novel, whose original title in French: _Du Côté de Chez Swann_ . I have always wondered if it was a pun on this specific title as _Chez Swann_ and _Chez Scheme_ shares a certain resemblance. But it is quite far stretched I definitely agree... :-)
My french is poor, but to my knowledge "chez" only means "at", so get rid of the "house" or "home". In France, every third café or bar is called "Chez Michelle" or "Café Chez Rique" and means the same as the "`s" in "Rick's Cafe". Well - only nearly, too.
@@unbekannter_Nutzer "chez" from french dictionary: come from latin "casa" which mean "hutte"; Indique une localisation dans la maison, le pays, l'oeuvre de quelqu'un, la présence de quelque chose dans le comportement de quelqu'un. Indicates a location in someone's house, country, work, presence of something in someone's behavior.
racket is the way to go for : - a very nice IDE, drracket; - one of the best documentation I ever seen; - a lot of librairies about any topics - and in scheme, a lot of very nice teaching material available.
@@openroomxyz to say the truth, I don't know because I never used CL. why? because, before everything, you must figure out how to run emacs with CL, and waste a lot of time; and I never found on YT any good lectures about CL; DcRacket works fine out of the box! and you have 5 nice lectures from Stanford and 20 and more lectures from MIT in scheme. Stanford lecture 19 to 23 of programming paradigms ua-cam.com/video/_cV8NWQCxnE/v-deo.html MIT they talk about LISP but it's not CL but the people who made scheme : the birth of scheme ua-cam.com/video/-J_xL4IGhJA/v-deo.html
@@openroomxyz You're bound to doing things THEIR way which is sometimes the hard way or just not very useful to the way you want to approach a problem. If you already know C and are familiar with Linux, just learn one of the Schemes with a C FFI. That way your Scheme programs can extend to say the glibc, and you can do anything you'd do from c (syscalls, file i/o, etc etc).
You convinced me that I definetelly should give Lisp a try. After learning F# I understood that programming can be much more powerful than stupid OOP and it gave me my interest in programming back. Now I understand that it can be even more powerful than I can comprehend now and I will never truly understand it before I check it myself and learn new higher-level techniques. Functional programming already made me a better developer. I hope that homoiconicity, macros, code as data will make me even better :)
Functional programming isn't mutually exclusive with object-oriented programming. Common Lisp has an object system (although it works quite differently from languages based on C++ tradition)
@@xGOKOPx IMO, one of the most important properties of FP is immutability. OOP on the other hand is all about mutable local state. So, I disagree, they are mutually exclusive. IMO, if language is trying to be hybrid of OOP and FP then it means it's not FP, but just have some elements of FP. Because FP is more strict and mixing it with OOP requires relaxation of it's constraints. But relaxed FP is not FP anymore. Because FP is all about constraints. For example one of my favorite languages F# is not fully-functional. It's just functional-first and it's positioned like that by it's creator. I think it's fair to call things as they are.
OOP is the biggest false prophet in programming. I'm sure if any OO programmer chooses to expand their horizons and learn other paradigms (as I have), they will come to realize how fundamentally defeated OOP is in it's promises. The only good thing about of OOness is polymorphism, and ironically whatever OO languages provide in this area are limited by it's biggest flaw: rigid, unintuitive, ever growing inheritence hierarchies.
I feel offended that you should call oop stupid. Oop is elegant and beautiful, if you see it. Besides no programming language can exist smoothly without adopting some oop view. Oop is inevitable
The best reason for learning Lisp is for how well it covers many paradigms. You've got the CLOS, you've got first class functions with optional arguments, named arguments, defaulted arguments, and variadic arguments. You've got notions of streams of data. Not to mention the ability to truly extend the language at the syntax level via macros which are quite different than text substitution. SBCL is a very good implementation of Common Lisp - it's faster than you might expect and the compiler writers are always adding new tweaks to make it faster. If you want a minimal pure Lisp consider a Scheme like Chicken. If you learn Common Lisp you'll also learn quite a bit of Emacs Lisp since they sort of share a similar branch on the family tree (there are differences though).
I was on the fence about spending time to learn Lisp this year or not, but you convinced me to do so. I think I'll start out by learning Scheme and then I'll probably move on to CL or emacs Lisp.
I have yet to use lisp yet, but already knew how basic math was written in it, and didn't really understand why however. I never got why it was written like '+ 1 1' instead of the more natural '1 + 1'. But your explanation on how it actually gets evaluated really clears that up. And also makes sense that this more literal robust method makes the order of operations always clear.
if you know C, any program begin like this : int main(int argc, char* argv[]) in "argv" you have an array of null terminated string; in the first slot, the name of the program, and in the other one, the arguments to be passed to that function; you just have to think that all function call in lisp or scheme are just a list (instead of array of string) like the argv in C main function.
Lisp wasn’t a language until 1960 when MccCarthy published his paper on a list processor. Another gentleman read the paper and built and compiled becoming the first Lisp usage.
Would've been nice to go into more detail about language features that exist exclusively in each one. Like the difference between CLOS and Clojure Records/Protocols or Schemes call/cc vs Common Lisps unwind-protect
@@GavinFreeborn So much you could talk about with that. I a lot of comparisons tend to focus on things like Lisp-1 vs Lisp-2, scoping, and less so language / library features common to major implementations. HOPL has 100~ page documents on the history of emacs lisp, clojure, and pre-common lisp to late 90s common lisp. One thing that I didn't realize about common lisp is that common lisp is a lot more imperative and embracing of mutation than either clojure or scheme-- I'd like to see more content about imperative lisp usage like: setf, progn-go, do, dotimes, dolist, loop-return, some of which have even made it into clojure in modified/functional form like dotimes and loop-recur. Also conditions and restarts seem to only exist in common/emacs lisp land at least at that level of integration. A fun topic about lisp is the relationship about objects and closures as well.
Got here from SystemCrafters stream. Thank you for this content, always wanted to start learning common-lisp but never had a good justification for time investment
In the right split window at 18:00, it is unreadable - dark grey on light black? You should go for a stronger contrast when doing videos. And a much bigger font wouldn't hurt, too, when showing only few lines of short demo code. I understand that you might use a small font on real work, where you prefer having much of it on the screen.
Hi, thanks for your video! I knew quite little about Lisp. What got my interest here and made me also watch your video is 2 things. First I was exploring more information about Emacs and whether it might be something I want to use (I still don't know). I am a software engineer and a Linux hobbyist. Second reson is the Rust programming language, because it has some influence on it from Lisp, which made me curious. Rust has a several functional programming features, but it also has an extremely powerful macro system, unseen in most other languages. I have people seen comparing that aspect with Lisp, and describing how special that is.
i wrote myself few common lisp utilities (one for example removes duplicate lines in files) just to try and used emacs for almost a year, few years ago...but my issue is that after a month or so I have no idea how it works anymore xD. Then compare it to for example rust, I totally see whats going on on first glance. Maybe thats just my brain being used to something, but i still feel that having "less syntax" leads to longer read time.
I've definitions felt that way before. Though its often resolved by keeping functions small and and extensive use of `let`. I also fine clojure's thread macro comes in handy
Been wanting to learn Clojure or Common Lisp. Although Clojure seems really cool (it introduced me to LISPs), I was never able to get the environment setup in Emacs like i saw people do it. Then on top of that, I just don't like the the Java Interop code looks -- just puts me off. I'm actually turning to Common Lisp to see if setting it up is easier. I don't know if anything I want to do can be done in CL though. It just seems like a freaking cool language.
No matter what language you use for programming - it can be only an inspiriation or a means for your program to be executed on a computer. Your imagination and the flexibility of your thinking is much more important and always will be the most important thing. Going from Turing to Lambda for sure increases you capability to think 🥰
Thank you for such a detailed introduction to lisp! I do decide to have a try. Struggling in shell script's "string world" is really not a good experience for me.😂😂😂
Great video, It was one of my plans for future, I'm more excited now to start learning it. 7:07 May I ask, how did you put the term (1 *2) in brackets after selecting it visually ? Is that an Emacs package?
When I learn lisp, I probably will start with common lisp. I would end up picking scheme since I do plan to go through SICP in the future, but I'm gonna stay away from Clojure, unless it comes up during the work. Mostly because I rather avoid the JVM. Having said that, it is just a me problem. If you do want to try out Clojure, go ahead.
Ya Clojure's biggest biggest weakness as well as one of its strengths is the JVM. I have only used it for small work projects since we use Java in my day job. The language is really cool but dealing with java is a pain. ClojureScript on the other hand is something I have considered playing with but I'm not much of a front end guy.
@@GavinFreeborn Yeah, I don't deal with frontend either. This is why I don't mention JS to potential employers, since they would end up offering me frontend positions as a result. As for JVM, I dealt with Java and a fanatic user in the past. I am in no hurry to repeat the experience.
Check out graalvm and babashka (native & JVM-less clojure). There's also clojure clr that runs on dot net instead of the JVM. Obviously the JVM interop is a big selling point of clojure, but it's not a prerequisite. (Also most modern lisps, like python's Hy, follow clojure's syntax)
tbh jobs are the main thing that is stopping me from learning a LISP. There is near to 0 jobs for CL in webdev, and the most popular implementation related to the JVM (Clojure), well, i'm afraid that it traps me on the java ecosystem, as i'm manly a javascript dev (node, react, etc). I know that clojurescript exists but on every job request around the web, clojure comes with java, spring, and jvm related things :(
Side note I don't know of any clojure developer that uses spring since it's obsolete thanks to static typing and dynamic dispatch. Totally understand your situation. I only get to use lisp for work every now and then when my team needs something done fast. On the JavaScript side you are definitely right about cljs being the only real option. Though I wouldn't get too worried about fighting the java pains unless you are doing Interop (often unnecessary) since clojure is kinda its own ecosystem where some projects will piggyback off of some of the jvms features. Tbh Interop kinda sucks in every language so imo it's not as different as you would expect.
If know several languages from completely different paradigms, that actually looks good on your resume. It signals to your potential employers that you are passionate about programming, and are open to learning new things if need be. Considering the fact that the world's highest paid programmers are lispers, you probably have more valid reasons to learn a lisp than not to learn a lisp. I also find learning new ecosystems burdensome, but if you've already managed to find your way around one of the largest ones, you'll probably do just fine.
used to use clojure for a bit but went back to C and similar languages because the jvm was jsut too slow for my taste, tho maybe I might give common lisp a try one day.
Nice! Clojure is a great language but sadly stuck on a bad runtime. Jvm has its pros and cons but for personal use it's hard to sell clojure unless you are making some sorta webservice
@@GavinFreeborn yeah most of my personal use is just contributing to open source projects(which mostly are written in C) or writing tools that need to operate on hundreds to thousands of files and therefor need to be pretty fast to be even remotely viable
I think the non-static typing is something that makes me feel a bit uneasy about Lisp, and I can never quite imagine building anything significant with it. That said, maybe I’ll get around to playing with Overtone in Clojure some time to play with musical patterns.
Ya dynamic typing is something that scares a lot of people away from lisp. There are different approaches in different lisps to overcome some of its pain points. Common Lisp actually supports an imo powerful type system so you can add static types where needed for both performance and safety. Clojure on the other hand uses spec which can be used to enforce types given to a function, generate tests, generate example input and much more.
@@GavinFreeborn Yeah, I always got the feeling that if I dived into it a bit deeper I'd find there were some interesting aspects to how types can be dealt with... I know a couple of people who are keen on Lisp who I have very high opinions of, making me think that my misgivings may be superficial... just somehow never had any strong motivation to start a project with it. I can feel temptation welling up, but probably need to get some things done first.
@@ghollisjr The point of static typing is compile time type checking. You can catch errors before they even happen, not to talk of the performance benefits of not having to store types at runtime
I was initially put off for the same reason but soon came to realize that lisps just aren't like your average mainstream dynamic language. They have more potential for polymorphism than any other language families or programming paradigms and operate at such a high level of freedom and openness that you'll only be limiting yourself by introducing type systems. Type systems can be really powerful and secure when done right (e.g., Rust and Haskell). Lisps just happen to have different goals and usecases.
Hi Gavin tks for the video. I've just started exploring the lisp world. I work with "data" and got curious with the idea of code as data and whatnot actually. I work a lot with python and SQL and I think both miss the point of what is data and how it relates to information. This makes the life's of people working in "data" teams a real struggle. I was exploring the concepts behind datomic in the closure scene but I still think they miss important points like the very definition of data and modeling data although I really appreciate how they give importance to time and immutability therefore auditability. However, concepts like fact and datom are problematic on my opinion.
The example of homoiconicity was a bit lacking IMO. Would have been very valuable if you went ahead and did some manipulation of that list. That would have really driven home the 'code is data' part and would have connected nicely with the macros. Though I imagine it would have blown up the video scope quite a bit. Thanks for the awesome video.
Ya I would have loved to give a better example of it but like you said I didn't want to make the video too long to sit through. Will likely make another video in the future on the topic.
MIT professors make a comment in one of their teaching videos that "pointy hair administers" told them to stop teaching LISP and teach languages that were used in industry.
I actually started to learn Common Lisp a few weeks ago, just for a week-end. I immediately understood why macros are so powerful, and that I really wanted to learn it (I too learnt TCL the same week, great as well). I'm a bit busy right now, currently writing a (kinda) book on Haskell, just to have all the concepts in one place. I don't want to scroll the entire f*cking web every time something slips my mind. So I'm not easily overwhelmed. I guess CL is the way to go for me, even if I admit almost every scheme seems great in its own way. However, something kinda bother me. It really seems that NONE of the implementations of either Lisp or Scheme are complete enough to satisfy about everybody. The ecosystem is a mess. This lead to very incomplete compilers, sadly.
I'd say sbcl is pretty much the gold standard when it comes to satisfying all domains. Not as theoretical or teaching focused as something like racket but it is often the one I reach for.
@@GavinFreeborn Yeah, that's what people told me. But I've read a bit the compiler, there are still a lot to do on basic components even if it's the standard compiler. I mean, Zig actually is more advanced that this despite being developed for only a few years. That's a bit weird to me.
@@GavinFreeborn Sure. First thing that comes to mind is the windows port, which seems to be experimental. I'm not a fan of Windows (for a billion excellent reasons), but having the same experience for all systems is a must. At least for something that exists for decades. Also, I see that some implementations of Lisp exist for micro-controllers, and I think it shouldn't be. The same implementation should cover both extremely small systems and powerful ones. The entire awesome aspect of Lisp actually is to be modular like no other languages, and it still isn't modular enough to select features to include in the final binary, one must use an entire different compiler and language. After that, I do have some concerns about the repository. INSTALL file wasn't updated for ages (it mentions Linux 2.6 and OpenBSD 3.5 :-D). Don't know what's going on, seemed almost just left there to rot. The dozen scripts at the root directory of the repository seemed weird, too. That seems a bit hacky. Also, the policy for the optimizer seems too complicated than it has to be, according to the TODO in the SBCL repos. But I don't know, it may have been fixed ten years ago. I wanted to know a bit about cross-compilation, but I guess the repository isn't the way to go. First line of the README in doc/ "SBCL is -- ahem! -- imperfectly documented." So yeah. I've not a great confidence in the quality of the code, seeing all of this.
@@beauteetmusculation8191 most of these complaints are reasonable. Windows support I believe is still considered incomplete due to some sbcl extensions still not being implemented but many people have used it years ago without issue so I'm not completely sure what is missing. For the install documentation it's just meant to be the oldest supported version of those platforms. I assume they don't have exact versions for all platforms. On the side of some architectures not being supported by sbcl it's just die to limited resources. ecl (embedded common lisp) is a better fit since it compiles to C. Not ideal I know but it's a lot easier. On the topic of not including the whole runtime with the executable this is possible even without installing it but as a result you lose the ability to use `eval` at runtime. I believe Zig does something similar.
What do you mean by lisp can be as performed as C++ or C? How? What did make you think so? Is not lisp when it comes to speed more like python? Did you mean you could generate C code from lisp and than the generated program is as fast as C? If it can be so performant why are people not writing big photorealistic 3d games in it like they do in C, C++? I am thinking of learning lisp but not sure if it’s worth it, I am thinking should I write my lisp in C++ or better embed existing lisp into a project?
I admit this was an overstatement since in most cases lisp won't out perform C and GC will slow things down eventually. However, it has been used to write 3d games in it. The Jak games (1 ans 2 at least) for the PS2 where all considered technical achievements and written in a dialog of lisp called GOAL. Big reason this isn't as popular is because few people actually wanna write the ground work to do such a thing themselves. In general speed though it's substantial faster than something like python by a magnitude of 100 or more. Here are some benchmarks for reference sites.google.com/view/energy-efficiency-languages/results
Are C macros homoiconic? You can defer expansion, which might be a parallel to the quote, edit the data, and later execute(expand) it. Although it's quite messy.
In the context of your video your reasoning makes senses. However, there is a bit more to it than evaluating later. Maybe something I could have covered in the video. The issue is manipulating and extracting data from code. For example in clojure you use `first` to get the first value from a sequence. If the sequence is just quoted lisp code (aka a list) then it will get the function. This could then be used for anything like using that same function to evaluate against a new set of arguments. There isn't really a parallel in C macros as far as I know.
@@GavinFreeborn This might not be homoiconicity, but you can e.g. do the following: #define APPLY(f,x) f x #define TUPLE_AT_1(a,...) a #define FOO(x) #x #define TUPLE (FOO,BAR,BAZ) APPLY(APPLY(TUPLE_AT_1,TUPLE), (APPLY(TUPLE_AT_1,TUPLE))) Here TUPLE is both used as data and called on itself. The first element is extracted twice and then called with itself as an argument. So it expands to "FOO"
@@oj0024 I'd say to some extent that definitely is an example of homoiconicity. Honestly if C macros didn't have the whole newline \ pain they would probably be really useful for extending C.
To my mind, homoiconicity isn't the core difference between C macros and Lisp macros. The core difference is the existence of a preprocessor. In C, the preprocessor is a program separate to the compiler itself. It reads in a C file, and parses it for what is in effect a second programming language, the language of C preprocessor directives. These are completely different to C itself, and they lack a whole lot of the power that C has. The C preprocessor, not being able to run C itself, can't evaluate parts of the code it's passed - it can only modify the string representation to change what the compiler does with it. This means there are a while bunch of things you just can't do with the C preprocessor. By contrast, Lisp languages don't have a preprocessor: when you write a macro it is a normal lisp function like any other. The only differences are that the macro happens to run at compile time, and is passed its arguments unevaluated - it can evaluate them at compile time, or rearrange them arbitrarily, or do fundamentally whatever it wants using the whole power of the Lisp language. Homoiconicity helps in Lisp macros: given Lisp code is expressed in lists, which are just a standard Lisp data type, you can use all the standard library functions for manipulating Lisp code within your macros. But it isn't the core difference. For instance, modifying python code can be done within python, using the AST module. This has the same advantage as Lisp when compared to C: you can modify a python AST using all of the power of python. The lack of homoiconicity for macros in python makes this a bit more of a pain, I think, but you still have the full power of Python available to do it with. Where as unfortunately in C, you just don't.
Unfortunately, borrow checking is a pretty new concept so there currently is only Carp which replicates it. There has been a recent push for other languages with Manual memory management but there are few that have first class support for it. gitlab.com/flatwhatson/guile-prescheme is a recent attempt to revive a prescheme a manual memory managed lisp. dustycloud.org/blog/guile-steel-smelting-pot/ Is a recent blog post about the topic and has gained some traction
Tried lisp before , not having an editor built for lisp , makes it a pain to code in. Many of the function names and syntax are wierd. Simple printing has this wierd function. Why use car cdr when first and last is more intuitive. The cli is painful to work in. How dyu run a program or get thru a screenful of errors? What about documentation to lookup function names etc there's a reason some languages succeed more than others. Some are simply more usable.
In my completely bias opinion I'd say it is for multiple things. As far as mixing c++ and lisp it's hard to say since there are multiple lisps to look at. If you look at common lisp (as mentioned one of the more popular lisps) then clasp is a new common lisp implementation built to work on llvm meaning that you can have relatively easy Interop with clang.
Lisps won't dethrone Python in what Python is good for. Likewise Python can't dethrone lisps in what they are good for. This is why you should learn multiple languages, preferably from different paradigms. If you're just starting to learn programming I would suggest that you go with Python, simply because very few people learn programming with lisps these days. After you've got to intermediate level in Python and have an arsenal of personal projects, then you may learn a new language to broaden your horizon. My personal recommendation: follow this track Python -> Go -> Clojure/Racket -> Rust -> Haskell.
I think at this point Racket should be separated from Scheme, Racket is different from Scheme, even Matt the guy maintaining it has said so. And don't forget the most important lisp of them all, Emacs Lisp to confuse and scare unix users all over the world 😈
I agree every time I go back to racket I feel like it's becoming less and less like scheme to the point it almost doesn't feel lispy to work with. But maybe that last part is just me.
THe simple syntax is the biggest problem of LISP, it's all just paranthesis, nothing to help the brain to visually understand the code fast. It's so unbelievable why so many people just dont get it. Logo, Rebol and Dylan were the more interesting Lisp variants that tried to get away from it.
I definitely see where you are coming from. An if statement in C is way quicker to reason about than in lisp. Though I find small functions, clear function/variable names and extensive use of let helps resolve this. It is kinda a double edged sword. While more complex syntax can boost readability it can also lead to edge cases, undefined behaviour, and worst of all code complexity.
I find it helps to put closing parentheses at the same indentation level as their corresponding openers. This does mean putting them on their own lines. Here’s a moderately complex example: (defun convert-to-region-codes (beg end) "converts alphabetic characters in the selection to “region indicator symbols”." (interactive "*r") (unless (use-region-p) (ding) (keyboard-quit) ) ; unless (let ( deactivate-mark (intext (delete-and-extract-region beg end)) c ) (dotimes (i (- end beg)) (setq c (elt intext i)) (cond ((and (>= c ?A) (= c ?a) (
What's stopping me from learning LISP? Other things are way more important to learn to build a project and being productive, whereas LISP is only something interesting that won't be used "on production" in the near future. It's great, but instead of learning yet another programming language, I'd rather learn something new about distributed systems/Web3/Databases, etc. So It's at the end of this long list now.
You can learn multiple if these are the same time as learning lisp. Best way to learn new tools is using them in a project and lisp is a great language for learning new technology
In my experience, this is not a helpful way to look at things. If you think hard enough, you'll come to realize that our time, attention, focus, or whatever aren't actually like currencies. They aren't exchangeable, replaceable, or convertible. The mental fatigue you receive from a long session of learning a web framework, for example, doesn't really influence your capacity to learn a new language or style of programming. You can concurrently manage all these goals of yours and achieve far more in a unit of time than if you were to tackle them one by one. That's just how humans work, imo.
@@biskitpagla And that's a correct way of thinking, but who is talking about learning things one by one, I mentioned instead that focusing on learning things that you won't use in practice leads to nowhere. I can create a sticker like "I know LISP" but what next? Instead of lisp, you can pick a language like a scala or an elixir, and it'd be valuable on the market at least. And I'm not hating lisp, it's excellent and powerful, but the core disadvantage is that's not adopted widely, so in practice - useless. Tbh only thing now that motivates me to learn it in detail is emacs. BTW learning a new framework and language at the same time slows you(at least me) down a lot - I did it several times in many ways and learning a new framework for java (which is my core language) and learning new framework with learning python at the same time is not faster at all. From my experience, mixing is the best option, you lose time on switching contexts but new skills are more "durable" let's say.
Looks like a good language for personal project but I wouldn't want someone to evaluate and manipulate code as data on my car autopilot program, I would rather it be type safety simple understandable unsophisitcated like java
It's very unlikely that you'll ship your development environment in a production situation such as this. Considering you're comfortable with the Java ecosystem, you should check out Clojure. It runs on the JVM and so enjoys the security features of that runtime.
Lisp has some two dozen "special forms" which significantly complicate the syntax. Special forms have very different behaviours from regular Lisp expressions. As useful as they are, macros also complicate language usage.
well special forms can make development very easy and seamless and macros can shield us from directly interacting with most of special forms. which special form would you throw out?)
I actually have recently started learning lisp, but likely won’t use it. For me the main thing I program for is statistics and graphing. Lisp does not serve these tasks well. So I will end up sticking to matlab and r.
As someone who gets paid to write python nearly every day I only wish python had all the features I mentioned in this video. IMO python would be a far more enjoyable if it had tried to be a bit more like lisp. Though let's admit, I am bias
Figured it wasn't distinct enough for me to give it a dedicated section. Though watching it back I should have. If you are interested it's basically CL with less features and defaults to dynamic scope. I plan to go further into differences between lisps later on.
There is code that looks elegant. And then there is code that functions elegantly. Lisps tend to aid with the latter. Once you've overcome the initial 1 foot long barrier of S expressions, you'll find that lisps enable you to cross entire mountains.
There are plenty of companies that have happily moved to using Clojure and ClojureScript in production. I could definitely see an argument against scheme, and CL considering the only major company making us of them I know of is Grammarly.
You haven't shown anything that is convincing. I don't find C to be that hard , so why would I use Lisp which seems to be a bit of a mindbender with respect to getting a program to make sense . Remember , I'm not a compiler so a syntax tree means nothing to me really
Probably the biggest one even if you don't understand why the other points are so great would be the ability to test and manipulate an application while it's still running. May not sound like much but having to wait for an entire browser to compile just to go to a site and find out your change didn't fix it can completely hult productivity(in some cases for hours). For an example take a look at ua-cam.com/video/6pMyhrDcMzw/v-deo.html if you don't see the advantage there than I can't really help you. You may just need to try any other language to get an idea of the other possibilities that exist in the world.
@@GavinFreeborn I found Specman-e from Cadence to be one of the most powerful programming language I ever encountered. It supported regex search-replace macros, back in time debugging, aspect oriented programming, constrained random generation, and many other cool things...unfortunately it was only destined for hardware verification and not for software development. I think it's a pity, it would've been a great software language.
@@h0stI13 sounds interesting. Only experimenting I have done with hardware verification was playing with ACL2 mostly just to see what it's like. I'll have to see what's possible with soecman
None of these is a compelling reason for learning Lisp. BASIC has a simple syntax, many languages have REPL, many languages allow treating code as data, that should be a compelling reason to learn these too, no? Also, macros, interactivity, homoiconicity and such are all great until one needs to consume an AWS service or even just to parse some JSON over network - suddenly Lisp loses all its power that unwashed pythonistas are at least 10x more productive than you. And I don't even want to start on dictionary driven programming in Clojure.
Uh idk why you think working with json in lisp would be difficult? There are plenty of options for networking in each of the mentioned Lisps. I don't really see your point. The libs just parse the converting it into a sexp. Many Lisps even come with json parsing included like emacs-lisp and clojure. So you still get to use the same functions you would use else where. The process for such a task would be pretty straight forward is there something I'm missing? Your other points are kinda missing the point that Lisp does all these things not just a few. Also comparing nearly any REPL to that of mosy Lisps makes sense until your realize they have a feature set that competes with most language servers. Most languages REPLs don't provide error recovery, profiling, decompiling, jump to definition, etc.
I like how anti-Lispers have universally clung to this laughable argument that since some particular languages have adopted (or more like shittily imitated) some particular lisp features, they are all suddenly as good as lisp. Well, unless you have adopted ALL of those killer features (or appropriate counterparts) in a SINGLE language, bruh, you are OUT OF YOUR depth. It's just that when you do pull that off, you will find that what you got is simply a dialect of lisp.
Python does offer most of the functionality you get with LISP, including functions and classes as first-class objects. The main thing missing is syntax-based macros.
Just a note at the beginning. CL, Scheme and Clojure are not "implementations" of LISP but rather different languages in the Lisp-family of languages, or more simply different Lisp dialects, and as you've mentioned each of them have multiple implementations. Also Clojure is by far the most popular Lisp nowadays.
Love Clojure….
Ya I definitely should have called them dialects haha, Ya probably should have been clear that when I say popular more people likely have used CL just because many universities used to use it for AI classes.
Scheme is very different from traditional LISP. Traditional LISP has separate namespaces for function names versus variable names (i.e. you can have one of each with the same name), while Scheme unifies the namespaces.
Also, traditional LISPs don’t seem to have continuations, Scheme does.
Still, the popularity of Clojure has been waning in recent years. As of this month, Clojure is outside of the Top 50 at TIOBE. Clojure is no longer on PYPL's list, nor on RedMonk's list. And Clojure is at #39 on IEEE Spectrum's list.
At least regular Lisp is #30 at TIOBE. 😄 That's something.
@@horridohobbies imagine caring about Tiobe Index. It's completely flawed and irrelevant.
I had looked into lisp early last year, and couldn't wrap my head around the bracketing syntax. It all makes sense after you explained it as building an abstract syntax tree! Thanks for the paradigm shift!
Happy I was able to helped! Was a little concerned that mentioning an AST would overwhelming viewers..
I've been using Autolisp and Visual Lisp for almost 20 years, it's one of the most elegant programming language I've known. This come from a person who also know C, C# and Visual Basic.
I just imagine a Pac-man-like entity nibbling the expression from its opening.
Each s-expression is a list. Each list is a chain of cons cells. Eats it one by one. And each list hides an empty list () at the end. It's like a portal for the said Pac-man to burp his result down.
Autolisp?? That’s just a LISP with the weird syntax but without all the good LISP stuff.
is just function invocation/application, a simpler function application syntax
std function invocation syntax: my_fun(arg0, arg1)
Lisp function invocation syntax: (my_fun arg0 arg1)
so if you have something a bit more nested like
std: f1( f2(arg0), f3(arg1) )
lisp: (f1 (f2 arg0) (f3 arg1))
To cut a really long story short, frustration with some other languages have lead me to make my own language, with the compiler written in Common Lisp. The language is also s-expressions, so we just use the lisp reader and walk the AST right into LLVM. We basically get to skip writing like 80% of the compiler, and honestly I'm wondering why on Earth anyone bothers with other syntaxes at all. Using Common Lisp has been a blast and honestly I am wondering if I should just drop the new language and do everything in CL.
While I love CL idk if I'd write everything in it. I do find the ecosystem to be a bit overwhelming. I find myself wishing there was a standard project and build system. asdf+ql comes close but often projects mix and match too many things. You end up with autotools/makefiles trying to hide it all from the user resulting in a ton of system incompatibility. I think Roswell while still in its infancy is a reasonable option. Though it's lack of adoption and lack of community interest gives me the feeling it's not going anywhere.
Can you really get to the C, C++ speed?
Have you made the language public ? If so can you please give the link for the repo, thanks.
@@openroomxyz you can approach that by giving compiler hints to go for full speed vs debuggability/safety: il will remove many safety nets (errors cheking..). you can program more with arrays, too if you'd like to go in that direction. The recommend way, though, is to write a correct, featureful program first (keeping a conscious eye on perf), and then only, if necessary, go to optimize the critical parts ...
@@GavinFreeborn I use Common Lisp mostly for "creative programming", i.e. I have an idea I want to see in action quickly. What you refer to sounds a bit more like "writing a serious application which ends in a binary". Since I did not seriously try to accomplish something like that, I take away from your post, that it seems to be more involved than just (save-lisp-and-die).
The one thing I would love to see better supported in the CL ecosystem is the ability to use it as a scripting language in other applications. ECL kind of promises that, but when playing with integrating CL into some C++ application it is not as fun an experience as I would have hoped for. SBCL on the other hand, you can build as shared library. But the amount of tutorials and examples out there on the internet is quite sparse. No free lunch. I think, CL is a perfect fit for the "scripting language in other application" use case and someone should turn it into a free lunch, so it is easy for everyone to do it.
Wow. I haven't touched this one for 30+ yet. Back then, it was one of the best AI languages. The fastest machine that was available to us was x286 (the IBM AT) and we were running common lisp.
I remember working on a project in the mid 2000s where I was trying to build a lab inventory management system using LispWorks. The app was killed before it was ever finished, but the time I spent learning lisp and it’s features was time incredibly well spent for helping me to learn how to think about solving problems and it educated me about how a language can influence the the thoughts you can have and the solutions you can come up with.
I always tell people that lisp bent my mind in all the best ways and I always think of it fondly.
I my experience you can always use that experience to write small and dirty "programs" with clisp, for instance... that's what I do: dev. is as fast as python (when you still have lisp "in your fingers"), and more fun
Beautiful presentation, looking forward to learning it this year.
I have no idea why Kent Dybvig called his implementation "Chez Scheme", but "chez" is a French word, meaning "at the house of" or "at the home of", and is pronounced "shay". As in, for example "Chez Panisse", Alice Waters' famous restaurant in Berkeley, CA.
This is only a guess, but Proust wrote a very famous novel, whose original title in French: _Du Côté de Chez Swann_ . I have always wondered if it was a pun on this specific title as _Chez Swann_ and _Chez Scheme_ shares a certain resemblance. But it is quite far stretched I definitely agree... :-)
My french is poor, but to my knowledge "chez" only means "at", so get rid of the "house" or "home". In France, every third café or bar is called "Chez Michelle" or "Café Chez Rique" and means the same as the "`s" in "Rick's Cafe". Well - only nearly, too.
@@unbekannter_Nutzer "chez" from french dictionary:
come from latin "casa" which mean "hutte";
Indique une localisation dans la maison, le pays, l'oeuvre de quelqu'un, la présence de quelque chose dans le comportement de quelqu'un.
Indicates a location in someone's house, country, work, presence of something in someone's behavior.
racket is the way to go for :
- a very nice IDE, drracket;
- one of the best documentation I ever seen;
- a lot of librairies about any topics
- and in scheme, a lot of very nice teaching material available.
How is it different than common lisp? Does it restrict you in some way?
@@openroomxyz to say the truth, I don't know because I never used CL.
why?
because, before everything, you must figure out how to run emacs with CL, and waste a lot of time;
and I never found on YT any good lectures about CL;
DcRacket works fine out of the box!
and you have 5 nice lectures from Stanford and 20 and more lectures from MIT in scheme.
Stanford lecture 19 to 23 of programming paradigms
ua-cam.com/video/_cV8NWQCxnE/v-deo.html
MIT they talk about LISP but it's not CL but the people who made scheme : the birth of scheme
ua-cam.com/video/-J_xL4IGhJA/v-deo.html
@@openroomxyz You're bound to doing things THEIR way which is sometimes the hard way or just not very useful to the way you want to approach a problem. If you already know C and are familiar with Linux, just learn one of the Schemes with a C FFI. That way your Scheme programs can extend to say the glibc, and you can do anything you'd do from c (syscalls, file i/o, etc etc).
You convinced me that I definetelly should give Lisp a try. After learning F# I understood that programming can be much more powerful than stupid OOP and it gave me my interest in programming back. Now I understand that it can be even more powerful than I can comprehend now and I will never truly understand it before I check it myself and learn new higher-level techniques. Functional programming already made me a better developer. I hope that homoiconicity, macros, code as data will make me even better :)
Functional programming isn't mutually exclusive with object-oriented programming. Common Lisp has an object system (although it works quite differently from languages based on C++ tradition)
@@xGOKOPx IMO, one of the most important properties of FP is immutability. OOP on the other hand is all about mutable local state. So, I disagree, they are mutually exclusive. IMO, if language is trying to be hybrid of OOP and FP then it means it's not FP, but just have some elements of FP. Because FP is more strict and mixing it with OOP requires relaxation of it's constraints. But relaxed FP is not FP anymore. Because FP is all about constraints. For example one of my favorite languages F# is not fully-functional. It's just functional-first and it's positioned like that by it's creator. I think it's fair to call things as they are.
OOP is the biggest false prophet in programming. I'm sure if any OO programmer chooses to expand their horizons and learn other paradigms (as I have), they will come to realize how fundamentally defeated OOP is in it's promises. The only good thing about of OOness is polymorphism, and ironically whatever OO languages provide in this area are limited by it's biggest flaw: rigid, unintuitive, ever growing inheritence hierarchies.
I feel offended that you should call oop stupid. Oop is elegant and beautiful, if you see it. Besides no programming language can exist smoothly without adopting some oop view. Oop is inevitable
@@collinsa8909 whatever
Very interesting, I got a little into lisp for my emacs config, but now you convinced me to try it out for some other things as well
The best reason for learning Lisp is for how well it covers many paradigms. You've got the CLOS, you've got first class functions with optional arguments, named arguments, defaulted arguments, and variadic arguments. You've got notions of streams of data. Not to mention the ability to truly extend the language at the syntax level via macros which are quite different than text substitution. SBCL is a very good implementation of Common Lisp - it's faster than you might expect and the compiler writers are always adding new tweaks to make it faster. If you want a minimal pure Lisp consider a Scheme like Chicken. If you learn Common Lisp you'll also learn quite a bit of Emacs Lisp since they sort of share a similar branch on the family tree (there are differences though).
I was on the fence about spending time to learn Lisp this year or not, but you convinced me to do so. I think I'll start out by learning Scheme and then I'll probably move on to CL or emacs Lisp.
Let’s do it!
Note that the only reasonable reason to learn Emacs Lisp (instead of any other Lisp) is if you wanna configure or extend Emacs
I have yet to use lisp yet, but already knew how basic math was written in it, and didn't really understand why however. I never got why it was written like '+ 1 1' instead of the more natural '1 + 1'. But your explanation on how it actually gets evaluated really clears that up. And also makes sense that this more literal robust method makes the order of operations always clear.
Happy to hear!
if you know C, any program begin like this :
int main(int argc, char* argv[])
in "argv" you have an array of null terminated string;
in the first slot, the name of the program,
and in the other one, the arguments to be passed to that function;
you just have to think that all function call in lisp or scheme are just a list (instead of array of string) like the argv in C main function.
It’s called Polish Notation
I love CL so much that implement everything in it and if I need to use another language, I just write a DSL that output code in the other language.
Lisp wasn’t a language until 1960 when MccCarthy published his paper on a list processor. Another gentleman read the paper and built and compiled becoming the first Lisp usage.
Would've been nice to go into more detail about language features that exist exclusively in each one. Like the difference between CLOS and Clojure Records/Protocols or Schemes call/cc vs Common Lisps unwind-protect
I have a video planned for this very topic so any ideas for comparison are welcome..
@@GavinFreeborn So much you could talk about with that. I a lot of comparisons tend to focus on things like Lisp-1 vs Lisp-2, scoping, and less so language / library features common to major implementations. HOPL has 100~ page documents on the history of emacs lisp, clojure, and pre-common lisp to late 90s common lisp. One thing that I didn't realize about common lisp is that common lisp is a lot more imperative and embracing of mutation than either clojure or scheme-- I'd like to see more content about imperative lisp usage like: setf, progn-go, do, dotimes, dolist, loop-return, some of which have even made it into clojure in modified/functional form like dotimes and loop-recur. Also conditions and restarts seem to only exist in common/emacs lisp land at least at that level of integration. A fun topic about lisp is the relationship about objects and closures as well.
@@mksybr wow thanks for all the suggestions!
I was going to bail when the s-exp explanation started, however you made it very, very understandable. Thanks!
Got here from SystemCrafters stream. Thank you for this content, always wanted to start learning common-lisp but never had a good justification for time investment
What is stopping me learning Lisp in 2022 is the fact that we're in 2024. But I just started to learn it and I'm quite excited.
Extremly excited to start learning SBCL, i was initially very impressed by it's handling of spacing compared to Python (Indent) and C (Semicolons)
nice explanation, I actually hadn't considered the value of disambiguation of the syntax tree in lisps. So true though.
you definitely sold me on lisp, closure specially I have tried lisp in the past but was underwhelmed by it compared to haskell
In the right split window at 18:00, it is unreadable - dark grey on light black? You should go for a stronger contrast when doing videos.
And a much bigger font wouldn't hurt, too, when showing only few lines of short demo code. I understand that you might use a small font on real work, where you prefer having much of it on the screen.
Hi, thanks for your video! I knew quite little about Lisp. What got my interest here and made me also watch your video is 2 things.
First I was exploring more information about Emacs and whether it might be something I want to use (I still don't know). I am a software engineer and a Linux hobbyist.
Second reson is the Rust programming language, because it has some influence on it from Lisp, which made me curious. Rust has a several functional programming features, but it also has an extremely powerful macro system, unseen in most other languages. I have people seen comparing that aspect with Lisp, and describing how special that is.
i wrote myself few common lisp utilities (one for example removes duplicate lines in files) just to try and used emacs for almost a year, few years ago...but my issue is that after a month or so I have no idea how it works anymore xD. Then compare it to for example rust, I totally see whats going on on first glance. Maybe thats just my brain being used to something, but i still feel that having "less syntax" leads to longer read time.
I've definitions felt that way before. Though its often resolved by keeping functions small and and extensive use of `let`. I also fine clojure's thread macro comes in handy
Awesome video, can you upload more videos related to lisp I am pretty, astonished by seeing it's power
I have some planned so stay tooned.
@@GavinFreeborn can I get your Twitter link 🔗
@@_q1b_ sorry I don't use Twitter.
Awesome video, my friend..!!
The google algorithm brought me here and
you just got a like and a new subscriber.
Awesome video. Thanks! 🙏
Been wanting to learn Clojure or Common Lisp. Although Clojure seems really cool (it introduced me to LISPs), I was never able to get the environment setup in Emacs like i saw people do it. Then on top of that, I just don't like the the Java Interop code looks -- just puts me off. I'm actually turning to Common Lisp to see if setting it up is easier. I don't know if anything I want to do can be done in CL though. It just seems like a freaking cool language.
No matter what language you use for programming - it can be only an inspiriation or a means for your program to be executed on a computer. Your imagination and the flexibility of your thinking is much more important and always will be the most important thing. Going from Turing to Lambda for sure increases you capability to think 🥰
Thank you for such a detailed introduction to lisp! I do decide to have a try. Struggling in shell script's "string world" is really not a good experience for me.😂😂😂
You could explicit comment about Emacs Lisp since you used it in the examples! Nice video
Great video, It was one of my plans for future, I'm more excited now to start learning it.
7:07 May I ask, how did you put the term (1 *2) in brackets after selecting it visually ? Is that an Emacs package?
electric-pair-mode. Just select text and hit (
>2024
>2 years ago
🤔
You could also review Hy which has just reached version 1.0 now in Sept/2024
You should learn lisp because you already know all the languages that will pay off professionally.
Thank you for this very interesting video!
When I learn lisp, I probably will start with common lisp. I would end up picking scheme since I do plan to go through SICP in the future, but I'm gonna stay away from Clojure, unless it comes up during the work. Mostly because I rather avoid the JVM.
Having said that, it is just a me problem. If you do want to try out Clojure, go ahead.
Ya Clojure's biggest biggest weakness as well as one of its strengths is the JVM. I have only used it for small work projects since we use Java in my day job. The language is really cool but dealing with java is a pain. ClojureScript on the other hand is something I have considered playing with but I'm not much of a front end guy.
@@GavinFreeborn Yeah, I don't deal with frontend either. This is why I don't mention JS to potential employers, since they would end up offering me frontend positions as a result.
As for JVM, I dealt with Java and a fanatic user in the past. I am in no hurry to repeat the experience.
Check out graalvm and babashka (native & JVM-less clojure). There's also clojure clr that runs on dot net instead of the JVM. Obviously the JVM interop is a big selling point of clojure, but it's not a prerequisite. (Also most modern lisps, like python's Hy, follow clojure's syntax)
tbh jobs are the main thing that is stopping me from learning a LISP. There is near to 0 jobs for CL in webdev, and the most popular implementation related to the JVM (Clojure), well, i'm afraid that it traps me on the java ecosystem, as i'm manly a javascript dev (node, react, etc).
I know that clojurescript exists but on every job request around the web, clojure comes with java, spring, and jvm related things :(
Side note I don't know of any clojure developer that uses spring since it's obsolete thanks to static typing and dynamic dispatch. Totally understand your situation. I only get to use lisp for work every now and then when my team needs something done fast. On the JavaScript side you are definitely right about cljs being the only real option. Though I wouldn't get too worried about fighting the java pains unless you are doing Interop (often unnecessary) since clojure is kinda its own ecosystem where some projects will piggyback off of some of the jvms features. Tbh Interop kinda sucks in every language so imo it's not as different as you would expect.
If know several languages from completely different paradigms, that actually looks good on your resume. It signals to your potential employers that you are passionate about programming, and are open to learning new things if need be. Considering the fact that the world's highest paid programmers are lispers, you probably have more valid reasons to learn a lisp than not to learn a lisp.
I also find learning new ecosystems burdensome, but if you've already managed to find your way around one of the largest ones, you'll probably do just fine.
used to use clojure for a bit but went back to C and similar languages because the jvm was jsut too slow for my taste, tho maybe I might give common lisp a try one day.
Nice! Clojure is a great language but sadly stuck on a bad runtime. Jvm has its pros and cons but for personal use it's hard to sell clojure unless you are making some sorta webservice
@@GavinFreeborn yeah most of my personal use is just contributing to open source projects(which mostly are written in C) or writing tools that need to operate on hundreds to thousands of files and therefor need to be pretty fast to be even remotely viable
Who is learning LISP right now?
Thank you for making the video
I think the non-static typing is something that makes me feel a bit uneasy about Lisp, and I can never quite imagine building anything significant with it. That said, maybe I’ll get around to playing with Overtone in Clojure some time to play with musical patterns.
Ya dynamic typing is something that scares a lot of people away from lisp. There are different approaches in different lisps to overcome some of its pain points. Common Lisp actually supports an imo powerful type system so you can add static types where needed for both performance and safety.
Clojure on the other hand uses spec which can be used to enforce types given to a function, generate tests, generate example input and much more.
@@GavinFreeborn Yeah, I always got the feeling that if I dived into it a bit deeper I'd find there were some interesting aspects to how types can be dealt with... I know a couple of people who are keen on Lisp who I have very high opinions of, making me think that my misgivings may be superficial... just somehow never had any strong motivation to start a project with it. I can feel temptation welling up, but probably need to get some things done first.
@@ghollisjr The point of static typing is compile time type checking. You can catch errors before they even happen, not to talk of the performance benefits of not having to store types at runtime
I was initially put off for the same reason but soon came to realize that lisps just aren't like your average mainstream dynamic language. They have more potential for polymorphism than any other language families or programming paradigms and operate at such a high level of freedom and openness that you'll only be limiting yourself by introducing type systems. Type systems can be really powerful and secure when done right (e.g., Rust and Haskell). Lisps just happen to have different goals and usecases.
I think it would be great to talk about use cases of lisp, project ideas and job opportunities.
Thanks, very nice.
Very inspiring
Hi Gavin tks for the video. I've just started exploring the lisp world. I work with "data" and got curious with the idea of code as data and whatnot actually. I work a lot with python and SQL and I think both miss the point of what is data and how it relates to information. This makes the life's of people working in "data" teams a real struggle. I was exploring the concepts behind datomic in the closure scene but I still think they miss important points like the very definition of data and modeling data although I really appreciate how they give importance to time and immutability therefore auditability. However, concepts like fact and datom are problematic on my opinion.
I believe Chez Scheme is pronounced "Shay", like the French "chez moi".
The example of homoiconicity was a bit lacking IMO. Would have been very valuable if you went ahead and did some manipulation of that list. That would have really driven home the 'code is data' part and would have connected nicely with the macros. Though I imagine it would have blown up the video scope quite a bit. Thanks for the awesome video.
Ya I would have loved to give a better example of it but like you said I didn't want to make the video too long to sit through. Will likely make another video in the future on the topic.
Which font do you use here? Looks spiffy!
Terminus
@@GavinFreeborn thank you
It took me 2 months to learn Scheme after learning Common Lisp... It's not that easy. And there are still things I don't know, like the macros...
Beautiful font :) What is it's name???
Nicely explained
But much of Common Lisp(SBCL) is implemented in C, correct? Any CL implementation written diffferently?
Most are written in ANSI common lisp it's self. They compile down to machine code. One example is the popular sbcl.
Well done!
MIT professors make a comment in one of their teaching videos that "pointy hair administers" told them to stop teaching LISP and teach languages that were used in industry.
I actually started to learn Common Lisp a few weeks ago, just for a week-end. I immediately understood why macros are so powerful, and that I really wanted to learn it (I too learnt TCL the same week, great as well).
I'm a bit busy right now, currently writing a (kinda) book on Haskell, just to have all the concepts in one place. I don't want to scroll the entire f*cking web every time something slips my mind. So I'm not easily overwhelmed. I guess CL is the way to go for me, even if I admit almost every scheme seems great in its own way.
However, something kinda bother me. It really seems that NONE of the implementations of either Lisp or Scheme are complete enough to satisfy about everybody. The ecosystem is a mess. This lead to very incomplete compilers, sadly.
I'd say sbcl is pretty much the gold standard when it comes to satisfying all domains. Not as theoretical or teaching focused as something like racket but it is often the one I reach for.
@@GavinFreeborn Yeah, that's what people told me. But I've read a bit the compiler, there are still a lot to do on basic components even if it's the standard compiler. I mean, Zig actually is more advanced that this despite being developed for only a few years. That's a bit weird to me.
@@beauteetmusculation8191 mind giving an example?
@@GavinFreeborn Sure. First thing that comes to mind is the windows port, which seems to be experimental. I'm not a fan of Windows (for a billion excellent reasons), but having the same experience for all systems is a must. At least for something that exists for decades.
Also, I see that some implementations of Lisp exist for micro-controllers, and I think it shouldn't be. The same implementation should cover both extremely small systems and powerful ones. The entire awesome aspect of Lisp actually is to be modular like no other languages, and it still isn't modular enough to select features to include in the final binary, one must use an entire different compiler and language.
After that, I do have some concerns about the repository.
INSTALL file wasn't updated for ages (it mentions Linux 2.6 and OpenBSD 3.5 :-D). Don't know what's going on, seemed almost just left there to rot.
The dozen scripts at the root directory of the repository seemed weird, too. That seems a bit hacky.
Also, the policy for the optimizer seems too complicated than it has to be, according to the TODO in the SBCL repos. But I don't know, it may have been fixed ten years ago.
I wanted to know a bit about cross-compilation, but I guess the repository isn't the way to go. First line of the README in doc/ "SBCL is -- ahem! -- imperfectly documented."
So yeah. I've not a great confidence in the quality of the code, seeing all of this.
@@beauteetmusculation8191 most of these complaints are reasonable. Windows support I believe is still considered incomplete due to some sbcl extensions still not being implemented but many people have used it years ago without issue so I'm not completely sure what is missing. For the install documentation it's just meant to be the oldest supported version of those platforms. I assume they don't have exact versions for all platforms. On the side of some architectures not being supported by sbcl it's just die to limited resources. ecl (embedded common lisp) is a better fit since it compiles to C. Not ideal I know but it's a lot easier. On the topic of not including the whole runtime with the executable this is possible even without installing it but as a result you lose the ability to use `eval` at runtime. I believe Zig does something similar.
What do you mean by lisp can be as performed as C++ or C? How? What did make you think so? Is not lisp when it comes to speed more like python? Did you mean you could generate C code from lisp and than the generated program is as fast as C? If it can be so performant why are people not writing big photorealistic 3d games in it like they do in C, C++? I am thinking of learning lisp but not sure if it’s worth it, I am thinking should I write my lisp in C++ or better embed existing lisp into a project?
I admit this was an overstatement since in most cases lisp won't out perform C and GC will slow things down eventually. However, it has been used to write 3d games in it. The Jak games (1 ans 2 at least) for the PS2 where all considered technical achievements and written in a dialog of lisp called GOAL. Big reason this isn't as popular is because few people actually wanna write the ground work to do such a thing themselves. In general speed though it's substantial faster than something like python by a magnitude of 100 or more. Here are some benchmarks for reference sites.google.com/view/energy-efficiency-languages/results
So it all has to ru. On a JVM??? Why would I want java?
Aaaa yeah, yeah - no doubt - very convincing
Are C macros homoiconic?
You can defer expansion, which might be a parallel to the quote, edit the data, and later execute(expand) it. Although it's quite messy.
In the context of your video your reasoning makes senses. However, there is a bit more to it than evaluating later. Maybe something I could have covered in the video. The issue is manipulating and extracting data from code. For example in clojure you use `first` to get the first value from a sequence. If the sequence is just quoted lisp code (aka a list) then it will get the function. This could then be used for anything like using that same function to evaluate against a new set of arguments. There isn't really a parallel in C macros as far as I know.
@@GavinFreeborn This might not be homoiconicity, but you can e.g. do the following:
#define APPLY(f,x) f x
#define TUPLE_AT_1(a,...) a
#define FOO(x) #x
#define TUPLE (FOO,BAR,BAZ)
APPLY(APPLY(TUPLE_AT_1,TUPLE), (APPLY(TUPLE_AT_1,TUPLE)))
Here TUPLE is both used as data and called on itself. The first element is extracted twice and then called with itself as an argument.
So it expands to "FOO"
@@oj0024 I'd say to some extent that definitely is an example of homoiconicity. Honestly if C macros didn't have the whole newline \ pain they would probably be really useful for extending C.
Yea C macros are underappreciated
To my mind, homoiconicity isn't the core difference between C macros and Lisp macros. The core difference is the existence of a preprocessor.
In C, the preprocessor is a program separate to the compiler itself. It reads in a C file, and parses it for what is in effect a second programming language, the language of C preprocessor directives. These are completely different to C itself, and they lack a whole lot of the power that C has. The C preprocessor, not being able to run C itself, can't evaluate parts of the code it's passed - it can only modify the string representation to change what the compiler does with it. This means there are a while bunch of things you just can't do with the C preprocessor.
By contrast, Lisp languages don't have a preprocessor: when you write a macro it is a normal lisp function like any other. The only differences are that the macro happens to run at compile time, and is passed its arguments unevaluated - it can evaluate them at compile time, or rearrange them arbitrarily, or do fundamentally whatever it wants using the whole power of the Lisp language.
Homoiconicity helps in Lisp macros: given Lisp code is expressed in lists, which are just a standard Lisp data type, you can use all the standard library functions for manipulating Lisp code within your macros. But it isn't the core difference. For instance, modifying python code can be done within python, using the AST module. This has the same advantage as Lisp when compared to C: you can modify a python AST using all of the power of python. The lack of homoiconicity for macros in python makes this a bit more of a pain, I think, but you still have the full power of Python available to do it with. Where as unfortunately in C, you just don't.
"Why You Should Learn Lisp In 2024" is not a question; don't put a question mark after it.
You forgot the elisp implementation. 🙂
The three first languages (except assembler) are FORTRAN, COBOL and LISP.
Because it's more fun than learning Javascript?
Dang should have added that to the list haha.
What about the GC? Any implementation with manual or Rustlang-ish memory management?
Unfortunately, borrow checking is a pretty new concept so there currently is only Carp which replicates it. There has been a recent push for other languages with Manual memory management but there are few that have first class support for it. gitlab.com/flatwhatson/guile-prescheme is a recent attempt to revive a prescheme a manual memory managed lisp.
dustycloud.org/blog/guile-steel-smelting-pot/
Is a recent blog post about the topic and has gained some traction
@@GavinFreeborn Thank you! It is nice to see GNU Guile (which I currently learn) getting attention!
I'm a low level guy, so if I learn any lisp it's probably gonna be CL.
You are talking about libraries, if I want to use CL with gui and with SQLite, what would be the best way to go? Thank you!
For GUIs qtools and mcclim come to mind. clsql supports sqlite as well as a ton of other databases.
What font are you using in your video?
Tried lisp before , not having an editor built for lisp , makes it a pain to code in. Many of the function names and syntax are wierd. Simple printing has this wierd function. Why use car cdr when first and last is more intuitive. The cli is painful to work in. How dyu run a program or get thru a screenful of errors? What about documentation to lookup function names etc there's a reason some languages succeed more than others. Some are simply more usable.
I have bought little schemer, can you recommend any other good resources
'Chez' in Chez Scheme is pronounced ... just like 'chez' is normally pronounced in French.
tbh i find LISP's cool, but i'm not sure i'd be more productive with it than with rust or python.
even though it has killer capabilities.
What font do you use? Thanks
Terminus
Is lisp better than pyton in your opinion ? How can you combine knowing C++, with lisp?
In my completely bias opinion I'd say it is for multiple things. As far as mixing c++ and lisp it's hard to say since there are multiple lisps to look at. If you look at common lisp (as mentioned one of the more popular lisps) then clasp is a new common lisp implementation built to work on llvm meaning that you can have relatively easy Interop with clang.
Lisps won't dethrone Python in what Python is good for. Likewise Python can't dethrone lisps in what they are good for. This is why you should learn multiple languages, preferably from different paradigms.
If you're just starting to learn programming I would suggest that you go with Python, simply because very few people learn programming with lisps these days. After you've got to intermediate level in Python and have an arsenal of personal projects, then you may learn a new language to broaden your horizon. My personal recommendation: follow this track Python -> Go -> Clojure/Racket -> Rust -> Haskell.
I think at this point Racket should be separated from Scheme, Racket is different from Scheme, even Matt the guy maintaining it has said so. And don't forget the most important lisp of them all, Emacs Lisp to confuse and scare unix users all over the world 😈
I agree every time I go back to racket I feel like it's becoming less and less like scheme to the point it almost doesn't feel lispy to work with. But maybe that last part is just me.
THe simple syntax is the biggest problem of LISP, it's all just paranthesis, nothing to help the brain to visually understand the code fast.
It's so unbelievable why so many people just dont get it. Logo, Rebol and Dylan were the more interesting Lisp variants that tried to get away from it.
I definitely see where you are coming from. An if statement in C is way quicker to reason about than in lisp. Though I find small functions, clear function/variable names and extensive use of let helps resolve this. It is kinda a double edged sword. While more complex syntax can boost readability it can also lead to edge cases, undefined behaviour, and worst of all code complexity.
I find it helps to put closing parentheses at the same indentation level as their corresponding openers. This does mean putting them on their own lines. Here’s a moderately complex example:
(defun convert-to-region-codes (beg end)
"converts alphabetic characters in the selection to “region indicator symbols”."
(interactive "*r")
(unless (use-region-p)
(ding)
(keyboard-quit)
) ; unless
(let
(
deactivate-mark
(intext (delete-and-extract-region beg end))
c
)
(dotimes (i (- end beg))
(setq c (elt intext i))
(cond
((and (>= c ?A) (= c ?a) (
@@lawrencedoliveiro9104 This makes it super readable. Is there an utility for automatically applying this formatting?
What about 2023
What's stopping me from learning LISP? Other things are way more important to learn to build a project and being productive, whereas LISP is only something interesting that won't be used "on production" in the near future. It's great, but instead of learning yet another programming language, I'd rather learn something new about distributed systems/Web3/Databases, etc. So It's at the end of this long list now.
You can learn multiple if these are the same time as learning lisp. Best way to learn new tools is using them in a project and lisp is a great language for learning new technology
In my experience, this is not a helpful way to look at things. If you think hard enough, you'll come to realize that our time, attention, focus, or whatever aren't actually like currencies. They aren't exchangeable, replaceable, or convertible. The mental fatigue you receive from a long session of learning a web framework, for example, doesn't really influence your capacity to learn a new language or style of programming. You can concurrently manage all these goals of yours and achieve far more in a unit of time than if you were to tackle them one by one. That's just how humans work, imo.
@@biskitpagla And that's a correct way of thinking, but who is talking about learning things one by one, I mentioned instead that focusing on learning things that you won't use in practice leads to nowhere. I can create a sticker like "I know LISP" but what next? Instead of lisp, you can pick a language like a scala or an elixir, and it'd be valuable on the market at least. And I'm not hating lisp, it's excellent and powerful, but the core disadvantage is that's not adopted widely, so in practice - useless. Tbh only thing now that motivates me to learn it in detail is emacs. BTW learning a new framework and language at the same time slows you(at least me) down a lot - I did it several times in many ways and learning a new framework for java (which is my core language) and learning new framework with learning python at the same time is not faster at all. From my experience, mixing is the best option, you lose time on switching contexts but new skills are more "durable" let's say.
I miss cl and scheme videos
Looks like a good language for personal project but I wouldn't want someone to evaluate and manipulate code as data on my car autopilot program, I would rather it be type safety simple understandable unsophisitcated like java
It's very unlikely that you'll ship your development environment in a production situation such as this. Considering you're comfortable with the Java ecosystem, you should check out Clojure. It runs on the JVM and so enjoys the security features of that runtime.
Why you should -> Why should you
Lisp has some two dozen "special forms" which significantly complicate the syntax. Special forms have very different behaviours from regular Lisp expressions.
As useful as they are, macros also complicate language usage.
well special forms can make development very easy and seamless and macros can shield us from directly interacting with most of special forms.
which special form would you throw out?)
My only point is that Lisp's syntax isn't as simple as everybody pretends. My favourite language is Smalltalk and it has the simplest syntax.
How use common lisp in cloud azure?
Just until you end up trapping yourself with nested brackets......
Luckily there are plenty of tools for that such as paredit. Though making use of new lines and indentation usually helps.
I actually have recently started learning lisp, but likely won’t use it. For me the main thing I program for is statistics and graphing. Lisp does not serve these tasks well. So I will end up sticking to matlab and r.
Julia while not a true lisp in my eyes is heavily inspired by lisp and my be a good middle ground if that interests you.
Came across this and thought I'd share lisp-stat.dev/
LOL Statistics is oldest application of Lisp, since XLispStat !
Paul Graham inspired me to learn lisp.
0:16 erlang?!?!
Chez is pronounced "shay" it's French.
Post videos for perl sctipting
I am sadly far from a perl expert. I have really only written one thing in perl github.com/Gavinok/ghighlight
Hmm first few sentences could have just easily been describing Python.
As someone who gets paid to write python nearly every day I only wish python had all the features I mentioned in this video. IMO python would be a far more enjoyable if it had tried to be a bit more like lisp. Though let's admit, I am bias
Where elisp?
Figured it wasn't distinct enough for me to give it a dedicated section. Though watching it back I should have. If you are interested it's basically CL with less features and defaults to dynamic scope. I plan to go further into differences between lisps later on.
elisp
Learn Scheme in an hour, eh? Good luck explaining call/cc after 60 min with Scheme.
Arithmetic expressions in Lisp look bizarre. This is cognitively jarring.
There are always "reader macros" which can. be used to have infix notation in some code blocks.
@@GavinFreeborn It's not very elegant. It looks like a kludge, which it is.
@@horridohobbies that's fair. I've kinda just gotten used to it.
There is code that looks elegant. And then there is code that functions elegantly. Lisps tend to aid with the latter. Once you've overcome the initial 1 foot long barrier of S expressions, you'll find that lisps enable you to cross entire mountains.
I would say Smalltalk, my favourite language, also let's you cross mountains and with a supremely simple syntax.
Hot take: No language can pretend to be modern unless it has a type system, parametric polymorphism, and concrete syntax.
Iisp is the best language for learning, but not good for product programming.
There are plenty of companies that have happily moved to using Clojure and ClojureScript in production. I could definitely see an argument against scheme, and CL considering the only major company making us of them I know of is Grammarly.
Forgot to mention, that I worked - and still work - with Clojure for companies in Hong Kong
No proof
Dude this is certainly not your natural way of speaking
Haha ya 😅. I try to cut things down as best I can so I don't waste too much of your time.
You haven't shown anything that is convincing. I don't find C to be that hard , so why would I use Lisp which seems to be a bit of a mindbender with respect to getting a program to make sense . Remember , I'm not a compiler so a syntax tree means nothing to me really
Probably the biggest one even if you don't understand why the other points are so great would be the ability to test and manipulate an application while it's still running. May not sound like much but having to wait for an entire browser to compile just to go to a site and find out your change didn't fix it can completely hult productivity(in some cases for hours). For an example take a look at ua-cam.com/video/6pMyhrDcMzw/v-deo.html if you don't see the advantage there than I can't really help you. You may just need to try any other language to get an idea of the other possibilities that exist in the world.
Lisp is good if you want to create your own programming language. Otherwise it's just another programming language(s).
If only this where true 😔. I still have yet to see a mainstream language as interactive as lisp. Unless you cont Julia or smalltalk
@@GavinFreeborn I found Specman-e from Cadence to be one of the most powerful programming language I ever encountered. It supported regex search-replace macros, back in time debugging, aspect oriented programming, constrained random generation, and many other cool things...unfortunately it was only destined for hardware verification and not for software development. I think it's a pity, it would've been a great software language.
@@h0stI13 sounds interesting. Only experimenting I have done with hardware verification was playing with ACL2 mostly just to see what it's like. I'll have to see what's possible with soecman
@@GavinFreeborn Looks like ACL2 is for formal verification. Specman is used for functional verification, meaning it's connected to HDL simulators.
None of these is a compelling reason for learning Lisp. BASIC has a simple syntax, many languages have REPL, many languages allow treating code as data, that should be a compelling reason to learn these too, no? Also, macros, interactivity, homoiconicity and such are all great until one needs to consume an AWS service or even just to parse some JSON over network - suddenly Lisp loses all its power that unwashed pythonistas are at least 10x more productive than you. And I don't even want to start on dictionary driven programming in Clojure.
Uh idk why you think working with json in lisp would be difficult? There are plenty of options for networking in each of the mentioned Lisps. I don't really see your point. The libs just parse the converting it into a sexp. Many Lisps even come with json parsing included like emacs-lisp and clojure. So you still get to use the same functions you would use else where. The process for such a task would be pretty straight forward is there something I'm missing? Your other points are kinda missing the point that Lisp does all these things not just a few.
Also comparing nearly any REPL to that of mosy Lisps makes sense until your realize they have a feature set that competes with most language servers. Most languages REPLs don't provide error recovery, profiling, decompiling, jump to definition, etc.
I wonder if doing compiler development is a good motivation to learn Lisp...
I like how anti-Lispers have universally clung to this laughable argument that since some particular languages have adopted (or more like shittily imitated) some particular lisp features, they are all suddenly as good as lisp. Well, unless you have adopted ALL of those killer features (or appropriate counterparts) in a SINGLE language, bruh, you are OUT OF YOUR depth. It's just that when you do pull that off, you will find that what you got is simply a dialect of lisp.
This is like saying there's no compelling reason to learn to drive a car because wagons have four wheels too.
Python does offer most of the functionality you get with LISP, including functions and classes as first-class objects. The main thing missing is syntax-based macros.