 one, thank you for coming. My name is Jason Clark. I work at New Relic, although that has nothing to do with this talk today. So this is something else entirely. Before I get started, I have a quick little story and a request for you all. So back in college, one of my best friends, I actually known him since I was like five years old, we had one class together the whole time. It was a software engineering class. And my friend Mike is a, he's a funny guy. He's kind of quirky. He's got, he's a lot of fun to be around. But the funny thing that he did in the software engineering class was he introduced a concept that he called the learning chicken. And any time that the professor said something that he felt like was particularly profound, he would balk like a chicken. Okay. Now this, go with me on this, but I love this. This was so much fun. It took, you know, it just took this software engineering class that could have been kind of dry and just sort of like, you were waiting for that moment when Mikey was going to balk like a chicken. And, and it helped. So I thought that I would bring that forward. I thought that I would, I would introduce all of you to the learning chicken. So today, during this talk, if at any point you feel like you've learned something, I want you to yell out, give me a chicken. Let's practice. And we'll have the learning chicken with us. Now, if you don't do it, I might find a couple of moments to put it in there myself, you know, but call on me. Let me know when you're feeling inspired and you need the learning chicken to show up. So we're here today to talk about shoes, but the motivation behind some of this talk and behind this piece of software called shoes is really answering a question that I hear from beginning programmers a lot of where do I start? There are so many different ways that you can approach computing today. You know, a common thing that somebody might recommend is web, right? Like everybody's got a browser on their computer. Everybody can write some HTML and JavaScript. And that is a great starting place, but man, taking a step past that, getting into servers and HTTP and like, there's a lot there for a beginner to try to cope with when they're just learning the basic structure of programming. You know, it's, it's even worse if you're talking mobile. Like it would be a natural thing. I want to put something on this phone that I spend all of my time staring at, but that's, that's even harder. You've got all the IDEs and, you know, the statically typed languages and things that come into play. That's, it really is difficult for somebody to start from there. So today I want to propose to you a radical idea. Maybe a little too radical, but there's another place. We can write computer programs that run on our desktop. Exactly. I don't know. Is that a chicken? Is that a chicken for anyone? The fact, like we can run programs right there, the immediacy of that feedback that we can get. And you know, so this is not a bad idea, but if you're like me and you've ever tried to do some GUI programming or done desktop programming, a lot of it looks kind of like this. You know, this is not to pick on Java. I've seen very equivalent stuff in C++ and C sharp and even some of the Ruby libraries that are out there that bind these low level GUI pieces. You know, they're, they're kind of ugly and really hard to, hard to look at, hard to write. And if you're just coping with programming, this would be a really difficult thing to try to get to. So into that space, that's where Shoes comes in. Shoes is a GUI toolkit for Ruby. It's basically a DSL for making it pleasant and easy to write GUI applications that can run on Windows, Mac, and Linux. It's cross platform because we want everybody with any sort of computer that they might come to the table with to be able to write these programs. So to get the current version of Shoes, Shoes 4, which we'll talk a little bit more about later, it needs JRuby. So you got to go use your Ruby manager of choice and get yourself a copy of that. Then you gem install Shoes. Right now it's still at a pre-release state. And then you can just say Shoes and point it at a Ruby file that has a Shoes application in it and it'll go and run it for you. So let's take a look at what Shoes applications actually look like and compare and contrast this to that example that we had before of what older GUI programming looks like. Here we have the minimal Shoes application. You say Shoes.app to start the thing up, you give it a block. We make heavy use of the block construct in Ruby to do different things. And so that block will run and whatever happens inside of it's your application. Right now it's empty, but we can see this is a Shoes application itself that I'm presenting with so I can run this code live for you. And that's what it looks like. Not the spotlight search. It looks like that. So we have an empty window in two lines of code. I don't know about the rest of you, but I feel like that's a chicken. Is that a chicken? Two lines of code to get a window? So, you know, empty windows are all well and good, but that's not going to keep someone entertained for more than two or three hours. So we want to put something into that window. One of the basic primitives that you have in GUI applications is text. Shoes provides a number of different helpers to kind of let you show text at different sizes. There's ways of controlling all of the styling of this that we'll look out later, but it gives you some simple things right out of the gate. So if we run this application, we see three pieces of text. One in the title size, one in the tagline size, and one in the paragraph size. And that's all you need to do to start putting content into one of your windows. Again, you know, putting text into a window is only going to keep people amused for so long. Eventually they're going to want to interact with their program. And this is one of those spots where Shoes uses Ruby's block construct beautifully, I feel like. Rather than having to like set up anonymous functions and do all sorts of shenanigans like that, you just call the button method, give it the text of the button that you want. And then the block is what happens when that gets clicked. Perfectly natural. Shoes provides an alert method, brings up an alert box. So let's see what this looks like. All right, we have our click button. Will I click it? Sure. And when we click, we get our alert. Now that's all well and good. But eventually you want input from the outside world. You want people to be able to put things into your program. And there's all of the basic form elements that you would expect or in Shoes. This example uses the edit line, which is a single line text box. We assign that object for that edit line into a variable. And then we can see how we can use that later inside of our block. So that variable follows Ruby's normal scoping rules. And so when we click this button, it will alert us with the text that we put into that box. And so we'll say, what? Huh? All right. And when we click it, we get the alert the way that you would expect. I will give you a chicken. I mean, and I don't mean to belabor the point, but like this sort of stuff takes a lot of wire up in a lot of other gooey frameworks. This is not much code in it. It pretty much just does what it says. I love that. So eventually, if you're making an application, you're going to care about how things are laid out. And Shoes, while you can position things explicitly on the screen by pixel value, you can put every single control exactly where you want it to be. That gets a little onerous. And so Shoes provides a couple of things called stacks and flows that will control how the elements that are inside of those are laid out. Stacks will arrange things vertically. So each element gets on its own line and things are placed below it. So in our case, we've got all of these banner text bits, and they are stacked. Flows do the opposite. They flow things across the screen and then wrap to the next line when they hit the edge. So here we will have enough room in our window to show those all the way across. But if we scrunch the window shorter, then the elements move down. The text elements will break across the line. Things like a button would just hop down when it can't fit. But it very naturally flows a little bit like things do in HTML, but without me having to put like five div tags in a clear both on something that I don't understand. So Shoes is driven off of a lot of styling properties that all of the elements have. So here's an example of how you access that. Again, uses Ruby's hash syntax on methods to very naturally let you access those, those bits. You can set the font, the color, the size. All of the elements have a lot of properties that are documented fairly well. They'll get better documented before the final release. And this looks like that. So pretty much anything that you want to control in there, you have the capability to. So these are all well and good. But the other thing that I found, I've done a fair amount of programming with my kids and some of their classmates using Shoes. And you know, text and text boxes and buttons are fun. But a lot of kids like to draw. They like to make pictures to put things on the screen. And Shoes provide some basic things that make that fairly easy as well. A lot of the typical shapes that you would run into are supported directly with methods. So this makes a rectangle and an oval and a star. And we can see as well I'm using fill which dictates the color that goes into that. My daughter has spent so many hours picking the colors for the objects that we're putting into our Shoes programs. It's, it's not even funny. I think she likes that more than the actual programming. But you can very quickly lay these objects out and have them show up on the screen. So this application looks like this. You can see as well that when the shapes overlap or when the order that they're written in the Shoes program is the order in which they're drawn and things will kind of overlap over each other. And this is a really powerful thing for kids to start understanding. It gives them a little bit of procedural thought, right, about the order that we do things in changes how it displays on the screen. So if I want to put something on top of another shape, I need to order those in a certain way. Which brings us to probably my favorite contribution to open source ever. This is one of the samples that's in the Shoes project that my daughter and I did. And she work did most of the work of figuring out what the shapes were to put this together. And it was a great exercise for her in thinking about how to take a picture that she wanted to draw and decompose it into each of the little component parts and put those together. And there's what it looks like. This chicken is for Cora. She was disappointed that I'm not on the live stream today. So she'll she'll get the video eventually. She'll appreciate the chicken. Thank you. So that's a brief tour of a couple of the most important things that are in the Shoes DSL. There's a lot more. There's ways that you can make widgets. There's animations. There's lots of other form sort of elements that we haven't discussed. So there's a lot there to play with. Let's demo a couple more sophisticated things that we can do. So this is one of my favorites. I just I love how the very simple act of drawing these ovals with a little bit of opacity stacks and gives this kind of cool effect. It's actually this is only like a six or seven line shoes program. It draws a pretty interesting image. Games are obviously a huge motivator like probably a quarter of the shoes samples. The sophisticated ones at least are games of some sort. So we have a tic-tac-toe program. We can do really bad at tic-tac-toe. I should probably practice that a little more. And then one of my other favorite ones when I'm testing the samples working on it is Tetris. I find myself like playing the game when it pops up instead of continuing my testing. I've never had a problem with this sample but I test it really really thoroughly whenever it comes up. I don't know I'm tempted to just play Tetris for a while here but I'll move on. It's probably best. So there's a lot of things that you can do with with all of those basic pieces that we talked about. But one of the other cool parts about shoes is the packaging. So if you're a beginning programmer like getting your program into somebody else's hands can actually be a real pain. Like distributing software is hard. So Shoes provides a system for making that a little bit easier. With the with the Shoes gem you can give it a package command and then you can ask Mac, Windows or Linux and point it at your Shoes application file and it will generate an appropriate application bundle for that particular platform. This also works cross-platform. So if you are on a Mac you can make the Windows version. You don't need to be compiling on a Windows machine. If you want to distribute it to your friends who are running something different all of that is totally supported out of the box and that is harder than you would think it is to actually make happen. So those Shoes packages come out the other end is a compressed file, star GZs or Zips, whatever's appropriate for the different operating systems and here's an example of one of those unzipped on my Mac. It just looks like an application. The Mac is probably it's the one that's given us the best polish. There's still work to do on Windows and Linux to make those as native as we'd like them to but there's a runnable thing that you can ship to each of those platforms. So that's what Shoes is. Like to me the heart of it is this simple DSL and the packaging to make it easy for you to share your work with your friends but part of why I care about Shoes as well is its history. So Shoes was a project from a guy named Why the Lucky Stiff. Who here has heard of him? Okay quite a few but I'm glad to see that not everyone has because I think he he's not around anymore in the Ruby community and I think it's worth talking about his work. One of his big projects that he did was called Hackety Hack and Hackety Hack is a kids programming environment intended for you know beginners to kind of get started in GUI programming and Hackety Hack was built with Shoes and built to let people run Shoes programs. This was one of many projects that Why did back in the day but this is the one that for me kind of hits home the most. But as I mentioned Why is no longer with the Ruby community in 2009 he up and disappeared deleted his code dropped his website was gone. Fortunately thanks to get in various other things people had copies of his code and some of his his projects but you know many of them kind of fell into some disrepair and I think for folks that may have been around you may be surprised to hear that Shoes is actually still alive after Why disappeared. A lot of folks assumed that that was sort of the end of the picture. But some interesting things did happen in in the post Why era with Shoes. What the Shoes code base that Why left behind was a lot of very complicated native C code with a thin layer of Ruby on top of it. It was not super maintainable it became very hard to compile it as time went on on new operating systems and it was really difficult for people to manage but people loved Shoes like people love this DSL the simplicity that it brought and a proliferation of Shoes came out of that gap after him there was a green shoes rewrite which used GTK to back it a graphics tool kit there was blue shoes which is similar thing with QT there was a SWT swing version that was run based on the JVM this actually is kind of the predecessor to what became Shoes for there was HTML and JavaScript versions of this that came out another SWT clone called purple shoes a coffee script version if you didn't like writing JavaScript like there was just this burst of different people trying to accomplish the same thing that Shoes was but do it in a more maintainable way a way that folks would be able to carry forward because I don't know about you but I'm not that keen to write native cross-platform GUI C code there were so many options and eventually this kind of community that was around Shoes did consolidate and they consolidated down and started these shoes for project now rewrites are often fraught with peril it's it's a tough thing to take something and try to redo it from scratch but in this case it seemed necessary it seemed like the way that I project needed to go to give something maintainable for the future so part of that is obviously the cross-platform nature of the beast like we want some way to simply have cross-platform UI support and it turns out that one of the best places to get that is Java Java is cross-platform Java does all of this hard work to make things work on Mac Windows and Linux and they have these things built into the box and fortunately with J Ruby that's very accessible to us from Ruby land this allowed Shoes for to be built on top of a very robust cross-platform UI system but still have Shoes be written entirely in Ruby Ruby that is accessible to any one of you in this room if you crack open pretty much any file in Shoes for it's gonna look like Ruby code the naming might be a little different than you're used to in a few corners but otherwise it's just Ruby and I am super happy to announce Shoes for started in 2012 and just last weekend we finally got out the first release candidate for it and I feel like that's a chicken moment for me it has been a long time coming and I'm super excited so grab your J Ruby go install it file bugs I'm hoping that we can hit the full release maybe by sometime around New Year and it's exciting times for Shoes while that was going on though an interesting thing happened a lot of folks that were in the kind of Shoes community had tried to carry wise code forward and I mean had trouble even getting it to compile in some cases but people stepped up people people loved Shoes they loved what was there and so Shoes three actually gathered a couple of maintainers and has kept alive they have been able to make it a lot more stable in terms of being able to build it for their platforms they've even introduced some new features and so Shoes three is also a continuing project that is around it continues to be largely written in C so that's that's one of the trade-offs if you're looking to contribute to it and your Rubyist may be easier to contribute in Shoes for it does have some advantages as well like it can run on a Raspberry Pi because it is more of an MRI based thing and JVM's memory and CPU consumption's a little much for a Pi to run just yet and this is another thing that I'm super happy to announce for a while the Shoes three team had been off in their own org they had kind of had a fork that was running but we are all back together in the Shoes org now so Shoes three and Shoes four both of the working supported code bases for giving us this lovely DSL that we all all want are all in the Shoes org. So let's talk for just a minute about Shoes four so I'm saying hey it's all Ruby this is something that you could take a look at so let's give us a little snippet tour of how the code's laid out in case you want to get in there and dig around so Shoes four is kind of a mono repo sort of set up a little like Rails if you've looked at it where multiple gems are all present in the same repository the main gem is called Shoes but this gem doesn't really actually do much it's pretty much just a meta gem that installs the other dependencies and has a small amount of the executable like the Shoes executable that you get that you run from your command line comes from here but very little else the main guts of Shoes is in two packages right now one called Shoes core and one called Shoes SWT and this we refer to in the team as the DSL layer and the back end and one of the explicit goals of Shoes four was to make that separation to have the DSL that the user interacts with and the code to support that be something that's not inextricably bound to the particular GUI platform that we're working on so the dream is that if somebody came along and they're like you know I would love to have this work on mobile or I would like this to target an electron app and spit JavaScript out the back end of it or some other way of actually rendering Shoes onto the screen they would be able to provide an alternate gem for the back end replace the Shoes SWT with their own thing and have a well-specced out way of interacting with the DSL so we're set up for the future we ever decide that SWT is not the thing that we want there's an easier better way or a different way of doing it that is something that we can approach from the architecture that's been set up so as often happens in the Ruby community this is built off of other people's efforts there was an SWT gem that does a lot of nice wrapping of the lower level Java primitives for us and we pull that in and so we're very grateful to that project which has been a sort of the bedrock of our interaction at that level the packaging support has its own gem so it's called Shoes package but this is built primarily off of Warbler which is a piece of technology in JRuby that allows for packaging up your Ruby code into a single Java jar file so that's kind of the unit that we pack around Warbler does a lot of great work for us it all that it generates is jar files and that doesn't look like an application it doesn't look like a native application for people on their particular machine and OS so for that there's another project in Shoes called for Oshiki and this is kind of a layer on top of Warbler that does the OS specific packaging it knows how to make something look like a Mac app from a jar file that you provide it and while the only client of this that I'm aware of is Shoes this was actually built to be usable by other people if you have JRuby based code that you wanted to package up as a native looking application you might want to give it a look last but not least our manual is also extracted to an entirely separate gym this has all the content in the code for being able to run it this allows us to do things like share that content between our website and have it as an interactive manual that runs as obviously a Shoes application so that's a lot about what Shoes is want to talk for just a minute and encourage you all to kick something back and you know the Ruby community provides so many benefits to all of us there's so much amazing stuff that you can just go to a website and download and type a command in your terminal and suddenly you have you know software that honestly 10 years ago I couldn't imagine would be at my fingertips and it's a great thing if you can find places to get involved and to kick a little back to projects and things that are out there it's also a really fun way to learn new skills and get more comfortable with writing code that isn't necessarily the thing that you do in your day job and I feel like Shoes is a really interesting candidate for that I'd encourage you to maybe take a look and consider getting involved we have a newcomer friendly tag on our issues and so there's a few that are out there that are a little more tractable for folks just wanting to get in it's it's an interesting different place like if you've mainly written Rails code or you've mainly written web focused sorts of applications desktop GUI software is different it's it's still Ruby but it's a different approach to things in a different mindset so it's worth considering getting into and whether you do or not you know I my last big announcement about the Shoes project is that I have stickers for the shoes for release we got a new logo designed and I have stickers of the classic shoes logo for those that have some nostalgia there so come up and talk to me and ask for a shoes sticker that's all I got thank you so the question was whether the Shoes core DSL is decoupled enough to from the JVM to be able to run on Shoes 3 it is definitely decoupled enough from the JVM that it could run on any Ruby version we there's nothing JVM specific in it it talks to a certain namespace for back end classes and all of the stuff this JVM specific is behind those other classes I knowing a little bit about how Shoes 3 is laid out I think it's unlikely that they would actually use it in that way there's just too much invested in how the native code binds to those other pieces there has been discussion of whether we could share some spec suites some of the testing that we have and some of those pieces so there's there's definitely some ground for sharing things between the projects so we just got back together in the same org so I don't know if renaming is is high on the priority list but yeah it's it's a little confusing so it's worth with us thinking about yeah the question was whether Shoes 4 will download VMs and add them to the package and the answers yes so it will try to use a JVM that's locally installed out of the box if it doesn't find that we have a copy that we will pull down and use locally and everything else that's it needs is inside of the package so what are you meaning native libraries or so Ruby libraries are definitely supported so gems get into the package so gems are pulled in into the thing that warbler puts together if you had something that you know did some sort of ffi out to a native library I don't think warbler would see that and pick it up so it probably would not fully you know do all of the things but that's a that's a really great question yeah so the question is sort of the difference between Shoes and Electron I mean so I haven't done a lot of electron development so I can't speak deeply to it I feel like Electron is largely I mean you have everything that the browser provides sort of available there inside of inside of those electron apps Shoes is a lot more constrained it's a lot more opinionated it's trying to give you a very simple way of getting started so like if you were wanting to do something with a lot of really intense super precise layout shoes may not be the right choice but it is very simple to get started and you know it's Ruby I think for me that's also part of the draw is that just as a language I enjoy Ruby and I like it for beginners in a way that I haven't found JavaScript to be quite as quite as simple like I could sit with my daughter when she was six years old and kind of dictate writing some Ruby and it kind of made a little sense to her where JavaScript would have been much more of a stretch for her oh did I make the presentation with shoes yes in fact this is using a library called wing tips which is a presentation library built on shoes so you can write your stuff like so and as you saw since it's a shoes app it can run shoes code and it's Ruby so you could potentially find ways to run other example Ruby code yeah it's kind of fun um so the question was whether there's an easy way to like capture what's on the screen I think it would play well with native sort of OS stuff we haven't built anything in although I had had that thought of like we had to have like a screen capture method that you just could call and would you know save an image for you I'll need to do that to like I feel like I should make a PDF of these slides but that's a little yeah a little different so the question is what other sort of production uses there might be out there I have heard of people writing sort of like little utilities for work you know like a network monitoring thing or something where you need to you know hook up to some internal system I that's about the extent of it I haven't heard a lot of folks putting it into real practice but you know the packaging side of it was what was really attractive in those cases that I have heard like being able to just make a thing that you tell somebody to just go drop on their computer and run it was kind of the selling point for it in that case so it's I would love to see it but I I don't know that it's there yet that said every once in a while I run across things I'm like oh some I didn't know that they were doing that with shoes like there's a lot of people out there that I think are using some of these pieces and may not be like chiming back on the repo or filing issues which is the only way that I would know that they're using it at all so so the question is whether there are any learning curriculums using shoes I'm not really aware of any except for a small amount of tutorials that are in hackety hack itself so it's it could be out there again you know I don't get magically notified whenever someone does something so if anyone does know of it or has heard about things please ping me and I think that's probably about time so thank you so much for your attention