Virtual Meetup: Introduction to Lisp for Language Engineers

Hi Community,

I am happy to announce that this Thursday (the 20th of May), Alessio Stalla will hold a discussion about Lisp.

Also, remember that in December, we changed the link to join the Meetup!

This talk aims to give an overview of macro metaprogramming in Lisp. No prior Lisp experience is required, with the goal of looking at MPS under a different light.

Alessio Stalla is a Language Engineer who designs and builds languages and supporting tools. Most of the time, you can find him crafting textual or projectional editors/IDEs, static analysis tools or model-to-model transformations. Also, between projects, he writes articles on Strumenta’s blog about what he’s learned. He is also the lead developer of the open-source web application framework, Portofino. He contributed to ABCL, the Common Lisp implementation on the JVM, and marginally to the Groovy language. He knows the JVM ecosystem quite deeply and routinely and actively participates in the local Java User Group and follow several JVM development mailing lists. In the past, he has designed and implemented Java enterprise applications using a variety of technologies, including Spring and JEE applications, Alfresco customizations, Liferay portlets and extensions, Camel/ServiceMix, BPMN engines, and more.

And if you are thinking of proposing a talk, it is time to come forward. Just let me know by replying to this message.

How to connect

To avoid other security issues is now necessary to register for the meeting. The registration should be necessary just once and be valid for all the next meetings you will participate in. I understand it is a little extra effort, but it would avoid problems like the ones we encountered:

Registration for the Virtual Meetup

After registering, you will receive a confirmation email containing information about joining the meeting. It will also permit you to add it to your calendar.

Time

It is hosted on Zoom at 6 PM GMT+1/CEST (you can use this link to figure out which time is in your timezone: The Time Zone Converter).

Cheers,
Elisa

P.S. We get a recurring question: “Are presentations recorded?”. The answer is not, and the reasons are explained here On recording Virtual Meetups - #7 by voelter

Here there is the chat transcript:

