 Here, so I'm going to be talking about basically hacking in GaL, programming in GaL. It's kind of more of an introductory session. We'll cover that in a second. I had to make some slight adaptations to my kind of full screen setup, so hopefully it should work out. We'll see how it goes. So first of all, yeah, my name is Alex Satzmannshausen. I kind of work for PTFS Europe, and I get to work on a library management system which is used by public and academic libraries, which is free software. So I'm very lucky in that respect. So, okay, it started. Just to gauge kind of the experience in the room. Like, who here has programmed in GaL before? Wow, okay. So, yeah, this is an introductory session. Some of it you may already know. So you programmed in GaL. Who here has done like a larger project or anything like that in GaL? Okay, so that's fewer. Okay, that's good. And who feels really comfortable working in GaL? Okay. Okay. So even the GaL maintainer is like, maybe? Okay, so I would say I'm relatively comfortable in GaL for sure. But so maybe what we're going to cover in this presentation is like the bare basics and then kind of maybe seeing how we can kind of improve our workflow. And I guess maybe also like towards the end if we have time, hopefully, we might be able to kind of share some ideas or share some tips about stuff that we do or workflows we have. We'll see where we go. Down here, this will become relevant later. You should be able to see my key commands. This is when I will be using Emacs in a second, but for now it's probably not that important. So, first things about GaL, this is probably I can skip, but basically it's a scheme implementation, which is a Lisp dialect. And that means that there's obviously lots of parentheses, which are wonderful creatures. And there's, you can also use this thing called Wisp, written by someone called Arne. And that's kind of a way, and I think there's a presentation about that later on, it's kind of a way to kind of turn, essentially turn scheme into a less parenthesis language, which is quite neat actually, to be honest, the fact that it's possible. But I like my parentheses. So, installing GaL on Debian-like distros is super easy and on Geeks and Geeks SC, of course, is super easy as well. So, straight forward, I can skip that. A quick aside, so one of the big things about scheme languages, and Lisp in general, I guess, are ripples. And basically they're kind of, they stand for read-evolve print loops. So they're basically just interactive prompts, much like your shell. And it's just kind of a place to evaluate your commands. And most kind of high-level languages nowadays have them. At work, I program mainly in Perl and also some PHP, neither of which are particularly known for their ripples. So, working, that's one of the reasons why I like working in GaL is because, you know, I have access to the ripple because it's great. So, but yeah, most languages, most kind of high-level languages nowadays probably have them. So, normally firing up the ripples is super easy. It's as easy as kind of once GaL is installed, kind of just executing the gaL command and you get a ripple. We already saw that before in Ricardo's presentation. By default, it's a bit spartan. Like, I can obviously, you know, execute commands. Sure, why not? Let's go with it. Yeah, so it's displayed there. You can see it. I should probably kind of go for, so I've just kind of tried to press, you can see down here, I've just tried to press the up arrow thinking, oh, I could get my history up, but no, because the standard ripple doesn't come with history. So it's, like I say, it's a bit spartan. But you can basically use it. It's a, it's a ripple. Okay, there we go. So, yeah, it's a bit spartan by default, which is a bit meh, but we can improve it. Because by default, gaL comes with basically a library which is called readLine. So first of all, gaL kind of executes, like Emacs basically evaluates kind of a startup file, which is, in GaL's case, we've named pure gaL. And it comes with the standard library called readLine. And you can also, there's a separate project called colorize written by Nala, which is kind of just as pretty colors. So I'm quickly going to enable those. That didn't work. There we go, that's better. So I've just kind of tweaked my preprepared gaL unifile. And now we're running it. First of all, I mean, this is just basically like, you know, a demonstration. It's a pure scheme file. So you can basically write whatever you want in there. If you want to do some kind of fancy computations before the REPL fires up, that's fine. You can do that. But the main thing is, I've enabled the colorize library. So you've got pretty colors there now. And I also have a history now. And as part of a history, readLine also provides, obviously, kind of backwards search and stuff like that. So already, the REPL immediately becomes a lot better. So out of the box, installing gaL, if you want to use gaL, the first thing I recommend is definitely enabling readLine. It makes a massive difference in terms of using the REPL. And then after that, I mean, you can even get parent matching, which is lovely if you're kind of doing deep indentation. So yeah, the standard REPL, skip that. Anyway, but it's, so I guess that's the first thing to do. And I guess at that point, it might be kind of worth talking. I'm not 100% sure whether it's worth talking about this, because again, this is super introductory. Basically, kind of the gaL REPL comes with some meta commands, which are super useful. And they kind of are prefixed with a comma. So you have help, which is basically just kind of a, like contextual help command, I guess. There's apropo, which is much like apropo on the shell, basically provides you with kind of a search through kind of loaded bindings. Binding, which basically just displays all the bindings that are currently loaded. Describe, which is kind of like a way to interactively query the documentation strings from functions. Like Emacs, Lisp, and Python as well in other languages, gaL basically allows you to add documentation strings directly to procedures. So you can query those like this. And it's pretty print, which is, you know, quite useful when you're just interactively debugging or messing around. And finally, module and reload are basically just kind of shorthand commands for kind of loading new libraries that are already installed in the system. So, I don't know. I should probably start my couple first. So apropo just lists them up, and then I can say, okay, well, let's find out what the problem app does. The D here stands for describe. It doesn't have documentation string. Okay, let's go for it. There we go. So, that's just a nice way to kind of add the repo, get some extra information. I can load. Let's go for it. And actually, module kind of switches into a new module. So now, right now, I'm kind of inside the Serfy, Serfy1 module. Serfy1 is like just a really useful general purpose kind of scheme library that adds lots of wonderful things for processing lists and so on. So, from here, I can then say, you know, binding, and I can actually have a look at all the procedures, essentially, that this module provides. So, it's kind of a way to, like, just let the repo explore your kind of code base, essentially, or your procedures and stuff. So, yeah, meta commands. Quite useful. But actually, when you're actually working on a project, of course, you kind of, you know, you've got your interactive replay with, but most of the time you're working in a text editor, presumably. So, and most text editors will support the kind of syntax highlighting for schemes. So, in GNOME, using get it is fine. You can see pretty syntax highlighting. And you can just add it from here. So, yeah, it's nice and cloudy out there. So, running, obviously, script files as well, just with a s flag in the location. Let's face it, it's still pretty pair bones. It's not an ideal development environment. So, really, at the moment, the way to develop GAL projects is in Emacs. I mean, Emacs in general is a great text editor, and for editing, GAL is basically the way to go. So, the first thing you want to do is install Emacs and Geyser. In Debian, it's both, again, like most major distributions probably have both of them packaged in Debian. The usual commands in Geeks, you can also do it with the usual commands for Geeks. So, you can just open your GAL script. So, I've got it open here. And then, the cool thing is that you can basically execute runGAL, and then you basically get your REPL inside Emacs. And at that point, basically, you have inside Emacs without any tweaking, like the better version of the REPL with the kind of history, with, you know, backwards search or whatever you want to do. So, that REPL already is a pretty, um, but then, it's not just a REPL. I mean, you get the standard metacomans as well. So, of course, they work from within here, because this is just a wrapper around the kind of, you know, the actual GAL process that's running in the background. So, it's a fully-featured REPL out of the box. But you get awesome more stuff. You get, like, within the buffer kind of evaluation of GAL code, much like if you've used Emacs before, you know, like, evaluating elisp within buffers is something that you can totally do, and that's the same with GAL as well, basically. The experience of programming GAL in Emacs essentially becomes very much the same as programming elisp in Emacs. So, you can do live coding. You get immediate access to doc strings, and because kind of the GAL documentation is written in info or tech info, you can basically immediately access out of your fingertips as well from within Emacs. So, let's look at this one here. Um, I've loaded this file. I've got my, my REPL open, basically. I'm going to go for geyser evolve buffer. And what it's done basically is just kind of taking this buffer and just evolve it in the, in the REPL. You don't actually see the output, but it's done it. And the reason that I know that is, for example, if I now hover over this procedure here, and I use CTRL-CDD, I basically can immediately access the documentation for it, the doc string in this case. But for, let's say, MATCH, which is a built-in kind of, well, it's actually exported by the MATCH library. I can do the same thing against CDD. And then I should be able to, hopefully it works, click on the manual and there we go. I go to the right chapter in the manual and immediately get full documentation to that, which again beats my experience of working with Perl and PHP of manually having to look up various things. Um, so that's one thing. The other thing as well is, as I start writing, obviously, like editing text in Emacs or Lisp in Emacs is so much better than any other text editor that I've come across, so the whole kind of, it's, yeah, by comparison, working in Get It or something like that is painful. Can we see it? Can only the mini buffers hidden? Just one second, I'm just going to resize things a little bit more. And a little bit more. It refuses to become smaller. Down here is the famous out of sight is the famous Emacs mini buffer, which if you've used Emacs you probably know about. In, uh, having guys are enabled basically, it gives you whilst you're typing, I can see it here, it's wonderful, it gives you basically like the procedure signatures as you're typing them, so basically you can immediately there see what kind of arguments the procedure expects, which is super useful again. So that's the other thing. Uh, we can basically evaluate procedure calls from within the buffer, so I'm now basically pressing control X E, and you can see basically it immediately evaluates in a kind of buffer next to it. So this is what I meant before with like basically buffer evaluation in live coding, you can essentially just write a new procedure definition inside the buffer, um, and then evaluate it and then immediately test it for within the buffer without having to switch over to a different kind of test situation or running the script and hoping that everything works out fine. Uh, which is I don't know, just great. It just feels really nice to work that way. So, there are a whole host of kind of guys are commands, the most important ones are probably like evil, buffer and go, which is basically like, uh, evaluate the buffer and then kind of switch to the REPL where you have access to the stuff, so again in the REPL I have access to my functions that I'm defining. Um, there is uh, geyser evil last, um, sexpey, which basically uh, it's like, it just, like, that's what I did before, it just kind of evaluates the last kind of um, s expression that you were at and, um, I guess geyser, eval region is quite useful as well, just mark a region and evaluate that. So basically it allows you to stay within your kind of code file uh, and just kind of evaluate partial parts of the code to kind of see, you know, you see something goes wrong, you kind of quickly tweak it and you evaluate it again, see if it works then. It's a really nice way of working, basically. So yeah, uh, way better than the standard REPL and the standard, um, text editor. So working on a larger project, I mean basically we kind of have pretty good stuff, like what I've shown so far is pretty good stuff to kind of work on scripts and so on, single contained files. Um, to work on a project essentially, by and large, this kind of would be, I think probably a representative kind of layout for a kind of gao project. Uh, you basically have your uh, your folder, which is kind of your project name essentially, within that you might have another folder which is kind of called the same and that kind of contains support-like modules for your project and then you've got your main kind of project file, let's say, and then you've got a test folder with some test files in it. Um, and of course it's basically like in gao you basically define modules with the define module uh, form at the top of kind of a module file and it basically names the module and it kind of exports procedures and you kind of define what modules you're using. Um, and of course if you have a project which kind of has several layers of directories deep as you're working on the project in Geisir uh, you want to be able to use all the procedures that you've defined deeper down in your project. Um, and the way to do that basically is, well if you try to do that just normally um, you're essentially going to get an error in Geisir because Geisir basically loads guile from within the load path and the load path by default does not contain your project file. So, really you need to basically, that's the only thing you need to remember when you're kind of working on a project in in guile with Geisir, is to basically use the geisir add load, add to load path command. Um, and by default it will just kind of assume the directory that you're in and then from now onwards let's switch to my other example. Nope. My other example. There we go. Um, so, yeah I'm just quickly going to switch to my ripple and restart it. Okay, so right now it's a fresh ripple I've not done the add load path thing yet so if I do this, it will say that code doesn't exist, it's not in the load path because it doesn't know about the project. So instead I'm just going to quickly uh, run the add load path command and now it's working fine and now basically this so I'm using the kind of guidem support module which is in guidem uh, support, it kind of is really simple, doesn't do much but there's the procedure that I call text text to greeting and you can see that this one uses here so I can evaluate that and I can do the same thing again it's a different implementation of the same program still cloudy, this is belgium and it works again so, and that's basically how you can basically work on projects in gao, you just add to load path thank you so, yeah, conclusion basically really the the way to work at the moment on gao projects is using the interactive ripple uh, in as gaze here inside emacs, together with live coding in buffers and then kind of access to info documentation, that's by far the best way to work on it and that's kind of what I wanted to cover in my introduction uh, so I don't know, I think it's worth maybe like thinking about well, first of all if you have comments or questions, I can I'm more happy to kind of talk a little bit about things that maybe I went through too fast or whatever um, but if not, I have a few comments as well, possibly about I think where gao should go in order to kind of make it slightly more user friendly um, but I think a lot of that has been talked about already previous year and also in the Mikado's presentation for instance and John's presentation as well a little bit but yeah, first of all, anyone any comments or questions? yeah? Will gao ever replace emacs with inline emacs? That question is slightly outside of the remit of my presentation I don't know, I think there's some awesome work that exists and if you're on Geeks SD, actually you can install gao emacs, which actually uses the basically gao as the back end for the mainline right, yeah, mainline, exactly, yeah, so I don't know, depending on who you talk to there's more or less excitement about it a lot of people on emacs probably quite understand we are very concerned about, you know, it's a massive project basically and are quite concerned about the amazing stability that emacs has and what the consequences would be on the other hand there's some really cool, you know, it's just an inspiring project in a way, so we'll see what happens that's my personal opinion um, yeah any other questions? yeah? do you like the feature like debuggers? well, so oh, of course, sorry so do I use any kind of other IDE features like debuggers or things like that so by and large I want for more or less in like basically script based debugging mostly and that's kind of the technique that I use most of the time but for gao I mean there's a debugger that's built into the repo as well so with geyser you basically do get access to the gao debugger as well I didn't want to go into that at all in this presentation because it's kind of a talk in itself really like how to use it but yeah, from within emacs you have access to that debugger and you can do debugging that way other IDE like features I mean auto complete and code completion and code, you know, code jumping and stuff like that is pretty much all available via geyser as well you can combine geyser with company mode which basically gives you all the completion code jumping is by default enabled with geyser and there's also other and this is the thing with emacs right, there's a million different ways to do it so the way that I do kind of, for example project management in emacs is using a little file called projectile which basically allows you to switch to projects and just kind of look at the files within that project that's quite nice I think some of the main is in the key chain is there has been a discussion whether you provide a nice environment in emacs to the tools so you have to do it step by step by hand yeah, any thoughts on that? yeah, no, I think that's a really valid point I mean there are emacs flavors that are specifically directed towards people's workflows I mean the well-known one are things like space max you know, it's just kind of emacs for people who come from vim and just want to continue using vim in emacs essentially personally I use evil and kind of have a heavy customized version of emacs but I think there's no reason why we couldn't do something similar for half basically emacs like an emacs flavor that's basically set up to out of the box provide a friendlier IDE environment for guile development maybe it's more accessible to people who don't come from a vim or emacs background so actually provides the COA compatibility mode by default provides gazier installed by default and working and then basically we can just say to people if you want to start hacking on guile just install this flavor of emacs and you're good to go I forgot to repeat the question the question was can we make it easier essentially to make guile hacking possible on emacs summary kind of discussed this already last night but I'm going to bring it up again what do you think of the idea of providing something like a doctor racket type thing but for guile yeah, so the question is what do I think of the idea of providing a doctor racket style thing but for guile I would think that's amazing I mean doctor racket is basically an IDE and development environment for racket essentially that is pretty much how people start programming racket by and large and I think that kind of tooling would be amazing to have for guile and that's actually probably what my slight problem is about problems getting into guile basically we don't have that kind of really nice I'm a new person I want to learn about guile this is the tool for you to use we don't have that kind of nice standalone IDE and I think it would be amazing to have it the question is just kind of how do we do it or where do we get the energy to it that's more the question any other questions okay, so I would just kind of want to add that I think Chris has started on this as well having a nice interactive tutorial or user journey a story for people who start using guile would be really nice to have as well because the documentation for guile is absolutely amazing but it's definitely more of a kind of reference documentation rather than kind of a this is guile it's an awesome language and try out go with us on this journey and at the end of it you'll be a guile hacker essentially and I think it would be really nice to be able to provide people with that as well also like one of the downsides that I think at the moment guile has really is and we've already talked about that a little bit at the panel I think Ludovic mentioned it other cool and hip languages have language specific package managers which have pros and cons one of the pros is that it becomes so much easier to kind of discover code that is out there and just installing it and using it and guile doesn't have that at the moment and it's a shame because there's like tons of code out there that no one knows about and Geeks to a certain extent just address that but I mean Geeks is a bit heavy for just like if you're just interested in just guile packages Geeks is a bit heavy probably so yeah that's all I have if you are interested in kind of getting help like you're just starting to work on guile and you're kind of interested in getting help the IRC chat is really user friendly my name is Thea on there although I'm not very often on there I must say the main list is super nice as well documentation is fantastic and some of us hang out on Twitter finally before I leave the place here we're organizing a new hackers meeting this summer anyone and all are welcome to come it's a really cool thing it's like 3 days in Germany at this time and basically you should check it out that URL and sign up if you're interested thank you very much thank you