 So hi, I'm PJ. I work at Engine Yard. We're the people behind deus. That's not really what I'm here to talk about So what is Mira? You're familiar with J Ruby Mira is kind of along the same vein when you hear the idea about it It's kind of a more palatable less enterprise way of getting involved in Java if you know Ruby Mira I've been told Had a goal at one point of replacing Java, but I doubt that's gonna happen There's still a lot of work to be done before it gets to a point where it's even competitive, but Java's ubiquitous. It's everywhere. It's In all the code you've seen at some point in time in your life. You've touched Java. You've played with Java How many people have directly done Java not just J Ruby, but literally Java. Yeah, so we all know what it is So in short Mira is an attempt to create blazingly fast Ruby Lake language that can be compiled compile to Java bytecode So what isn't Mira? Mira is not Ruby You could say Mira is Ruby with static types But the fact is that Mira is Ruby like and not actually Ruby It doesn't share Ruby's type system doesn't share the core classes the standard libraries Really any of most of the things that we think makes up Ruby and the Ruby ecosystem It's more like a Ruby syntax browser It takes the Ruby syntax brings it in the JVM tool chain and compiles it for maximum performance I don't know. I'm going a little bit fast, but I have 15 minutes and I had a lot of club matta this morning And I'm holding you back from lunch So Mira and J Ruby the main difference here is kind of the approach Mira is super lightweight There's no runtime library so performance that maximizes performance When it comes to performance kind of Mira wins if you do performance test on it It seems like it's really fast, but it also has limited capabilities on what it can do thus far But the idea was it was built for performance That said J Ruby is so much more mature than Mira It's widely used as a huge community There's a lot of support for it Mira is kind of a fledgling language. It's been around for a while But it's still you know just getting off and starting to run with itself So where did it come from? So there was some dude. I Don't know. I guess he's from like Minnesota or something. He was bored and he made this thing called doobie Which is a strange name. I'm not sure where that came from but around 2009 Charlie wanted to do a Ruby like language subset of Ruby syntax that could compile to solid fast idiomatic JVM bytecode the word Mira Which came along later is actually a Javanese word. So the people who live in Java Their word for the gemstone Ruby is Mira and that's how the name switch from doobie, which is again a questionable word And I think we all see what they did there today It's maintained by Nick Howard who a lot of people probably knows broke Bobcat out on the interwebs it's still in development and People are using it to test out ideas to see what how far they can push it and how far they can go like many Projects it's looking for people to use it looking for people to fix issues and contribute and Let me just add like the wondrous feelings you get when you contribute to an open source project like Mira like It's really good to take something that you think you know I can maybe use this in a small project and maybe build it into a larger project and modularize some things and You start to deal with it and you say okay. Well, I see there's a little problem. It doesn't do this So you take that pain point and you bring it into where you need to fix it and that makes language better for everybody So open source contribute. I'm gonna say that about 80 times So a few facts This slide got messed up I've been having a few keynote issues, but because Mira is essentially a compiler it ships with no standard library I mentioned that earlier The idea is that users will choose what libraries they want kind of a la carte They'll write the plugins. They need to support what they need And the compiler the compiler will take care of the rest and that was an explicit design goal That was the whole idea behind it, you know Why build something but why build lots of things like think rails for a second? Why build lots of things that you maybe might need instead of building a few things? It will allow you to take just the pieces that you need and build them yourself if you have to So Mira relies on the back-end target that the developer prioritizes and provide prioritizes and provides For example on the JVM type system is mostly Java So type declarations refer to the JVM classes in tooling So why Ruby and Java? So as you know as a Rubyist Ruby was developed to bring joy to developers to make developers happy No one has ever said that about Java ever But it's super powerful and it allows you to do things that make you feel fulfilled as a developer Maybe not happy but fulfilled your solving problems. You're getting the jobs done So if we take the thing that makes coders happy and we take the things that make them feel fulfilled We get this hybrid that makes the best of both worlds and now you're both fulfilled and happy, which is great So mirror is kind of like the peanut butter cup of the coding world. That's the way I look at it If you're allergic to peanuts, I'm sorry, but I made the reference and it's out there. I can't take it back So at this point it's really important to know where Mira is at At this point Mira is on version when I left home 0.0.1 4 So it's still in the beginning stages of development. Yes Charles started in 2009 and yes, it's 2015 But there was kind of a dip because I don't know they did some J Ruby something something and you know kind of got put by the wayside but you know It's still something that's active people are getting more involved part of the reason why I got into Mira Was I work at Engine Yard and I'm on the community team And so we look at a lot of open-source projects to sponsor and what have you and one week We were running a little low on blog posts. So my boss like here's what you're gonna do Ruby guy Go on github and find out what the most contributed to repository is this week And I went and it was like Mira Mira Mira Mira Mira now It's like oh This is interesting because I've never heard of this thing before so I dove in wrote a blog post about it That generated more interest and then continued to be at the top for the next few weeks And it was really cool to see something that that could have easily died out But it's actually a great piece of code a great way to program that you know luckily is starting to see the light of day again So let's talk about some guiding principles. I'm going really fast. Wow So according to the Mira site Mira org the language is based on a few guiding principles. No runtime library. This means no jar files dependencies can be decided by the developer Customized to each project Kind of similar to the way that bundler helps Ruby projects remain siloed So if you have several projects, they're not all using the same gems bundler helps you handle that Kind of in a way that RVM helps you handle keeping your Ruby versions strictly for per project It has a clean and simple stint syntax It's static typing syntax similar to the JVM type system, but at the same time borrowing heavily heavily heavily from Ruby There's metaprogramming and macros so built-in tools for macros and metaprogramming So that at compile time you get the feel of a dynamic language while you're still in a compiled language There's no performance penalty And I'm directly quoting this from the site because Mira directly directly targets the JVM's type system and JVM bite code It performs exactly as well as Java Take that for what it's worth Again, that's quoted from the site and it's neither a positive or negative attribution to Mira It's just one of the guiding principles in developing the language. There's also some design principles This is platform agnostic meaning that it roughly it Roughly similar scripts could conceivably compile any number of type systems and runtimes And in that sense Mira is more of a rough coupling of the Ruby Lake syntax with a pluggable type interface and compilation pipeline Mira code has no runtime dependency other than the library is accessed directly from the Mira code So it's kind of like your runtime dependencies will depend on exactly what you build into it It's that a la carte idea. There's no current JVM language addresses The that towards the aesthetic goals of Mira without also introducing a runtime library Which can also also be kind of prohibitive based on size So some general goals The compiler chain plugins for it will be written in Ruby That's kind of moving forward looking towards the future No, there's no specific root reason that they couldn't be written directly in Mira for Mira Adilator date once it matures a little bit The syntax is largely Ruby inspired and we'll see that in a few minutes when I show some examples And to that extent like the current Mira implementation starts with an AST Transformation from J Ruby's AST. So there's a lot of borrowing going on. It seems like it's a real hybrid The type system is purely symbolic with the compiler, you know, reasonably mapping symbolic types to platform appropriate representations All right, so primary elements what goes into Mira the parser is based on the J Ruby parser and That produces a Ruby abstract syntax syntax tree or AST Then it goes to the transformer and the transformers job is take the Ruby AST and convert it into a Mira specific AST Then the type inferrer decorates the Mira AST with appropriate typing information for the back the target back end Which you set up and then the back-end code generator actually compiles the code. So sounds pretty simple How do we get started? This is always by the way, this is something that I notice in a lot of talks people seem to skip like everybody's like Great, let's get started and look at code. No, let's get started actually friggin install something because you kind of have to get there first So let's shave yaks Beginning with any language biggest hurdles getting started with Mira the Authors and the maintainers have given us the opportunity to find our own way by offering a few different methods And there's a lot of methods and that's great and they're outlined on Mira org and in the github project Regardless of what method you use you are going to need to have J Ruby 1.7 or higher I Think prior to version 0.0.12. You could have lesser versions of J Ruby, but now you now need 1.7 or higher It's not going to happen Once you have everything in place and instructions are pretty simple I did it using the the general method that I use doing every Ruby project. So I use RVM For those of you who have known me for a while. I was like RVM patient zero I used to work with Wayne Segwin. He sat in the desk behind me. I went to the bathroom He installed RVM on my computer and broke fucking everything Which was great. So Yeah, sorry, I'm having a flashback So yeah, so you just RVM installed J Ruby and that'll grab the labest version of J Ruby Of course RVM use J Ruby So that's installed if you're using if you're looking for J Ruby 9000 it wasn't available when I prepared this talk But it is now After the J Ruby's installed it takes a few minutes you use the RVM to J Ruby And then you just simply install Mira as a gem if you're from if you're more familiar with Ruby than J Ruby or Java This is the easy way to do it like 10-15 minutes tops like you can barely get your coffee done and it's already done for you So then you're ready to roll So of course we do what we do with every project and we see we say hello world because that's I don't know as My daughter says it's stupid because you're saying hello to yourself and you said world and that's dumb She's 13 she gets angry about programming things So it's really easy you go, you know, you go into your your terminal and you type Mira dash e puts hello world boom everything's working. Yay So let's take a look at something a little more complicated So when I was writing that blog post and kind of getting involved I noticed that there was this huge file called examples Rosetta code and What this is is people who wanted to get into Mira decide that a really good way to do that would be to write some code That did simple things that other people could look and say okay This is simple like you know, it's a few lines 10 15 lines and now I understand a little bit better how this works So I wrote a little thing and it's it's very simple. We have a puts line that's gonna ask me to enter my name Just like we would in Ruby following that we have a read line to bring in whatever input comes from that and Then for verification we spit the name that was entered back out with a little sentence So people know we count the characters including blank spaces And tell the user how many characters there were an entry not super useful Not something you really need to do but a lot of fun And it was a great way to as I said in the comments kick the tires and say okay cool I kind of get what they're doing here and I kind of enjoy using it So to take a look at the output, you know, I entered my name Which I noticed this conference has completely deleted my last name So that's what it is if you were looking at the conference schedule. I have a last name You don't have to say it though and he kicks it back and says this is 10 characters long including a space awesome really simple It's a little applet. It's simple to the point. It's a job done There's lots of examples different, you know string manipulation Arithmetic things like that that are all in the examples rosetta code folder And if you want to get into mirror, I highly recommend checking it out But what else do people do with mirror because this is no one's getting a hundred thousand dollars a year to count people's names One of the big thing that's that's actually come out of it is a lot of people are using it for Android development There's a lot of open projects using mirror for Android development, which is really cool a lot There's a lot of people building plug-ins, which is also awesome And we're getting towards more tools and frameworks the potential Uses for mirror are limited only by what the language currently holds so the more we contribute the more possibilities can grow And it's really it like in my mind. It's really cool because Up until a couple years ago if you wanted to do Android development and you were a Ruby developer You were basically screwed Then Ruby motion finally came out with something it was kind of cantankerous and clunky and it was cool But you also had to pay for it now. You don't have to pay for here's an open source language You can build Android apps natively using a very familiar language. That's very lightweight So some frameworks and tools that have come up dubious is currently the big major player as far as web frameworks for mirror It runs on the Google App Engine provides a way to build apps and mirror the way that rails and Sinatra do for Ruby devs I should say like vanilla Ruby devs. I guess that makes more sense and since mirrors compile There's no like initializations costs like you might see with jruby Dubious has an ERB it has a simple adapter for data that uses a data data mapper like syntax not exactly the same But it's similar And it's important note that like mirror dubious is in the very early stages. So it's growing It's like if you were using like rails one or rails two back in the day, and you're like great this kind of works Good enough. I have a job. Yay There's also pinda Which is really cool. It's a tool set specifically for building Android apps So that's really cool. It does require the Android SDK And all of the examples that they have are using rbm if you prefer that for your version manager Then you're ready to go if you don't then that's cool, too Mira mbm is a cool net beans module for mirror. So if you're looking for a specific IDE to develop mirror in that's awesome If you don't care about your ID, that's awesome, too So what's next the most important thing about mirror is that is an open source project? It's still a baby It's a great chance for you to get in on the ground floor if you always feel like you know Oh, I really missed the train on JRuby or I can't and get involved in this open source project because it's been going for too long And you feel kind of left out. Here's your chance zero dot zero dot one four. You are ground floor start coding a Lot of the questions and I know Terrence knows this when you say you should get involved in open source people I was like great. What what can I do? right documentation right tests Try to build the language just any little thing you can do to help out talk about it. That's what I'm doing I mean, I submitted a code example It was little tiny and when they accepted my pull request I was like, you know every time pull request gets accepted. I do like a little happy dance Pull request accepted, but anything that you do to get people more interested and get them involved makes the language better so Again, there's a lot of potential here to bring the awesome worlds of Java and Ruby together to make that peanut butter club allergies unacceptable To a place where you can give more people more peanut butter cups It's simple to use The compiled aspects helps to eliminate a lot of gotchas that we get in Ruby And while there's still a lot of road that we have to travel before we get to 1.0 It's kind of you know, there are people who are using it for production things especially with Android apps So I went a little bit over my time if you have questions for me feel free. My name is PJ. Ask me for pins. Thank you