The Future of Ruby(3). Yukihiro Matsumoto

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Applause] [Music] [Applause] [Music] [Applause] [Music] [Applause] [Music] [Applause] [Music] to prevent oh I wish I could speak Russian welcome to Ruby Russia this is 10th anniversary of Russia including the history of the rails Club three years ago I was invited to the Race Club conference and I actually first I refused because I'm not a programmer and they promised to rename to Ruby Russia and they did okay this is the Ruby Russia Ruby conference and some claims Ruby is good because we are here Ruby is productive rich flexible a verb is found but as in some aspect rib is bad and some people are Clinton with this dead over and over every year properly Ruby's dead every year some people say the Ruby's less popular we have lower TOB index which is the popularity ranking of the programming language out of the 150 programming languages but we have 11th out of 150 programming language okay not that bad and in the other popular debunking is all red red mark index we have 8th out of 20 programming languages yeah Ruby's good enough the big sites used will be for example our github develop github use is implementing will be on Rails IBM in the Ruby instigated in Ruby code patents Ruby and many many other websites are built in Ruby and Ruby on Rails and I'm sure many versions are web services in Ruby and and I was supplies do we have more than 700 people almost 800 people here and which means the Ruby Russia is one of the biggest Ruby conference in the world that is quite an impressive the Ruby is fast enough for most of the cases and if you reach the limits in some cases I think it's okay and the limit is moving okay let me tell the telling of the Twitter story Twitter was started in 2007 I guess and it was built it was built in the Ruby on Rails application but think about that it's application architecture is now really suitable for the crud application so that some years later Twitter moved to Scala which is the jvm language and the reason behind it is the Twitter itself is now very suitable for crowd application which is the Ruby on Rails design for in a new application like Twitter requires new framework so that they implemented the new messaging framework in Scala but the second biggest things is the day use will be one point eight which is far far slower than current movie actually the basic architecture of the Ruby 1/8 is implemented by myself so that that was my fault and they try to improve the performance of the Ruby 1/8 the code name the key G and and but they we had will be 1/9 which is far faster implementation but that somehow they didn't you to cooperate with us and then then he the actually the Twitter gave up dude will be 1/8 and moved to the cow and will be 11.9 and the later is far far faster than will be compared to be 1/8 we have the new virtual machine which code name is the yob and the limit is moving though Ruby is getting faster and faster actually you know the limit is does not move spontaneously so we are moving the limit so Ruby to be performance Ruby to improve the performance computer will be 2 to 3 will be to 6 the latest version is slightly faster that an average each year the performance of ruby in the rails bench faster in 5 to 10 percent that know the eary rate of the 5 to 10 percent improvement is not that bad we are moving forward let's face it Ruby is not perfect we have some issues for example we some some people face performance issue and we are somewhat weak in the handling the multi-core architecture and we have some issues in with bigger team or bigger projects and performance wise so that you know we have improved a lot but still we are slower than compared to say other language like C++ go grass and other programming languages so that people can some people are chose to use the you know the compiled static type of compiled language like all the multi-core is the another issue there I created Ruby in 1993 which is 29 26 years ago between 16 years ago and then at that time every computer had only one CPU so that we didn't have multi-core architecture that so that that's one of the reason we have the global interpreter lock and we are not that strong in the multi hundred multi-core architecture but a bigger team project you know Ruby started as a scripting language and then gradually moved toward the web programming language so they're our primary focus is relatively smaller architecture and a smaller applications okay but as some rails applications are quite big even millions of lines will be called including test called they're in with you know hundreds of people working on the single application so that that kind of big teams issue and a big project team issue as a you know we sometimes hear about like how we we have if we could have the static type static typing we could find error or easily or something like that in any way open source community the Ruby community cannot stop because we have no initiation we have though an admission that we just here by attracted by the technology that you are free to live if we want you are not forced to use Ruby if you want you want to you might go to say Python PHP typescript whatever technology but you're here because the Ruby's attractive Ruby's productive that the point is we have to keep moving forward to attract people like you so that we keep improvement even further in the coming version the major release of Ruby 3a Ruby 3 in the future and how can we improve the future absolutely language the I classify the future into threefold performance concurrency and static analysis let me talk about the static colleges first this is kind of complicated issue static typing is quite quite popular in this century the recent language like go rust swift those language has static typing and they are quite popular and as the project rolls so there are tests become burden and then test increases sites this execution takes more times but tests are not dry so there I I confess I don't like tests it's against dried principle don't repeat yourself the test the program is the way to describe the work we want to be done by the computers and a test is the another form of what we want describe what we want and we compare those two and if we have any contradiction between the two the programs and tests that we can find errors but if we the computers can find errors by themselves but we have to we don't have to write any tests but unfortunately computers are not that smart yet and then we write tests anyway we do a test anyway but we want to be we want to be more productive and then so what other long is try for example PHP recent PHP has that that the feature name type hinting the Python 3 has type annotation and the javascript is that the other direct with the type type the correlation called typescript so what shall we what should we do Ruby community should react to this request I didn't happen patient to the language like PHP or Python did no I hate their plantations because it's not try we wanted type painting because it's not needed we have time we have 12 over e3 we are going to add some kind of the static type checking with the following components type definitions in tags type definition of libraries type provider static type checkers and ID support type definition syntax is a new syntax of the type declaration of the Ruby program this is this project is done by Zotero Matsumoto in Japan in Japan who is not my relatives actually mass model is quite popular by me in Japan this is kind of compromise when we write separated files to describe types the type of information we include the argument types return value types present module types and the interface with the generic are somewhat general type including the type signature comes like this class foo has method foo that returns void and a to s method that returned strings the truest method might take argument integer which is the base in a return string this is kind of straightforward and we are going to have this kind of format this is kind of compromise I'll explain you later and then we are working on the tool to pass this file that from here I made mistake Ruby's signature project is migrated to the Ruby project so that github.com Ruby's loss will be signature I made mistake sorry then we are going to provide a type definition for libraries standard a bundle libraries and then we are going to provide a way for gems to provide their pipe information with them the third component is tag profiler which is the tool to gather the type of information from your project programs the uske endo is working on yet the this this type profiler is the key component of the static analysis which use the technique called abstract interpretation or AI for short okay this is a stupidly simple ruby program we have redefined the method foo and then called foo method so the Tai profiler finds the call of the Foo method with the argument integer then the argument a must be integer then integer plus 2 integer class has the class method that it's okay but it if it caused undefined method in an integer class it will cause the error so type of filer correct type informations under the tab type comm flow of type of information and the also high profile that can generate that type signature from of your programs the attempt of I can act as a level 1 static type checker and also you can use it as a ruby signature generator and then the you know the ruby type of fire is not panacea so that you might have some issues of the of generated signatures whether you can refine it it's it's kind of separated file so you can refine it to have the better chip type checking for example our type signature type profiler cannot generate the generic types or union types or something like that so that you can refine it you may also we may also provide the yard to obvious generator so that your document can generate the type signature then with the type information provided by standard libraries and generated by the type profiler or maybe you can you can you you are refined type signature we can round that static type checkers we have currently the tool actually three static type checkers one is the sorbets from company names so a stripe thus the second is Strip steep I mean a steep which which is implemented by the Zotero Matsumoto within charge to the Ruby signature those tools use obvious types Inc definitions and Anna does to have the different color spaces are we we have the other select a check on in LDL which is the basis which was basis of those two types are newer type checkers like a soul bed and steep sobei you can find Sol Bay here and it's implemented in C++ and incredibly fast and it works mostly Namie now and a supposed type annotation DSL instead of the type signature they are working on the Ruby signature and they are working on the IDE support so to not to they few months ago they open-source this all day so that you can try it steep is the different approach of the DA static type checkers so you can find steep and it's written in Ruby so it's relatively slower but it used the structure typing it's which is more flexible type checking and then since it's written in Ruby you can experiment of static typing in Ruby using steep I think these two sober and Steve is hard as the healthy competition in addition we're working on the IDE support so the sabe has the IDE support for the vehicle so if you use vs code to write Ruby you can use the solve a static type pretty soon they are not open source the ideas of their idea support yet the better they are planning but we are expecting to see it pretty soon we don't since we don't have type a notation in inline in your programs that type information in separated file so that it's kind of hard to maintain then maybe we can I added the support for example the completion like other programming language and we might have the pop-up type definition as a documentation and then we may have the pop-up type annotation or annotation our type annotation editing there so that you don't have to worry about the separated file so you may have a question here why static types because we need better text we made a type check for to boost productivity and the toxic type could be a better documentation for your programs and the static type information can provide help better to supports but some may ask why known annotation why don't you add that type annotation to the language so that so that you don't have to worry about you know the separated type information file there are several reasons let's say it's not dry and the second one is it change the language we love so now add type annotation to the language everyone forces you to write the static types to the language but it loses some kind of the frets flexibility of the language and then you have to write more our Ruby programs love runs know without any problem without type of notation right now the that means adding type annotation is kind of redundant that I hate that the third reason is performance Tony type annotations some may think K adding type annotation or type in public relation may make language compiler faster but it's not for example v8 virtual machine for JavaScript on Chrome browser run JavaScript which is a dynamic type programming language and it runs free and three fast and an a friend of mine back in Japan wrote experimental ahead of time compiler for Ruby which runs the 50 times faster than C Ruby for small micro benchmarks it's not for ruby but ruby has a potential to run 50 times faster in some cases does the two comparators don't use any type information from the programs though that is the evidence we don't need type declaration for performance the other question is the why separated type of information files that the reason is we cannot tell the future there but we can just guess it and in the history of the programming language static typed programming language camp and the dynamic priming language camp has that you know the bakken going back and forth okay the first programming language named fault line in the static type programming language and the second generation of the list framing are this programming language the dynamic type rhyming language and in they are inference to each other so that at one time that dynamic type programming language it was strong for example 90s and early 2000 the dynamic typed programming language including Ruby is pretty strong but in 2010 so there are static type programming languages are stronger because of the beta type checking but at the same time the new language influenced by the dynamic type programming language so that they are the type inference they don't somewhat skip type Dec relation so I guess I predict the future so that the our program is we can write our program without any type of declaration but it is as strict as static a programming language as we can find as much error at the static type of programming language if that would come true the typed equation will be some kind of obsolete things but once we anything to the language it's quite difficult to remove that that that's the reason I said compromise the separated type information files is kind of a compromise we are trying to make our compiler smarter and smarter and we we try to create the future so that we we don't need type of information provided from the provided in that separated files at all smart compilers can guess and predict errors you create in your software so the I the this compromise is made to avoid possible future limitation to the language so that what will happen with these these components your ordinary programs will be statically type checked without any type of type annotations in your Ruby programs if you define you fun if you refine type definition files you have you will have better checking the one that be cool we walk in on end and a result is promising at least from my point of view this is static typing okay performance no language can be fast enough everyone complains as I said before Ruby to improve the performance like this but even further in Ruby 3 we need more performance we have bigger service and we people have anxiety of choosing Ruby because of the performance we need to address bottlenecks and we have many many borrowings in applications memory CPU and I all want for to name few the memory is the first bottleneck ah that's why we have been working on garbage collector improvement for years the Ruby Ruby 2.1 introduced the generator garbage collector and it will be to point to introduce the incremental garbage collector Ruby 2.6 introduced a transient he and Ruby 2 point 7 7 which will be released in coming December we have the object compaction by those improvement we have the better memory management now we are trying to even further so there are but up in some cases we still have the CP bottleneck there to address this canvas is a bottleneck we are working on JIT compiler just-in-time compiler which generates the native code in the mail in a memory so that we can run our methods innate in native code it is kind of my dream whether the Ruby contributor in the Vladimiro markeloff who is living in canada who works over Red Hat actually he's Russian and his his smart his day job is working on the GCC in Red Hat he in his day job he improves the performance of the GCC compiler and in his hobby time he implemented the JIT compiler for Ruby incredible and his his prototypes worked pretty well for their micro benchmarks and it works four times faster for almond micro benchmarks but it doesn't work for the bigger will be applications so the takashi-kun came in and he reimplemented the em jet jet compiler and introduced into Ruby to six and he's here somewhere and he he were gonna explain about his work and his improvement over the JIT compiler last okay for in CPU intensive tasks we have the benchmarks in the uptick a lot which is the Nintendo Entertainment System emulator which runs through the nest games and Ruby 2 point 6 with jet runs 2.8 times faster than ruby 2.0 that's not bad three times for almost three times laughter and they really took two point seven with improvement by tacca see which runs even faster but for raise up you you have the interested in the format's of Breslau right for rails up yet compiler run slower we have reasons we have the most of the rails application memory is the bottleneck and the JIT compiler is try to resolve the CP bottleneck and then at the price at the cost of memory so the memory bottlenecks even getting worse and a rails is a big big big framework and we have many hot methods so we have to compile many methods and a compiling at the runtime has its own cost the D the third thing is the next to the memory bottlenecks in rails application the i/o bottlenecks comes next not to CP both legs improving the CPU weighs little so go to Tara's this talk by his effort in Ruby 2 point 7 will run rails application with jet runs as fast as without it not bad anyway Vladimir Makarov who is also working on that the another digit implementation which is called meal so which is lightweight yet so now I don't think me me our music was included in the Ruby 300 but in the future we would have we would have the 3 tire jet that the most of the code runs in the VM into but some hot methods are compiled by the mill which has the 80% of the performance of mg with the cost the less than 1/10 of the the cost and the very hard method can be compiled by the memory so that we with those retire JIT architecture we can run the CPU intensive tasks much much faster it may not be useful web application because the first ball UNIX of the web application is memory the second bottlenecks of the web applications IO so that the web application usually not CPU intensive tasks but Jade would be useful for research computing the so me right now people use Python for or junior or to for our AI and machine learning and research computing but within the future so that some of them may choose Ruby for its performance with jet compiler so the other way to improve performance is a concurrency we have the more tico age we are in the multi ways but the concurrence is hard actually I regret adding threads remember when I created threads in the Ruby we have only one computer I won't cpu attack our computer but in multi-core ages the threads hard to use correctly how to use efficiently and most importantly is they're pretty hard to debug so we need better abstraction we're working on something in the gills and old fibers maybe we would change the name in the future because gills the guild class is used by the some software in the gaming industry yeah actually the codename guild for the zip is for concurrency for CP bottleneck and odd fiber is the i/o bottleneck they are easy to use and easy to debug and easy to perform the language like goal 1 elixir has the single entity for concurrency go routine for goals and then the processes for Excel but remember those language are concurrency concurrent programming language from its day one but the Ruby is not so that we have to make some kind of compromise to have the two entities one for I win i io intensive tasks the other for the cpu intensive tasks but we need better names maybe we renamed the gills to isolate because the Guild's those those things isolated each other and then we we might use just fibers instead of a lot fiber your opinions are welcome so that feel free to propose new name for that concept those improvements including concurrency in spite the functional programming languages static typing concurrency map models and the we're a little bit further to moving toward the functional programming for example we are going to introduce a numbered block parameters from scholar and closure with which our functional programming language this is the 100k you can skip the broad parameters in use that the underscore one instead of da ba a things yeah it's kind of simpler and a pattern matching another regular expression pattern-matching but a functional programming a pattern matching it's like this now read jason and simple as names and then we want to find entity whose name is Alice and whose children is Bob and then we treat the age of his her son print age but if we find if we can't find Alice in the JSON file you just rank know Hollis simple without para matching you have to write like this we treat person whose name is always then take children the children we have one one children and the first one first students names Bob the print H you compare those two yeah the former with pattern matching is much straight forward chaining 5 point operator Python operator is used by the language like F sharp and elixir and we are trying to introduce like this instead of this but I gave up the idea let me explain a little bit about that now popular belief shop definition means pipeline operators like this and then it works as the other primary argument at the end of its argument list and the piping operator in elixir is defined by macro and another primary argument as the first argument of the method call because of the in ml ml language the primary argument comes last at the functions function arguments and in elixir culture the primary method most important method for example nada target of the map function becomes first of the function argument there this difference last and fast comes from the difference of the language culture the the concept of the pipeline operator is the other primary argument to the call the if we would provide the pipe remember thing Ruby or the primary argument to the call means at the primary argument at the receiver because of the map method of Ruby the the target re our target sequence comes at the receiver of the language but I find out people don't share the concept you know adding argument the first the function argument not a receiver that they they want it and they complain about that you know that the people find Ruby usable and then people find will be comfortable because we share common sense some some kind of a common sense whether it fine now the in the specific to the piper my operator the we me and the community don't share the common sense good i instead of trying to prostate the community I just give up it's not that it's before two point seven final release and I had to experiment to find out yeah at least we get some ideas for example we find out we couldn't put the comments in the metal chains like this prior to Ruby 2.6 adding the comments that break the chain the Ruby 2 point 7 will allow this kind of the common in the message chain and then the other things is the right assignment which is like this one 200 map so we verse take 5 then if you want to assign that we resolve to advise to the viable you have to go up to the top of the chain then other assignment a equal to something like that but it's it's against our natural eye ball movement cause go first top to bottom they left to right so the if we could add a write assignment that okay we have seek range from 1 to 100 map sort rivers take five they assigned to the top 5 variable things this is just a concept but at least the this kind of pipe roma operetta discussion inspires me is this concept okay I'm not sure it will be in Ruby 3 or not but at least we have the idea in addition we have some crazy ideas right as I meant I told you and in proceeded receiver in blocks ah suppose suppose we have this this kind of da the code snippet though we will write like this symbol as a block brach argument but if we want to the the argument to the method you cannot write like this because the fragment takes a symbol but the not the argument some people propose like this the this is a default receiver hmm oh yeah what do you think yeah yeah no yeah this is just idea I have a bunch of this kind of crazy ideas and only a few survives and the mouse into the language yeah this is kinda food for thought anyway we need to survive to provide benefit to our users Ruby need to be survived to sustain our lives I'm a full time movie worker so that if Ruby disappears my life will be worrying and we will keep moving forward but not we does not mean only core committers there will be designer but with you the we as a community Ruby community as a whole I try to keep moving forward to make you and us happy and to make the better world better place this is the whole purpose of the Ruby language Reuben community ah a seawall Gracia the right to questions from the whole and other questions in outside okay hi Matt thank you for Ruby in general and my question is do you have any plans to help machine learning and mathematical tasks in the future in Ruby except of Jude compiling yeah actually that we are helping to two projects one is the cipher B which is that we implementation of the SCI file and the other is the read data tool which with coordinate coordinate with SCI movie rated tools implemented the PI call which can call the Python library from Ruby in Ruby syntax and the other is Apache arrow which is the data format and the memory format and library to share the machine learning data matrix between the languages the third one is the retina which is the machine learning library implementing Ruby and those are those Pro an attempt will improve the situation of the machine learning and AI things in Ruby and we we really hope that that would improve the productivity of the crew loves Mercy AI and Ruby that together thank you and one more question oh yes Hey Thank You months for Ruby in general where are you yeah oh yeah I have a simple question when you say that the Ruby is moving forward and you're working hard on that and like you even the community in general so my question is do you expect from the ruby developer from the general group either opal to help with the ruby internment I mean to write some C code to provide some PRS or whatever or like you're not we are more than welcome if you are interested in the core and if you want to work with us so that we welcome you and but the most of the Ruby internally we do need C C and there's some C++ and some assembly and then so that it's you know the obstacle is the entering harder is a little bit high but if you can obtain that holo so that we are more than welcome you and in addition so that discussion about the new features like like Lang is designed like a pipe for me operator or some kinda that the implicit receiver things that kinda stupid idea is we discuss under our issue tracker read by so that that you know joining to the discussion itself is really pretty much very valuable okay thank you thank you very much
Info
Channel: Ruby Russia club
Views: 9,580
Rating: undefined out of 5
Keywords: Ruby, RubuRussia, RailsClub, Ruby 3, Yukihiro Matsumoto, Matz
Id: IhTXDklRLME
Channel Id: undefined
Length: 48min 37sec (2917 seconds)
Published: Wed Oct 23 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.