 Hello, everyone. Thank you for that introduction, Sarah. So as you said, my name is Jason. I work for New Relic until recently on the Ruby agent, which you might have installed if you've ever used that product. But I'm here today mostly to talk to you about Shoes. So what is Shoes? Shoes is a GUI library built in Ruby so that you can write desktop applications and it runs cross-platform. It runs on Linux, Mac, and Windows. And this library was originally written by a guy called Y, the Lucky Stiff, who, those of you who have been in the Ruby community for a long time, probably remember, and even some of you that haven't been might have heard of this guy. He was a really sort of enigmatic character. He did a lot of very quirky things and wrote a lot of interesting little libraries. And Shoes was kind of the largest project that he built. And we'll talk a little bit more about some of the outgrowth of that. But as many of you know and may have noticed, Y disappeared. He chose to take himself off of the internet, took all of his code away, and left. And a lot of people probably thought at that point in time that that meant that Shoes was done. He was gone, and this was finished. But it's not actually the case. And so that's part of what I'm here to talk to you about today is to show you where Shoes is at, talk to you about the community that's developed around it in his absence after that, and show you how it works, and then peel back a little bit and show you the internals and a little bit of how you can dabble with it. Because today Shoes is written entirely in Ruby. And so if you're a Rubyist, you can access the stuff, you can contribute, you can give back. But one of the key things about Y, part of his presence in the Ruby community was that he was a very weird character. He wrote Y's poignant guide to Ruby. And if you look at it, it is like no other book that I have ever seen. It's just crazy and off the wall. And I thought, you know, it seems like I have to put something into this presentation. It's a little weird, OK? And this is not my personality entirely. I am not that sort of character. But it put me in mind of a situation that I had at university. So I have a friend, Mike Larson, who in my software engineering class, he came up with this concept that he called the learning chicken. And any time that he felt like the professor had made a really good point, he would balk like a chicken. I kid you not, he actually did this. And I don't know why this came to me, but I thought I would try to integrate it. And so any point in this presentation when we've hit sort of a major conclusion or, you know, you've learned something? All right, so the learning chicken is available. And if you feel like you've learned something, like I'll bring it up a few times, but feel free to call out, give me a chicken. And I will give you a chicken during this presentation. All right, so moving back to the topic at hand, I think probably the best way to demonstrate and let you know what shoes is about is to show you what shoes can do and what the code looks like. So let's do a couple of little demos. A lot of the things that happen in shoes drive around games and fun little applications. So here we have a Minesweeper clone. So let's see, we can click some of the things. Well, I kind of suck at Minesweeper. I probably should have practiced that a little further. Chicken. All right, other sorts of games. Here's a snake game. I'm also really bad at this one, but, you know, that gives you some sort of idea of how this will work. Not everything in shoes is necessarily a game. So here's a clock that you can do. There's a lot of basic drawing primitives that you can build things out of. And even further, this presentation is being run on a little framework that Toby and I have worked on called wingtips. If you want to write your presentations in code, but you don't want to write JavaScript, because there's lots of things for doing that. You want to write them in Ruby, you can write your presentations in shoes. And, well, hopefully you can see the result and think it's awesome. Okay, the biggest application and the key point of why built shoes in the first place, though, was a program called Hackity Hack. It was intended as a kids code editor to help get children programming. And this is the thing that I've done with my daughter Coraline, small plug again for that video for you to go check it out. She does, I have never live demoed code, but my five-year-old daughter has at a technical conference. It's a good way to do that. So you should definitely check it out if you want to learn more about programming with children and see some of what we built out of it. But let's take a look at the ecosystem that developed after why left. So the original shoes was written in with native bindings in C, and it worked across all of these things. And a lot of different people sort of fragmented off from there. So we had a version called Green Shoes that was built on GTK. There was a QT version, SWT, HTML versions of it that implemented this DSL, an SWT version, a coffee script version, so many different versions of shoes that sort of fractured off from here. And all of them took the DSL that Y had created and provided it with a different backend, a different flavor of how to implement that. And so eventually after a lot of this experimentation, the community came around and gathered to decide where to go as a project, and that was the birth of Shoes 4. The architecture behind Shoes 4 takes that fragmentation into account. And one of the big pieces of it is that it built a separate DSL layer, which is the common things about how you express a shoes program, how you write those primitives, what things are supported, and separated it from the GUI backend that actually drives it, with the expectation that different people might want to provide a different backend. Now, the first backend, we had to choose one to start our implementation with, and that was built on JRuby. A lot of Rubyists, when hearing this go, isn't that a lot of Java? Why would I want to do that? But it has been a fantastic platform for what we're trying to accomplish, because one of the JVM's great strengths is its cross-platform nature. So SWT is a GUI library that comes built in with the JVM, and it means that all of those issues of how do I draw this widget on Windows so it looks right, and how does it look correct when it's on a Mac or Linux, and all of these differences in the GUIs that are there, are hidden behind this layer that the JVM provides for us. So JRuby has allowed us, as the Shoes project, to simply write Ruby on top of that, and gain all of that cross-platform support that we want, because we want anybody on any computer to be able to write a Shoes program and write things that they can interact with immediately. All right, so that's a lot of talking and introduction of what Shoes is. Let's take a little bit of a look at the code for it. So one of the most basic Shoes programs that you could come up with, you say Shoes app, do, and you give it a block, and that is your Shoes program. It provides you with methods in this DSL where you can create different elements, and we're gonna go through a bunch of what those are. But since this is a Shoes app here, we can just run this code, and that's what it looks like. Pretty impressive, I know. That seems like chicken material to me. But seriously, if you've done GUI programming in a lot of other settings, it probably looked a lot more like this to get to a hello world. Now, I don't know about you, but which of those would you rather type? Or which of those would you want to sit down with a kid and try to get them to do something fun with their computer? Well, I think the answer is pretty obvious. Obviously, just putting text on the screen is pretty awesome, but you might want some amount of interaction, so we have buttons and alerts that you can do. If we click the button, hooray, alerts all over the place. There's text editing, all the basics, if we say hello. Step in there. And these programs, I mean, you look at that and it's just, it's really clear, it's really concise, and it's easy for someone, even someone who's just new to programming to understand what's going on and what these pieces are gonna do. One of the big issues that you run into if you do any sort of GUI programming is layout as well. I know I've definitely struggled with building a window and positioning all of the things and giving everything little coordinates for exactly where it should be. And you can do that with shoes. You can absolutely position stuff, but it also provides you these powerful abstractions that we call stacks and flows for being able to build kind of a little bit more responsive layout for things. So if we put a bunch of our banners inside of a stack, a banner's just a large piece of text, when we run that stack, it looks like this. So each element goes on to essentially after a new line, it positions it below the prior element. With a flow, the elements will flow up until the point that we run out of space on the window. And so if we resize, you can see that it flows down to the next line. So between those two things, which can be nested together, you can build very complicated UIs without having to specify a whole bunch of really detailed information about where it's positioned. All right, so that's great, but I don't know a kid that really wants to sit there and build a bunch of text boxes and buttons. You know, it's fun for a little bit, but drawing pictures is really where it gets interesting for a lot of different intro to program sort of people. So let's take a look at the primitives we have there. Shoes will let us draw a rectangle. So we give it the coordinates where it starts at and the width and then some other options you can tell it to give it colors and strokes and the different aspects of how to draw it. Now this is also a good point for me with beginning programmers or with children is that these coordinates, this is a really powerful way to talk about math because the positioning of where things are, the relative size of those elements, looking at it interactively and changing those numbers and watching how things work is a great way to do some really basic arithmetic and make it very tactile for them in a way that just plain numbers aren't. We've got ovals, we've got stars, we've even got arbitrary shapes. So you might, you probably don't recognize this, but this is the red portion of the chicken's comb described in shoes as a shape that goes together. And then here is what Sarah alluded to. My daughter's first open source contribution was this sample application that we did together and it looks like this. So you can see this is a really powerful thing to work with a kid to draw because what we did is we sat down and we said we wanna draw a face. Well how would you draw that? What are the pieces? How can we decompose this problem into separate steps that we know how to do in the programming language and then instruct the computer about how to do it? There's all sorts of other things. Obviously there's sound, there's animation, there's widgets that you can build to wrap things together. There's a lot of different pieces to how shoes let you do things. But let's move on and let's kind of peel back one more layer below it. I mean we're all Rubyists here, we're all programmers, my enlarge. And one of the things that I love about shoes is that you have access to the code and as a Rubyist you can get into this library and understand what's going on in it. So this is in large part thanks to an excellent gem from Dan Lowellcraft that wraps the SWT library that comes directly out of Java. So this gives us actually a very Rubyish way of accessing these Java objects for creating the GUI. Like I alluded to earlier, the shoes project has kind of a nice clean separation between the core parts of our DSL, the parts that would remain the same in shoes regardless what GUI backend you have for it. And then the pieces that actually provide that UI to draw it. So what we're gonna do here is let's step through an example and we're gonna trace it from the shoes application that we draw all the way down to where we interact with those primitives that SWT provides with us. And you'll see kind of the shape of how any shoes program works. And hopefully learn to find where those pieces are if you wanted to dig in and do something yourself. So here we have a progress bar which is one of the primitives that's supported by shoes. And then we do a little animation on it that sets the fraction. So we can see it in demo here, it fills on up. And then we're good to go. So that progress function that we have right there is implemented in a file called dsl.rb within shoes. And we can see here that it has a shoes progress class and it's going to create an instance of this. Shoes like most Ruby is very object oriented. So everything that we're gonna represent in here is gonna have an object. So there is a sort of DSL level class for the progress object. Let's take a look at what that object looks like. So it says that it's a common UI element. It has some styling. And it has some attribute readers, most of which makes some sense. The GUI one is the one that's the most important to us. That's where we stitch together between the DSL layer which is kind of agnostic to how it's gonna get drawn. And the GUI is the object that represents how that's actually gonna get to the screen. That's our SWT object. Then we also have styling. That defines the accessors that are available on this object. When we create one of these new progress objects, we do a little bit of setup, but then this line in particular is the important one. So we talk to our configuration and then we ask generically to go get the backend for this object. So that's where the magic happens of us being able to plug in a different GUI backend and have this DSL interact with some other library. The DSL layer also then provides little accessors for the various things that we need to push through. So when you change the fraction on it from your shoe's application, this is where it pushes that through and actually sets the value that it needs to over on the backend. So we've talked a lot about this backend object. What does it actually look like? So you can see we have a different module namespace, our shoes SWT progress. And then finally we're getting down to creating some of those real GUI primitives. So SWT provides us a native toolbar and we set that. And you can see that the values that it takes are a little different. It goes from zero to 100 rather than using a float for the fractional value. And so when we set the fraction, we actually need to do a little bit of math and we need to check whether the GUI element's disposed. There are all the concerns of how we interact with that GUI library that we deal with, but we only deal with them here. The DSL layer, the nice clean layer of shoes gets to be unaware of all of these details that are going on under the surface for it. So one thing that's very difficult in a lot of GUI programming in my experience is testing. But shoes actually allows you pretty easily to test things because everything's represented as objects. So here we have a fairly standard RSpec implementation of us testing our DSL object. So we check here that the communication between the DSL and the GUI back end happens the way that we expect. When we set a fraction we expect it's gonna get forwarded on to that other object. And so by having those teased apart, it gives us a really clean way to check that the DSL behaves the way that we want to and has the contract to the back end that we expect it to. Similarly, the back end can get tested the same way. Its interactions with its back end, with its actual implementation in the SWT library can be mocked and stubbed and tested with all those good practices that we already use in Ruby. I don't know about you, but being able to test GUI stuff, that's a pretty chicken moment for me. It's pretty awesome to be able to do that. All right, so that's a lot of how shoes works. All of the different elements that you see on the screen are gonna be structured like that. But let's talk about actually getting involved. Shoes is a very special project to me because it's the first place where I've really deeply gotten into an open source project. And here's kind of where it started. So at work, I had just implemented Guard on one of our projects. I thought it was pretty cool. I'd looked at Hackity Hack with my daughter and then started looking at some of the GitHub repos behind it. And I noticed an issue that was out there for installing Guard with shoes. And I went, oh, that seems like pretty easy to do. Maybe I'll get out there and I put that in got a lot of really good feedback and the people were very friendly and it kind of took off from there for me. So shoes is a very open project for people to get involved with. We have a newcomer friendly tag on our issues and the people that are on the project are really eager to help people of any level get involved with it. There are things, everything from writing samples and documentation all the way up to some pretty gnarly, deep stuff that if you wanna get involved, you can do it. So I would hope that you would consider if you're wanting to get into open source and maybe you've been either intimidated to find a place or just haven't found the right project. You know, you might give it a try. Thank you.