An Introduction to mRuby | Ruby Creator Yukihiro "Matz" Matsumoto

This content was created by Tim Draper. This content was uploaded by Tim Draper. This is a YouTube talk titled "An Introduction to mRuby | Ruby Creator Yukihiro 'Matz' Matsumoto" (recorded/posted 2016-01-11) in which Yukihiro Matsumoto (Matz) presents MRuby. The speaker (Matz) explains MRuby's origin in Fukuoka, its goals (embeddable, minimal, modular), motivation for a Ruby implementation suitable for embedded systems, historical context about Ruby VMs (MRI/CRuby and YARV), the project funding from Japan's METI and the decision to open-source MRuby, and technical influences (Lua VM) and design trade-offs and APIs compared to CRuby. The talk appears to be a single-speaker presentation aimed at developers and industry stakeholders interested in embedding Ruby into constrained systems.
Chapters
As he introduced, I'm Mats. Yukihiro Matsumoto. But it's kind of difficult to remember my Japanese name, so just call me Mats. So today I'm going to talk about MRuby. Just because, you know, MRuby is started in Fukuoka. And I came here with the Fukuoka delegation. So today I'm gonna talk about MRuby. But you might feel— think about the other stuff, like CRuby, Ruby 3, or Stream, the other programming language I'm currently working on. So, I guess we are going to have some kind of a Q&A session afterwards. So, feel free to ask me anything. So, MRuby. So, the M in MRuby stands for many things. For example, so, Mats, embedded, minimal, and modular. So, so the Mats means it's, it's created by me. So— You may know that the Ruby language was designed and implemented by me. But many people called my Ruby, yeah, the the canonical Ruby interpreter as MRI, Matz Ruby Interpreter. But the, the, it's not, the, strictly speaking, it's no longer the Matz Ruby Interpreter any longer. Just because, you know, the, my interpreter was used until Ruby 1.8. So— Until 2007. So, in 2007, so, we replaced the virtual machine. The code named Yet Another Ruby Virtual Machine. Yeah. The, or YARV, in short. In the early 2000s, so, we have a lot of attempt to replace the Ruby virtual machine. And then, as you may know, writing the simple virtual machine is fairly easy. It's a kind of, you know, the practice in the CS class. But the real-world working virtual machine is extremely difficult. So, back then, 15 years ago or so, so we had several, or maybe 4 or 5 attempts to to create the virtual machine to run Ruby programs. But only one of them succeeded. The other one, all the others failed to implement the complex, very complex Ruby programming language. So the YARV succeeded to run all the Ruby programs, passed all the Ruby test suites, so that we integrated that virtual machine into the Ruby, the Ruby. interpreter. So since, since then, so the, the term MRI, Mass Ruby Interpreter, is no longer appropriate. So we often call it CRuby. Compared to, so JRuby is implemented in Java. So the, the, the Ruby interpreter is written in C, entirely in C. So we call them, often call them it C Ruby. Well, and then comes M Ruby. So in 2010, I guess, so the, we are, I and several team, several developers in Fukuoka Prefecture, I was discussing about extending the future of Ruby language. So in Fukuoka Prefecture, we have a lot of software companies, as Professor Tanaka introduced. And then— but no, some companies working on embedding field. Just because in Japan, so we have a lot of the manufacturing companies like Toyota or Panasonic or Sony or something like that. There are some software companies working for those manufacturing companies. So in Fukuoka Prefecture, there is the software companies has their strength in the embedding field. So, but usually those programs are written in C or C++ or in assembler. Right. So, but, you know, writing in those programming languages is kind of difficult and difficult to modify and update and create. So in the embedding field, the ratio in the system of the soft— ratio of the software in the system is getting bigger and bigger each year. So they wanted something more effective, productive and easy to create new systems quicker and easy— quicker and cheaper. So the— so we concluded if there is the language which is very effective, very productive, and that can be applied to the embedding field, that would be very, very useful in the future. Because the machine power in the embedding field, you know, the microcontrollers are usually very tiny, weak computers, but its power and the resources are getting bigger and bigger each year. So, in a few years from 2010, the computer for the embedding field would be even bigger than current PC. So that's why we started the program to, we started the project to create the alternative Ruby implementation which can be suitable for embedding field. So that project started in 2010. So then we applied the grant from the METI, which stands for— long— Ministry of Economy, Trade, and Industry of Japan. So Japanese government fund. So we applied the program. They gave us a grant. How much? So the project started. So several companies and myself is working on to create a new implementation of the language, which is basically conforms the recently defined ISO standard of Ruby programming language. But the— in fact, most difficult part of the project is to persuade the government to make it open source. So, you know, the people in the governments usually don't understand about the software IT industry and even open source. So they wondered why we want it to be open source. Just because— but we want to invest help industry in the Fukuoka Prefecture, or even in Japan, or even all over the world. So to help them, to encourage them to be more productive using MRuby, so making it open source is the best way. So we try very hard to persuade them to to allow us to make it open source. And then it succeeded. And then, in 2012, so we could make it open source. So in, in tech— technical aspect, the, the MRuby virtual machine is heavily influenced from the language named Lua, which is from Brazil. And it is very popular among the, you know, embedding field. But the Lua language is quite small and relatively weak compared to Ruby. So we— I took the Lua virtual machine and made a heavy modification and improved a lot. And then we put a better API, then make it conform— make MRuby to conform to most of the ISO standard. I say most just because the MRuby has very limited in aspect of the portability. And so, we cannot implement some part of the ISO standard. So, the MRuby, by its definition, is designed to be embedded. So the, the embeddable means we provide API to embed in systems or applications or even in the devices. I mean, so, the CRuby has API also. But its API is designed to enhance the language. You can add new features or add a wrapper to the existing CRuby library or something like that. So you can add new features to the language. So the application or systems is supposed to be written in Ruby. Right. But in contrast, MRuby is to enhance the system using Ruby. So you write your systems, your application, your device drivers in C or other programming languages like Rust or C++ or even Go. And then you can add the language feature that, for example, for configuration, or writing into some kind of algorithm in Ruby. So you can write part of your application in Ruby. And then most of the system is in C. So the big picture is totally upside down. Yeah. So,
More from Tim

He Sold His Car to Build This Startup, Then Pitched It for $1M 😳 #Startups #AI

This Startup Moves Your Crypto BEFORE Hackers Can Steal It 😳 #Crypto #Cybersecurity

15 Months Without Refrigeration?! This Startup Thinks It Can Go Global 🥥 #FoodTech #Startups







