 Welcome everyone to the minimalist death room for the second time we're organizing this and You know so far we've had some great talks. I hope I can live up to that expectation So Lisp is the second oldest language used in use today the oldest language is Fortran and I just yesterday yesterday there was a Fortran to LLVM talk, so that's also still alive Fourth we also had a talk which is quite old early 70s. I think yeah Small talk is also quite old. So, you know These old languages seem to seem to stick somehow, which is great So, yeah, I've I've went through many phases in my life I know I've started program in the early 80s and went through you know from Pascal to through C++ to Python Ruby, whatever's elixir Scala D and I still like Ruby and I still like D so What about Lisp? So the first one of the things I learned is that you know the top 2% of the programmers in the world They they can program in Lisp. Have you heard about that statistic? So of course when you want to be a top 2% programmer, what do you have to do? You have to learn Lisp so that was an incentive And then I ran into a number of projects including GNU Geeks, which is a package manager I've written in Lisp and you know so slowly I started to And it's surprisingly easy to learn, you know, you can teach a youngster Lisp probably in an hour. I think yeah The basics so that's that's great But I also discovered the Lisp is very much a Ruby or a Ruby is a Lisp really, you know And I met Matz who's the creator of Ruby two years ago and I asked him, you know, say How come Ruby is so much like Lisp and he says yeah, actually people in the early days called it Mark's own Lisp instead of Ruby Yeah, so there's a lot to share then So also Lisp is a lot like Python or Python is a lot like Lisp and you find these things out but There's something else Lisp is everywhere and I'm gonna talk about that So Lisp you can find in Emacs You can find in the education great programs AutoCAD in the early days use Lisp, GIMP, Julia, Julia was originally written in Lisp, you know that So there are Lispers there Logic programming, mini-cundron Clojure in the last ten years has, you know, wedged itself into the business market Gnu Geeks, of course, is very much popularizing Lisp and and pushing guile to its limits and that's the next talk Never Gnu mess Jan was talking about just now. Yeah, there's a lot of Lisp in there and the shell anyone heard of shells Lisp there we go, so In a nutshell your most broken language language rights and then braces and then a parameter Lisp, you know, the braces are just on the outside. There's all you need to know So when people say there's lots of parenthesis in Lisp, you know And where most languages handle scope and you know with curly braces in the C-style syntax and you have imperative assignments, right and then you do something like Concatenation in Lisp you write something very similar just looks a little bit different, you know So you start with a with a brace and then you assign the parameters Right, and then you do something with it But what you can see is that it's very consistent, you know Because functions are always started the first position in the brace So that's how they get evaluated and then you get a list of parameters And even for assignment, you know, it's really a function Yeah, which has a list So and the other thing is that most lists today they allow you to also use square brackets, right? So as long as they match up you can you can exchange them with with the braces But interestingly it introduced a scope and one of the things I found out quite late, which is embarrassing Is that and this is really beats other languages, you know, I think to the core is when you run Lisp in a Rappel, yeah, so You can you can just cut and paste the inside of an expression, right and and feed it to the rappel again Yes, so if you do debugging, I mean try that in Python So here's a famous list. It's it's running in a in an editor and Here's an example. Yes, so Emax is written in Lisp essentially It has a very small C core that runs the Lisp engine Which means that all the configuration is is is done in Lisp, too Yeah, so once you get used to the list syntax, you don't have to relearn anything what you only need to relearn is how you know Emax has created its world of of of Functions or procedures Which you just can call Yeah, so I wrote a function at some point that I wanted to copy the line above and I probably did it in the most Inelegant way Yeah, because I wasn't really into Lisp then But you can essentially write a function that says, you know, take take the cursor position Copy the line above it's injected back into the into the text buffer. You can even inject into a different buffer if you want And this is what it looks like, you know, and it starts it starts to look familiar now And then when you have written the function You can bind it to a key Right and this in this case is control backspace and I see if it works Yeah, right, so I wrote this language extension myself, you know, it's a really minor one But I think it just shows the power of of of using a configuration language, which is also programming language So Emax is for programmers. So that that point I really would like to emphasize, you know, in fact, I I use Vi Vim for almost 10 years I started with Emax then in a you know In a in a in a in a in a mind melt I went to Vi and then 10 years later, you know, I went back to Emax And the real the real thing is that because this is such a configurable editor. It becomes a great programming platform, too Yeah, so programmers love an editor that you can program And that's what Emax is Racket. So this is another Lisp Which is really making Lisp popular again And the record has a record that comes with the shell is called trash Yes, it's an unfortunate name, but there you go And I just want to run quickly through it because record allows you to mix shell commands with Lisp commands, which becomes very interesting So you can install record. I'll share the slides And then you can say something like Require some modules, right? And then hey, that's a that's a shell command. See that cat, etc. hostname And you can pipe it into a Lisp procedure And that binds me to another one. So what you can do is say, you know, turn some trimmer string Or you can say Let's see here's a mixture again Define hostname is cat, etc. So you have to embed it shell again, right And do some function operation on it And then you can just run a plain shell script where the parameter is actually lifted out of the Lisp evaluator Right And that's that's already pretty cool But you can also do things, you know, you can't even fathom doing in a shell like parsing jason, parsing jason So this is an arrest endpoint which returns a very complicated jason record And I can actually I can just, you know, fetch it with within within the shell using a Lisp expression And, you know, the record in the first stage of the record is a hash is a dictionary What are you trying? Hey, Alastair, how are you? All right Is it not the blue one, the black one? Yeah, try Ready for lift off Ready for lift off? Yeah, so you can do something very complicated and then out of this jason record you get, you know, this string So in a shell script, essentially you can do complicated things and you can even do, you know, you can use SQLite as a back end And, you know, push some state into a SQLite file database Try and do that in a shell Another thing is, you know, the shell scripting program and probably most of us get caught at this at some point You know, the shell, when you pass a list of words in there, is it a string or is it a list? Yeah, so here's an example Here's the shell script that I used to upload some files to my web server, sorry, to my mail server Yeah, and you can see that the file name has spaces in it Okay And when I actually run the shell, the script which simply is shell and then using the expansion string star Of course it breaks because it starts, it thinks these are all different files, right? Anyone bitten by that before? Yeah, so the rash version is that you start the shell And you can parse the command line using current command line arguments And you can see if you use single quotes, it actually sees it at words But if you use double quotes, it will see it as a string, sorry, as something with spaces So to write the full script, you could do something like this Where you say, okay, we're going to run a system command, the system star Calls the rsync and plugs in the fn, which is coming from current command line arguments So this is a lambda, and in lambda the actual parameters to the call are listed last Which is counterintuitive for us Ruby programmers But Racket comes with a nice facility, where you can say for a list, function name, that's the parameter Fetch it from the command line and then run the command And this starts to pretty much look like Ruby to me Yeah, I mean with a little bit of syntax And then you run it, it works, right? As it should, skip this So here's a more full rash script where I just show that you can create a loop So the student file lists student names with spaces And then I create a name, removing the spaces And then I copy the file, the text file to the output file And then I run set, hey, and this is again just a shell command essentially Yeah, and this is also a shell command So what you see is you can mix in a loop, you can mix shell commands again Which have the normal shell syntax So I think rush is pretty cool, and for guile we have gash If we could do this type of thing, Jan Really interesting So there's more reading here, you can read on racket And why is rash so interesting? You know, because rash is totally hackable through lisp So you learn one syntax and you apply it for different things At the time So there's some hacking guides here And this seems to be misplaced somehow What did I do? New guile I'm starting with hacking guides, great That should be the last one So the new geeks you've heard of before if you were in the room Is a package manager, it's a functional package manager And it's essentially written in guile, which is a lisp again There are many flavors of lisp, and this is one It's a scheme And You know, when you install something with geeks on the command line You can do something like geeks package, install, racket, image, racket, mode And then I'm going to put it somewhere, that's what it says And then you load the profile, which is the number of environment variables And then you can run the program, which is in optrack, it's bin, racket And it will give you a prompt I should have given a guile example anyway So Geeks is written in guile, so we need to install that first And I'm also installing some nice packages that go with it, emacs, emacs, geyser, or geyser And par edit And when you do that You can Do something Like this I have a pipette as well There we go You can start the rappel Yeah, with the Where the meta command x shell and then run geeks rappel So geeks rappel is really just a command line tool And it drops you straight into a lisp rappel And it allows you to interact with geeks So the geeks package manager And here, for example, we say, okay, use these modules, use geeks Use GNU packages scheme And then tell me about the racket package And it gives you information on the racket package Including which file it sits in, GNU packages scheme And the line number So you get this facility where you can actually interact with the geeks package manager Through lisp And you can query data, you can say something like package version racket So let me try that if I It's always dangerous to try things on the command line What did I say, racket? So here's the package thingy And then I need to say, for example, package version racket And return to the version that's installed And there's a lot more to that So you can get all the information that's in the package manager And if I show you what the package manager looks like That's the wrong one Too many things are open now My poor small brain So if you have, for example, here's the package definition in geeks You can say define public, which is the package name Which is called Ruby connection pool And this is a Ruby gem It's a Ruby package that comes with Ruby And essentially say this is the name, this is the version This is where we fetch it from It comes through Ruby gems So it's a Ruby gems URI And you can see that the Ruby gems If you set it from git, it would show a git URI So we have a high level abstraction here for Ruby gems The shaft value just says this is what the tarble What the shaft value should be like So you don't accidentally get another one And then the build system is the Ruby build system Then it has a native input So that's the dependency, it depends on bundler And then you have the synopsis and the description So this all describes one package in geeks Which is concise, right? And it's also a lisp again So you can understand it now, right? Even if you don't, even if you have this one This 10 minute introduction on lisp that I have given Anyway, so if you query the data that was on the rappel You can actually get this information that was in the package definition You can just see it here And do something with it You can also interact with the demon I'm not going to run it now because I don't have that much time But essentially you can open a connection with the demon Which we call s here as a convention Or store or geeks demon So there's not much of a convention And then you can What we call a package derivation Of the package that you want to build In this case we're installed, this is Ruby And a derivation is sort of the lowest data representation Of a package So it includes all the dependencies and everything And then you simply say something like derivation Sorry, that's what it returns This is how you fetch the file name of the derivation And in this case we want to build it So we say Build derivations With the demon And then take a list of the derivations In this case it's a Ruby derivation Which was fetched here So if I run that it should install Ruby Which is always a bit dangerous Let me try and kind of paste that Live dangerously when you give a demo Yeah, so it returns true because the package is already installed Yeah So it doesn't reinstall unfortunately Very convenient for demo But that's it, that's all there is to it How many? Nine, okay, that's cool And then we have a concept called the store monad So when people talk about monads They usually think about things like Haskell functional programming languages You can also do this in Lisp Five Oh, thanks Yeah, so And the specific monadic functions Which avoid you to reference the demon Or the store or the connection every time So rather than the earlier Here we explicitly had to set build derivations s And then something Yeah, so here we can just say package derivation ruby And you don't have to relay to the I mean the monad carries the definition of the store with it So you don't have to reference to it again And this is another way of simplifying the code Because otherwise you would have many references to the demon And that's actually not necessary So to capture it all You know, with Geeks the source code is a documentation I think And we show some high level functionality for building And exploring packages And the fun thing is you can also use a debugger So you can actually step to When you build something you can step through the code That is the package definition and what it does with it And it's all the unified list syntax So your distro here is a scheme library for hacking You know, through the Geeks Through the Geeks APIs And here are some links which are available I'm going to skip this one So just like Emacs, Geeks is for programmers So once you master Lisp You can do anything really So I'm going to quickly touch on another Lisp Which has become very important in the business environment It's Clojure And it's a little bit I mean the Lisp people in general When they frown when you mention Clojure It's different from most Lisp But I think it's I can't say it's superficial But it has very interesting ideas Conceptually it's a different beast altogether But it shares things with the other Lisp Including the syntax It takes a little bit of some freedom When it comes to saying Rather than writing Where did that go? I think something disappeared Oh no, that's probably the same So that's a list, right? But this is a vector And a vector in the other Lisp Or at least in scheme would be written like this And this is a hash value or a dictionary And this is what it looks like in the other schemes So there's some differences And I think it was This is meant to make it nicer For people who are coming from JavaScript, Python, Ruby and all that But it's the same thing In fact underneath it will return similar values And then Clojure has A lot of ideas around functional programming Including immutability And shared state handling Which are all important And it compiles to the JVM Which is an advantage if you like it And it's a disadvantage if you don't like that And Clojure Scripts Which is also Clojure translates to JavaScript So essentially you have one language That can target either the JVM or JavaScript And I think in a business environment That can be pretty attractive But there's not to say that This is the only way to do things You know, because there's a For example, BWA scheme Is a JavaScript interpreter That runs in the browser When you use that You can do something very simple like this Which is HTML And then you script The JavaScript interpreter You pull it in And then you can just write scheme again Which is a very interesting tool WeeScheme is a record ID That runs in the browser So that's another browser interpreter PanScript takes a slightly different approach It's a JavaScript generator So it's more like Clojure Script And Spock is the chicken scheme To JavaScript generator So these are all projects That can do pretty complicated things And it all originates on the fact That writing a Lisp interpreter Is not that hard At school, at university At least maybe not the last 10 years Who has learned to write a scheme Or a Lisp interpreter in school See? Yeah, that's a few So it shows you it's possible Anyone wrote written C++ interpreter here? They also exist But they're a very crazy beast So Spock can compile to either C or JavaScript And it's a chicken scheme And I'm going to wrap up now Because the take-home message I think is that Lisp is one Or maybe many languages that serve all I think that's the key thing And there are many great Lisp Lisp is easy to learn Lisp is everywhere It can be used anywhere It's for newbies and gurus alike In my opinion But what is really important In this stage of millennial angst Is that you don't have to worry About what language you have to learn After this There are so many people That come to me and say Should I learn Rust? Should I learn Python? Should I learn R? Or whatever You should learn them all You probably You're over it Thank you Any questions? Yeah? I noticed at the Geeks Rappel There was a lot of answers Don't assign numbers Does it mean it saves all the answers? Yeah So the Gal Rappel saves all the answers That's true