17:52:35 From Rene to Everyone : Hello!
17:56:55 From Nuba Princigalli to Everyone : Lisp is from 1958 (wikipedia says so, heh), so probably Flash Gordon instead of Star Trek )
17:56:58 From Nuba Princigalli to Everyone : :slight_smile:
17:57:07 From Federico Tomassetti to Everyone : Good point :smiley:
18:24:28 From Federico Tomassetti to Everyone : Is the font being enough in the editor?
18:24:44 From Niko Stotz to Everyone : works for me
18:24:47 From Bhalachandra Patil to Everyone : yes
18:24:57 From David Benn to Everyone : yes, thanks
18:25:09 From Rene to Everyone : Could be a little bigger. CTRL + maybe
18:27:08 From Ed Seidewitz to Everyone : You can use Zoom “View Options” to zoom in on the screen image. Of course, then you need to zoom out again to see the bullet slides.
18:28:19 From Federico Tomassetti to Everyone : View options is someone every participant can control for their own screen?
18:28:29 From Ed Seidewitz to Everyone : Yes.
18:28:42 From Federico Tomassetti to Everyone : Thank you, and sorry for the ton of grammatical errors :smiley:
18:29:02 From Ed Seidewitz to Everyone : For me, there is a drop=down is at the top of the window.
18:29:45 From Ed Seidewitz to Everyone : Speaking of grammatical errors! Should be “there is a drop-down at the top of the window”.
18:30:18 From Mike Cargal to Everyone : that was more of a syntax error
18:30:45 From Federico Tomassetti to Everyone : Syntax errors fit perfectly in this context
18:33:20 From Nuba Princigalli to Everyone : Also, on Ubuntu 20.04, windows key + mouse scroll up/down, for zoom in/out, works on xfce/xubuntu, I suppose it works on gnome, too.
18:33:48 From Rene to Everyone : Extending the language, and using the same language instead another one, very interesting.
18:37:08 From David Bakin to Everyone : in advanced use of LISP you can use reader macros to override anything, including (especially) basic syntax … but that’s fairly advanced
18:37:32 From David Bakin to Everyone : reader macros are macros executed while characters are being read by the interpreter!
18:38:00 From Rene to Everyone : A reader macro happens at runtime by eval then?
18:38:47 From Nuba Princigalli to Everyone : Are functions scoped with regards to the tree? In the sense that I could have definitions that are valid/applicable only to a given subtree?
18:39:30 From David Bakin to Everyone : not eval - by the actual “lisp reader” which is reading the S-exprs - eval is execution time, that’s when regular macros get expanded
18:39:35 From Denis Kuniß to Everyone : Why it’s upper case?
18:40:00 From David Bakin to Everyone : upper case: tradition (back in the 50’s upper case was the only case …
18:40:10 From Denis Kuniß to Everyone : I mean, why is 'f it upper case - F?
18:40:42 From Ed Seidewitz to Everyone : Because the names of atoms are case-insensitive, and the canonical representation is upper case.
18:41:13 From Denis Kuniß to Everyone : Thanks, Ed.
18:41:31 From Nuba Princigalli to Everyone : Thank you!
18:42:22 From Denis Kuniß to Everyone : Is it specific to a Lisp dialect? When I implemented a Lisp interpreter 25 years ago in the university, I do not rememeber this.
18:43:22 From Denis Kuniß to Everyone : Maybe, due ti my forgetfulness, of course. :wink:
18:45:38 From Ed Seidewitz to Everyone : I mean, I used lower case when programming in Lisp 40 years ago. But, as the speaker noted, Lisp has legacy history that goes back a lot longer than that!
18:46:05 From Rene to Everyone : template language in an extendable language?
18:47:03 From Ed Seidewitz to Everyone : Back quotes are just a convenience. But a very convenient convenience!
18:52:36 From Miguel Cuervo to Everyone : I heard that Racket has hygienic macros. Do you know how are different to normal macros?
18:53:13 From David Bakin to Everyone : in this list of useful macro packages don’t forget the ur-macro-library: LOOP - which is a DSL in and of itself for writing traversals over lists and multiple lists
18:53:57 From David Bakin to Everyone : hygeienic macros do NOT allow the external environment bindings to be overridden - they’re “pure” in the functional sense - there are pros and cons
18:54:28 From David Bakin to Everyone : … actually not just overridden but youcan’t even use external bindings … that’s what makes them pure
18:55:46 From Jahan Zinedine to Everyone : How can we leverage this power in languages and ecosystems like Java? There is annotation processing tools like Lombok which are very powerful but I assume it’s not easy to extend.
18:56:23 From Federico Tomassetti to Everyone : Clojure is a Lisp that run in the JVM, so you can call Java from it and Java can call Clojure
18:57:34 From Jahan Zinedine to Everyone : Right, thanks! I’m not sure whether or not Clojure supports Macros just like classic lisp.
18:57:47 From Federico Tomassetti to Everyone : I think it does
18:58:15 From Ed Seidewitz to Everyone : It does.
18:58:17 From David Bakin to Everyone : Clojure - Macros
19:00:00 From Jahan Zinedine to Everyone : Thanks!
19:02:06 From David Bakin to Everyone : the ultimate book on macros - because macros are VERY useful and VERY cool: https://letoverlambda.com/ - Let Over Lambda by Hoyte - this single book is all of an undergraduate course, a graduate course, and a postdoc seminar in LISP macros! very highly recommended (especially if you enjoy books where the author is highly opinionated)
19:02:12 From Jahan Zinedine to Everyone : The major problem that I have with lisp dialects is that I can think in lisp, it’s very different from my mental model/
19:02:20 From Jahan Zinedine to Everyone : :I can’t
19:03:54 From Ed Seidewitz to Everyone : I often think in Lisp even though I haven’t used it for any real work in many years. I was brainwashed at an early age! But it help make metamodeling feel very natural for me…
19:05:23 From Jahan Zinedine to Everyone : thanks!
19:06:08 From David Benn to Everyone : The Julia language is another example of a language that supports macros
19:06:40 From Federico Tomassetti to Everyone : Maybe in Java you can get a very tiny subset of this power by using the annotation processor to generate code based on code
19:08:43 From Miguel Cuervo to Everyone : Elixir also has a very powerful macro system
19:09:30 From Miguel Cuervo to Everyone : The hole language are few primitas. The rest of the language are macros
19:10:40 From Ed Seidewitz to Everyone : Actually, Emacs was born as TECO macros, before it was re-written in Lisp!
19:11:35 From Jahan Zinedine to Everyone : Probably that’s the right way to teach programming :smiley:
19:13:22 From Herman Peeren to Everyone : https://mps-support.jetbrains.com/hc/en-us/community/posts/205826639-Why-MPS-is-better-than-lisp- :wink:
19:15:18 From Federico Tomassetti to Everyone : Nice link Herman !
19:19:08 From David Bakin to Everyone : “Advising [26] is an Interlisp mechanism which is related to the use of hooks. An advice is an addition of a piece of program to a designated function. Any function can be advised; the function does not need to be prepared for the advice, and the source expression of the function does not need to be present. It is necessary to specify how the advice is related to the existing, and perhaps already advised function (before, around, or after the original function, together with the position of the advice relative to already existing advices).” Interlisp
19:21:26 From David Bakin to Everyone : this is excellent stuff!
19:21:55 From David Bakin to Everyone : lisp is highly underrated in modern times - possibly because it is so old? possibily because of the parenthesis and simple syntax? we should all learn it and use it MORE! thank you!
19:21:59 From Jahan Zinedine to Everyone : Thanks Alessio and all organizers and contributors!
19:23:00 From David Benn to Everyone : Thank you Alessio and all for the interesting chat content
19:23:30 From Bhalachandra Patil to Everyone : Thanks for a nice presentation !!
19:23:48 From Tomas Öberg to Everyone : Great presentation! Thanks!
19:23:50 From Bhalachandra Patil to Everyone : very interesting
19:23:52 From Aleksandar Bakic to Everyone : Thanks, bye!
19:23:52 From David Bakin to Everyone : you can get a transcript - there are three dots next to the entry part
19:23:56 From Neeraj Bhusare to Everyone : Tx

Here you can find the slides I used for the presentation:
Lisp for language engineers.pdf (1.2 MB)

Thanks for saving and reposting the chat – it’s interesting and I had missed a few things.
Regarding this:

18:53:13 From David Bakin to Everyone : in this list of useful macro packages don’t forget the ur-macro-library: LOOP - which is a DSL in and of itself for writing traversals over lists and multiple lists

shameless plug – I dislike the LOOP mini-language, I think it looks like a tiny BASIC/PASCAL type language embedded into Common Lisp, and is not extensible/composable like the rest of CL, it feels like an extraneous body to me. So a few years ago I coded another looping facility using macros, and that’s pretty interesting because it has some macros that generate other macros and build a rich description of the loop – a kind of AST if you will, or an embedded mini-language that is made of struct objects rather than Lisp lists. You can find it here: GitHub - alessiostalla/doplus: doplus (written DO+) is an iteration macro for Common Lisp. it hasn’t gotten much traction and I haven’t updated it in years, but I think it’s a good (albeit complex) example of the advanced stuff you can do with macros.

1 Like