Terence Lee
Closing Keynote: After a Decade, Still a Rubyist

Closing Keynote: After a Decade, Still a Rubyist
Terence Lee • June 24, 2016 • Singapore

Speaker: Terence Lee, Ruby Core, Heroku

Event Page: http://www.reddotrubyconf.com

Produced by Engineers.SG

Help us caption & translate this video!

http://amara.org/v/ONqF/

Red Dot Ruby Conference 2016

00:00:14.639 uh good afternoon everyone uh thank you for making it all the way to the end um
00:00:20.960 this is my second Red Dot uh Ruby conference um probably the third time
00:00:26.199 I've been back to Singapore so want to thank the team for organizing this entire conference and
00:00:32.160 then uh Wiston I guess for reaching out and inviting me back to Singapore um
00:00:39.040 hopefully this talk will be better than the one I did in 2012 um so I'm Terence Lee like they
00:00:44.600 said I go by h02 on Twitter um I come
00:00:49.840 from Austin Texas uh where we do really really good tacos I like to call it the
00:00:55.120 taco capital of the nation um if you're ever in town and I'm also in town uh
00:01:00.680 reach out to me and I'd be happy to take you out for tacos um most people don't actually uh hold me to this but uh I
00:01:08.880 have actually done this for people so um is not a empty offer uh I known for my
00:01:16.080 blue hat uh I do also have blue hat stickers um so if you do want one I'd be
00:01:21.759 more than happy to give you one uh probably after party um as you head over there um uh like Nat said I work for
00:01:30.320 Heroku um and I'm just excited that uh
00:01:36.119 for all the stuff we've done for Ruby and the opportunity to kind of do all the stuff that we've
00:01:42.000 done uh so today is Friday uh and uh
00:01:47.119 that means that we have to do the Friday hug so um for people who aren't familiar
00:01:53.399 because you're news to the Ruby community and you haven't heard of it um I believe it's a thing that Aaron
00:01:58.479 Patterson started he worked remote and he would basically take a picture of himself hugging the camera and then people would tweet photos back out uh
00:02:07.119 and I've gone around to various conferences and basically done this with
00:02:12.120 the entire crowd and it's been I think just cool to have a collection of these Friday hug photos so if everyone would
00:02:18.920 stand up uh I would appreciate uh given the chance to take this
00:02:26.920 photo uh oh sweet house lights so uh I guess just make look like
00:02:35.440 you're hugging a camera if you don't what you're doing probably just look at the person next to you they probably know what they're doing uh so ready uh
00:02:45.640 one two three happy Friday thanks
00:02:52.879 everyone uh I'll tweet a photo of that uh when I'm done with my talk um uh I
00:02:59.840 also learned recently that uh Godfrey who you heard from yesterday uh is doing
00:03:05.000 this thing called solo selfie while wearing this awesome Han Solo shirt uh so I asked him to come on stage to do
00:03:11.400 yet another photo uh where we will do demonstrate doing a solo selfie so you can then do it at the Afterparty with
00:03:17.760 him while he collects all these
00:03:26.840 photos there you go uh so definitely catch Godfree at the Afterparty if you haven't gotten a solo
00:03:33.439 selfie with him uh I know he's trying to create a large collection of
00:03:38.959 them uh the other thing that I like to do at conferences besides Friday hugs is
00:03:44.360 uh Ruby karaoke and I've been very fortunate that uh we've been able to successfully do one for basically like
00:03:50.519 the last year and a half at every Ruby conference that I've been to um and so this is us doing Ruby karaoke at Ruby
00:03:58.439 conf last year in the US and if you've never done karaoke it's
00:04:03.680 totally fine like Godfrey said um but uh
00:04:08.959 in fact most people who actually come out to these things have never done karaoke before and so it's usually their first experience at karaoke and I've
00:04:15.480 never had someone who has complained to me that they didn't have a good time uh and if you're scared about singing I
00:04:21.600 think the point of karaoke is that you aren't good at singing and that's like half the fun of it um and you also won't
00:04:28.320 be pressured to sing so you can just come and have fun and kind of just enjoy the company of your fellow rubius in a
00:04:34.600 totally different light um and this is just a picture of us doing this at vuko
00:04:41.120 last year and that's uh PJ Hagerty who goes by as spenic on Twitter um and he
00:04:47.240 has been instrumental in just making this happen um so shout out to him and so we'll be
00:04:54.120 doing it at 10: p.m. tonight uh I guess in the middle of the Afterparty um I got approval from from Winston from stealing
00:05:00.560 people away uh we'll be doing at kbox in Chinatown it's about a 10-minute walk or so so we'll be leading a crowd of people
00:05:07.639 if you want to join in uh feel free to come join us uh and it will be probably Winston book the room but I think around
00:05:14.320 38 uh per person um so come join us for karaoke it will be a pretty good time um
00:05:23.759 and uh so this is my third conference I've actually closed uh and when I
00:05:29.720 started doing it I asked Aaron who's done a bunch of these like what what are you supposed to do for these things and
00:05:36.160 he told me that you're supposed to try to actually incorporate every single talk in the conference into your actual
00:05:41.520 talk uh which sounded like a Herculean task so uh what I decided to do was to
00:05:47.319 try to encapsulate before my closing talk all the other talks of the conference um and so I first wanted to
00:05:55.560 congratulate uh just like the local Singapore Ruby group like it's pretty amazing that it's been around for 10
00:06:01.199 years I know that's not true for lots of other Ruby communities out there um and it actually makes me feel pretty old
00:06:07.000 because I've also been doing Ruby for 10 years so uh it's pretty awesome that
00:06:12.400 this group has been this healthy and this strong for so long um so
00:06:24.160 Matt's uh talked about soft typing and a bunch of other things uh but I was super happy to find out that uh in the Ruby
00:06:30.840 Community we can cross off naming things because uh with the soft typing inference now we don't have to name
00:06:36.160 these types so that's pretty awesome uh in Jason's talk when he talked about
00:06:41.479 slaying the dragon uh he showed that you can actually build like a lisp language like very quickly which was really cool
00:06:48.360 um and I was pretty amazed that you can actually just use this single and for doing a tokenizer thing like this is
00:06:53.680 actually not a very long regular expression so uh the first time I've seen something like this so that's pretty awesome
00:07:00.520 uh for the Ruby golf talk uh that Joy did it was really neat to I guess learn
00:07:06.960 all the ways I should probably not write my Ruby code but it was definitely neat to see like all the different Secrets uh
00:07:13.560 I I did not know uh numbers two to four at all and uh I definitely think she's
00:07:19.240 right like number four is really neat the fact that you can pass that regular expression in is very cool um proam
00:07:25.199 match did a great job of talking about all the changes in rails 5 testing I didn't really iizz that all these changes have actually happened um but I
00:07:33.479 think the conclusion for me was that I've basically been doing controller tests wrong like the fact that we should not be doing them um so I thought this
00:07:41.400 meme was appropriate there um Godfrey talked about uh software education and I
00:07:49.000 think it was great to kind of a like kind of tackle that upfront with both the boot camps and computer science um
00:07:56.599 and I think he really cracked the nut of it that uh what we're trying to teach is how to
00:08:02.840 think about things abstractly um and abstractions are a great way to kind of form a mental model for things um but of
00:08:09.800 course like any abstraction they'll leak and so being able to figure out how to to deal with the fact that things will
00:08:15.759 eventually leak uh as you go forward and like how to deal with those issues uh is
00:08:21.000 an important part of I think that Korean road path for being a good programmer in
00:08:26.440 this industry um next slide uh I think I also can't
00:08:33.080 pronounce uh Gregor's first name but uh uh I I liked his takeaway that your
00:08:39.440 API is probably fast enough and I think that is great but apparently this is okay there we go uh sorry technical
00:08:46.000 problems um and also enjoyed his uh advice uh he gave us a lot of great advice for how to do things with like
00:08:52.720 cdns and whatnot um but I I I did enjoy his advice about don't be a smartass uh
00:08:58.880 with that um uh onto the lightning talks for the first day uh Joe did a great job
00:09:04.640 of talking about why people are leaving uh companies in general I think the turnover rate in Tech is astoundingly
00:09:10.399 high uh I think like if you make it up to like a whole year at a company that's like you're basically really old in a
00:09:16.920 veteran at that point um which is kind of crazy um but for me I learned that
00:09:23.000 basically Google is filled with lies uh which is news because I thought everything on the internet was true uh
00:09:28.600 and that people don't leave because of managers which is something that I never thought of uh so that was a neat to
00:09:34.360 learn uh Shabbat Assan talked about uh how to e how you can easily contribute
00:09:39.760 to Ruby um and I think it's nice that he highlighted in a single place that you can basically like run the test with six
00:09:45.480 simple commands um and the other thing that I learned was that uh documentation is really hard in Ruby uh which is nice
00:09:53.600 to know because I feel like that's the common advice you get often times about contribu to open source projects like oh you can just contribute docum mentation
00:09:59.920 um and like actually understanding how all that stuff works can be difficult
00:10:05.920 um uh and kah uh talked about speeding up the test Suite uh but I did
00:10:10.959 appreciate in the beginning she gave a bunch of advice but uh the fact that man these slides are not changing okay there
00:10:17.279 we go that uh if you have no tests there will be no slow tests I thought that was pretty neat
00:10:24.160 um uh and then next we talked about basically like flexible authorization
00:10:29.720 um having done some authorization stuff in the past uh this definitely be challenging um but it was neat to kind
00:10:36.240 of see the like forward progress in making a better authorization system that allows I guess more power to the
00:10:43.079 end user and not have to kind of step in and dive uh towards those things um and I also didn't know there was an open
00:10:49.160 standard so that was new for me uh xacml
00:10:54.560 um and uh then Tim gave a talk about kind of Next Generation web apps uh and
00:11:01.440 it was neat to see how you can basically build an architecture of stuff where um
00:11:07.360 like the ability to easily change things is kind of at the uh Forefront of it uh the Forefront of it um so just
00:11:15.600 having uh like a positive architecture that provides maintainable sustainable and joyful development um and I'm pretty
00:11:22.880 sure people who have dealt with uh Legacy rails applications uh are aware of kind of the issues that come from
00:11:29.600 dealing with older code bases so seeing something that tackles those problems up front uh was really neat to
00:11:35.360 see uh and then sa uh sa Shang uh had
00:11:40.839 this great talk at the end of the first day where he showed us a bunch of simulations um and I think I was just
00:11:46.959 amazed by uh when he actually opened the code of how simple it was and it was neat to kind of see like oh it doesn't
00:11:53.160 actually take a rocket scientist to do like kind of these crazy simulations um you can actually do it inside of Ruby
00:11:59.560 and uh kind of run your own experiments so I thought that was really neat um uh
00:12:06.399 so uh for the opening keynote today uh uh Aaron uh talked about a reference to
00:12:13.760 my talk but that's kind of weird because I'm doing my talk now so uh I took a picture of him doing this so we could
00:12:20.199 have a circular reference uh at this conference
00:12:25.839 um uh smears talk about scientific Computing in Ruby was really awesome uh I thought that uh the iBook thing was um
00:12:33.800 just kind of just an really impressive demo that you can just do all that stuff in line um but for me uh the thing that
00:12:39.959 I learned was uh about daru in uh in Hindi that it meant alcohol um so I
00:12:45.720 thought I would put up a thing for the Singapore Sling uh which was what I
00:12:51.000 think about for alcohol when I come to Singapore um I thought Constantine did a
00:12:56.199 great job of just kind of disrupting salary stuff in general and and kind of
00:13:01.959 the uh thought process behind how Travis reached the point where it did uh and I
00:13:09.440 mean besides uh Curren like foreign currencies being really hard and I thought that gold example was uh kind of
00:13:15.279 crazy for the uh PMS uh just like salary stuff in general is really tricky so uh
00:13:20.920 kudos to Travis for Paving A Better Way Forward and I'm looking forward to kind of how all that stuff works out and as
00:13:27.440 they get closer to open sourcing and having those discussions um vipp uh talked about a
00:13:34.880 bunch of stuff about being up the front end I learned many things that were actually happening in rails 5 and I talked to him after and he said oh yeah
00:13:41.079 that's only like kind of the tip of the iceberg of like all these changes that are actually happening so looking forward to all the things that are
00:13:46.600 coming in rails 5 uh uh but uh it's nice to know that we can now cross another
00:13:52.399 thing off of hard things in computer science cuz uh from all the catching stuff I remember back in the day when
00:13:58.240 Russian doll cashing came out dhh was saying they solved caching so excited that we've now crossed off like two of
00:14:04.320 the hard things in computer science um as CES talk about uh The
00:14:11.399 Internet of Things it was just like really impressive to kind of see uh all this stuff and how approachable it is I
00:14:17.959 I definely seen people talk and about it a lot at various well not a lot but I've seen a few talks about it at Ruby
00:14:24.279 conferences um and I think uh the Crux of it for me the takeaway was uh now that it's becoming more consumer
00:14:30.759 friendly and more developers are digging into it like how what are we going to do with the data and like how we handle all
00:14:36.480 that data is going to be really important in the future um with both like machine learning and other things
00:14:42.959 and big data and uh it'll be neat to see how uh we as a community kind of tackle
00:14:48.680 those problems um uh Yuko did a great job of
00:14:56.759 um uh talking about upgrad rails um uh one of the things one of the quotes for
00:15:02.720 me that really stuck out was uh I think it's very easy when you talk about Ley systems to kind of throw all that stuff
00:15:08.639 away uh and uh one of the things that Yuda has told me uh a lot while working
00:15:15.240 with an open source is like uh it's dangerous to just throw away like that old Legacy code uh and I think this
00:15:21.360 quote from her from her talk really highlights that is that like the fact that this system exists and it's solving
00:15:27.040 real problems means that there's probably things that are in this code base that you may not understand but is
00:15:32.959 actually solving real problems and you should think twice about just like starting stuff from scratch and throwing
00:15:38.480 all that stuff away because there's a lot of intelligence and knowledge built into that code um so on to the blog post uh I
00:15:47.639 really enjoyed this Japanese quote from the blogging thing uh or the proverb I guess uh 3 years on a Cold Stone will
00:15:54.240 make uh the stone warm uh but I mean I I think this supplies Beyond just blogging
00:15:59.920 like perseverance and kind of dedication to something really pays off in in order to either learn a new language uh or you
00:16:07.279 know really want like if you want to contribute to rails it definitely like takes a lot of effort and time and
00:16:12.800 having that motivation to keep going I think makes a big difference there uh uh I thought uh that mean the kind of
00:16:20.920 whole story uh that Jack gave of interacting the maintainer uh is unfortunately not a rare thing but it
00:16:27.639 was sad to see like the results of that ended up the way it did but I'm glad that he learned many things from it uh
00:16:34.440 but yeah definitely don't believe in the stars on GitHub uh it can definitely reflect different things and um uh I
00:16:41.600 think the other key takeaway from that talk for me was that uh PRS can be used
00:16:47.000 as an conversation opener and you shouldn't make them like kind of this absolute perfect thing I mean you should
00:16:52.240 definitely put work in front for them um but definitely use it as a way to start a conversation with the contributors and
00:16:58.600 maintainers of that project to then work towards a eventual thing that would get
00:17:04.199 merged uh Yuki talked about a bunch of stuff I actually had no idea about the experimental stuff so that's neat to see
00:17:10.520 hopefully we'll see that stuff soon in uh a new release of Ruby so I don't have to uh require a specific thing for it
00:17:17.520 but he talked about a bunch of different tips some of them I've heard before and many of them I didn't um but I
00:17:23.559 definitely most excited about the explain shell.com um because there's definitely a lot of archaic things I think in Shell that it would just be
00:17:31.400 nice to have someone kind of tell me what those things are and what they're actually doing
00:17:36.440 um uh Stephen did a cool job of just talking about react and selling why
00:17:42.280 people really flocked to this framework and how you can kind of apply those paradigms down into rails itself uh I
00:17:48.760 think it's neat to see with both functional programming languages uh like elixir and uh Phoenix uh the framework
00:17:55.559 Phoenix beond the rise uh that um these kind of declarative paradigms allow you to easily reason about where problems
00:18:03.159 are in your codebase and like how um how to make sense of all those things and where you need to look uh which is
00:18:08.880 really neat uh and welcome to the Ruby communities in uh it's nice to see
00:18:16.240 people uh I think one of the great things is just seeing people always being welcomed and joined into this
00:18:21.840 ecosystem um and for sure like uh the stuff in those code schools uh are very
00:18:28.520 far from what things are in reality uh but um I think uh just this whole journey is
00:18:35.320 pretty magical of just uh having that feedback loop and having access to mentors and uh being part of a larger
00:18:42.880 Community uh so good luck on your journey there and uh thank you for taking the time to give that lightning
00:18:49.840 talk uh and uh finally for the kier's talk uh of course uh regular expressions
00:18:57.559 are really hard um and I'm glad that um we're pursuing stuff where as an end
00:19:03.559 user I don't have to write very fragile code um and I'm looking forward to seeing how those things
00:19:10.679 progress uh so yeah so that's kind of what I had for all the other talks for
00:19:16.440 mine um uh so let me get to I guess like my story in uh I guess the Crux of uh
00:19:25.120 the The Talk itself so uh before I get to my Ruby story um the first real
00:19:31.400 program langage that I learned was Pearl um and I really enjoyed Pearl at the
00:19:37.240 time um but then I when I went back and actually read my code I found it really hard so I think the moniker of like a
00:19:43.400 right only language uh started to make sense to me um uh and this relates to
00:19:49.080 kind of the Ruby golf things like all those short hands and things could make things very unclear to write but it was really cool I think Pearl's like one of
00:19:55.760 those like epitome like golf kind of languages like the amount of stuff you can do on a single line is kind of crazy
00:20:01.960 um but it was great for scripting um and then when I got into web development like I went towards PHP and I think
00:20:08.720 there was probably many of us uh back in the day in Ruby who dabbled or did a lot of PHP um um but we were definitely left
00:20:16.840 like fairly unhappy and I heard about rails uh which was kind of this Holy Grail in my mind at the time when I was
00:20:23.720 young and I was like oh this is like the Silver Bullet that's going to solve all my web development problems um uh so
00:20:29.120 after hearing a bunch about rails I uh picked up this pickaxe book uh back in
00:20:34.679 2006 and starting learning Ruby um and uh since then I've it this was a
00:20:41.679 language that really spoke to me and I've been very fortunate to be able to work on uh various different open source
00:20:47.840 projects uh in addition to having a full-time job that paid me to actually use the Ruby language every day which
00:20:53.799 was really cool so you know like I got to work on bundler for a few years and then maintain rescue for short stint uh
00:21:01.480 um Matt's for some reason gave me commit to Ruby and then I've helped with uh I
00:21:07.039 know rails girls used to have uh a strong following in Singapore that's now changed to its own thing but uh I was um
00:21:16.600 help with open sourcing the the rails girls guys which was a really cool kind of just experience to see that whole
00:21:22.320 Community there um so you know kind of after doing this for 10 years like why
00:21:27.760 am I still using Ruby like there's so much other stuff that's happening and so much interesting Tech that is happening around us um and I I think first and
00:21:36.080 foremost for a lot of us like the Ruby Community is a really special place uh there's a lot of I've met so many
00:21:42.360 amazing people in my journey for the last 10 years uh that are now like really close friends of mine uh but even
00:21:48.320 beyond that like every conference I go to I always meet really cool people that are doing some pretty amazing things um
00:21:55.080 and uh the fact that railsbridge and rails girls are both successful in the community um means that we've done at
00:22:02.159 least a decent job of trying to be inclusive and trying to make it better um the fact that we care about things
00:22:07.840 like diversity is just really neat to see we're at the Forefront of a lot of that uh you know we're not where we want to be but like the fact that it's an
00:22:14.159 open issue and like people talk about it is really great to be in that community and something I'm very proud of um and
00:22:22.039 then even Beyond just like that stuff uh I think it's really neat that we in the
00:22:27.240 community itself like encourage people to explore other languages and go learn and and do stuff and not just do
00:22:33.000 everything inside of Ruby itself uh I know Matt says he can't uh leave Ruby but like I know he examines and does
00:22:39.720 research on other languages too and you know for some people they leave and they don't come back they find greener
00:22:45.000 pastures elsewhere and for others they do stuff and then bring stuff back and make Ruby better um I think it's great
00:22:51.679 to see Ruby conferences uh like bake this into a thing so like at rails comp
00:22:57.400 this year uh Brian carella gave a talk on Phoenix uh this rails like framework
00:23:02.640 inside of Elixir and the fact that there was this alternate framework track that is like sanctioned as a part of uh rails
00:23:09.360 comp and is just like great to see that you don't see in many other
00:23:15.159 languages um and one of the and one of the things that Ruby's been around for a long time is that it's not considered
00:23:21.159 cool and I think you know like the this blog post by uh Jared Freeman really
00:23:26.400 kind of hits that point home a little bit that like oh back in the inflection I think around 2014 is uh like node.js
00:23:35.080 was more popular search term in like it's climbing and skyrocketing while the popularity of rails is kind of diving
00:23:42.640 down and uh in his blog post he talks about how if he was to start a new company he would not choose Ruby or Ruby
00:23:49.880 and rails as the kind of language and framework of choice to kind of Base your technology on um but on the flip side of that coin
00:23:58.600 is that you know like we're starting to become a more mature ecosystem I think rails came out and the first release of
00:24:05.360 rails was in 2005 so it's 2016 so it's over 10 years old um and uh a lot of
00:24:11.919 these things have means that for web development specifically like we have all these efficiencies and uh uh being
00:24:18.360 able to do like if you're going to build a new app in in something like rails it's actually fairly quick and I think
00:24:25.520 it would be hard you'd be hard pressed to find something that uh you could do
00:24:30.679 just as well as Ruby I think that's something we do really well um and and
00:24:36.200 and like uh like Matt's talking about just like forgetting like I don't want to worry about small things I think there's something really unique about uh
00:24:42.960 the Ruby ecosystem in community and like one of the values we have that I think other communities don't is that we have
00:24:50.200 this uh unique attention to detail that we care about we care about the developer experience like I think the
00:24:56.880 tools that we generate in our community care about air messages like that air messages are good um that like you don't
00:25:03.919 have to do extra steps to do things and so uh this is a quote that Yuda gave me when I was talking with him uh the other
00:25:09.880 day just like coming back to Ruby and doing some things every now and then it feels like a fresh a breath of fresh air
00:25:16.240 uh so it isn't something you get to do all the time it feels really nice to come back and and use this language and
00:25:22.360 the tools that are in this ecosystem um but of course there are
00:25:27.399 also downsides to doing stuff in Ruby um not everything is on this golden path there
00:25:32.799 are less well traveled paths that aren't as well developed um and so I'm kind of
00:25:37.840 I'm going to go for the meat of this talk into like three different use cases that I think Ruby has maybe not done as
00:25:44.840 well uh over the years um and uh kind of explore like what we can do about that
00:25:51.399 uh so I think probably the biggest sticking point that most people talk about is that people think Ruby's slow
00:25:57.520 uh and um at this point uh definitely at Heroku 2 like fast is a feature like
00:26:04.720 people want things that are performant um and I I I think like as a community
00:26:11.120 we've taken that to heart right like uh app folio and Matts have gotten together and started this Ruby 3x3 initiative
00:26:17.880 which I think is really great I'm excited to see when Ruby 3 actually lands um um and to see kind of all those
00:26:25.600 performance gains um but even before like Ruby three hits uh uh I'm very
00:26:30.840 happy that Heroku has sponsored uh Matt kichi noo for the last I think like five
00:26:36.080 years uh and um I think the stuff that we've seen in the ecosystem from that is
00:26:42.159 that we've had uh like regular release Cycles like every Christmas now since 2
00:26:47.440 right like 21 22 23 uh 24 coming out this year uh most likely will land on
00:26:53.440 time um and we've also seen uh actual iterative improvements that we can use on a regular basis right so like in 21
00:27:00.520 we got the generation garbage collector in 22 we got the incremental garbage collector both of those uh kuichi worked
00:27:06.399 on um and two three there's a bunch of other performance improvements and kind of the start of some like ahead of time
00:27:11.960 compilation stuff that kichi is exploring and it's neat to see that this isn't stuff that's like you have to wait
00:27:17.880 when Ruby 3 lands it's stuff that you you get to use and is free to use by just upgrading your Ruby um which is
00:27:25.159 great um so thank you to the Ruby core team thank you AppFolio thank you Heroku and everyone else who's contributed to
00:27:31.760 kind of make this a just better runtime and so I'm super thankful that that is
00:27:38.080 stuff that is things that we don't have to do and we just get better performance
00:27:43.760 um but the perception of Ruby being fast is still a thing that we have to tackle
00:27:49.159 um there has been in the last 5 years or so a handful of companies who have
00:27:54.880 started off in Ruby or had departments that start off Ruby and have moved off uh one example this is LinkedIn there
00:28:00.200 was another one that was group on and um specifically for LinkedIn they moved uh
00:28:05.760 from uh Ruby I believe to node and the reason why was because
00:28:11.600 of the fact that no does such a good job like uh in cir's talk we're talking about leveraging like IO performance so
00:28:19.080 we're talking about doing like microweb services that maybe call a bunch of apis or do a bunch of database calls um and
00:28:26.159 you have all these microw web services that do this work and node from the ground up does a really good job of doing all these things um so when you're
00:28:33.279 building a microw web service to do that like as a technology stack node makes a lot of sense like you have in your
00:28:39.960 standard Library uh non-blocking evented IO libraries and functions right um
00:28:46.320 which is not the case in Ruby uh and I am thankful that in Ruby when I'm doing
00:28:51.440 stuff that this is not a thing that I have to do but it does make a lot of sense when you're building these kind of apps
00:28:58.320 um and so I don't know how many of you are familiar with the jbm ecosystem it
00:29:03.360 sounds like some of you because pitville I know is doing a bunch of that uh but there's this uh Michael framework called
00:29:09.720 Rat Pack um and uh I think we're really fortunate to have a bunch of different
00:29:15.200 VMS like J Ruby out there that allows us to leverage basically the entire jvm
00:29:20.360 ecosystem but still do stuff in Ruby and rat pack um Rat Pack is a uh HP
00:29:29.559 framework that is evented from the ground up and it leverages netti if you're not familiar which is um an event
00:29:35.960 driven uh networking engine at the low level that allows it to be highly performant so a lot of similar things
00:29:43.080 that make like node great uh and so I said reactive like and so what what does
00:29:50.440 reactive actually mean um uh so I think for most people it
00:29:55.960 means the non-blocking community communication so the ability to kind of do that work like in the chat bot where
00:30:03.559 you don't have to wait for the server or for the io for some call to come back
00:30:08.600 while you're doing IO and just block the whole time um and I think a really good real world example of that is like if
00:30:15.360 you're calling customer service so I think the standard case is like you call you call a customer service and you get
00:30:21.279 put on hold and you basically have to wait there uh until like the next uh
00:30:26.519 customer service representative is available uh and that is the example of like a blocking call um but there are
00:30:32.720 some customer service uh places that actually just take your phone number and
00:30:37.760 then you can get off the phone do whatever you want and then they eventually call you back and so to me
00:30:43.320 this is like a very close example of like what a real world uh blocking versus non-blocking looks like um and so
00:30:51.039 ratpack gives us the ability as we're doing any iio in it to have this async non-blocking communication
00:30:57.760 um and we're able to Leverage The concurrent libraries inside the jbm to to kind of do this and have all this
00:31:04.279 non-blocking stuff from the ground up um so what's nice about Rat Pack and
00:31:11.039 doing an inside of J Ruby is that we can write code so this is a simple hello world that looks very similar to Sinatra
00:31:17.519 uh not knowing like any Rat Haack stuff I'm sure you could read this and more or less understand what it's doing of
00:31:22.600 course this is very simple but uh the Handler's block basically allows the handlers inside of rat pack it basically
00:31:30.240 defines like all the asynchronous non-blocking code that we want to do and inside of that we're just uh setting up
00:31:37.639 uh the various routes that we're going to have so you have a chain for get and you can use any of the HTP verbs and then as a parameter to that you just
00:31:44.240 pass the path that you want to do so very similar to how sinatras get and post and all those things work um but
00:31:51.720 where Rat Pack really starts to show a difference versus doing something in Sinatra is the fact that you can do
00:31:57.159 streaming super easily so you can do streaming and leverage the fact that this stuff is async so you're not going
00:32:02.720 to block on the stuff like you would inside a wreck um and not have to use like rack mow or something like that and
00:32:09.919 uh so in this example what's nice is that uh while we're streaming we're consuming work uh on the server but
00:32:16.440 anytime that it block that it has to basically wait for stuff like another
00:32:21.480 another uh route can get processed or uh that stream while it's waiting can work
00:32:27.519 on another thing um and so that allows us to achieve a lot more concurrency and throughput while uh writing fairly like
00:32:36.039 understandable code um and so to set up a simple Benchmark to show what kind of
00:32:41.840 performance you would get from doing this kind of stuff uh I wrote a very simple uh thing that simulated basically
00:32:48.159 like doing some type of IO call uh like fetching results from a database so in this case uh I'm just sleeping for 300
00:32:55.440 milliseconds and then I'm just just returning some response back and when I compare this with basically the
00:33:02.600 comparable code in node which I'm not showing but uh I'm happy to show anyone
00:33:07.679 uh after the talk uh we see we actually get fairly comparable performance numbers uh the r pack stuff uh looks
00:33:14.120 better but um I would just go and say that you can get comparable performance
00:33:19.720 writing this kind of uh J Ruby code that is fairly easy to read and understand
00:33:25.840 especially as a rubius not have to reach out to something like node when you want to build micro web services uh so to me
00:33:31.880 that's like very exciting because this is stuff that you can use today uh this isn't some like future Tech that is
00:33:37.000 around um but you can use ratpack today with J Ruby write write stuff in Ruby
00:33:43.639 itself and uh do things that node is really good at and if you want to learn
00:33:48.880 more you can go to this link there's a blog post that basically details all these slides and go walks through kind
00:33:54.480 of explaining Rat Pack more and the things you can do with it and kind of setting it up running it and deploying
00:33:59.519 it to Heroku um so that's there I'll publish the slides and tweet it so you can um you don't have to write any of
00:34:05.760 that stuff down so we talked about IO for a little bit so now let's talk about like CPU bound performance um so for
00:34:12.839 this you're probably like you would think of like number crunching machine learning any kind of intensive algorithm
00:34:19.040 for that kind of stuff um and I think this applies Beyond just
00:34:24.520 that kind of work like this like what you would think is the coin essential like thing you would do for CPU bound
00:34:31.000 work and in Ruby itself when you're doing a rails app uh uh Sam saffron in this poal Quest actually posted this
00:34:37.960 graph of the kind of the CPU time of the call methods and uh at the top that he
00:34:44.520 highlighted in blue you see blank uh which is active support blank and he said that it marks basically like almost
00:34:51.119 4% of the total CPU call time to process this requests which if you're thinking about like that's actually kind kind of
00:34:57.079 crazy like blank is not a very complicated method uh so this is the implementation of blank it basically
00:35:02.480 just checks if you're if the string is empty or you have Whit space characters
00:35:07.599 and if it does it returns true or else it returns false like not a very complicated method but the fact that it consumes almost 4% uh of like a request
00:35:17.280 is um a lot of CPU time so what can we do about it uh I think the standard
00:35:23.079 solution to any kind of CPU intensive thing is to write a native extension so of course that's what Sam did uh and
00:35:30.520 so he wrote this thing called Fast blank and this is the code you're not expected to read it um and uh with that he was
00:35:37.280 able to actually achieve like pretty nice improvements right so when you're just doing a normal uh Benchmark against
00:35:45.240 it he was able to get 20 20 times up to 20 times performance improvement over the active support implementation of
00:35:51.119 blank um and then on Mac some macro macro benchmarks he was able to improve
00:35:56.400 the performance by 5 5% um uh what you think about for just a a simple micro
00:36:02.760 optimization like this is actually a lot of performance uh for a running rails
00:36:07.920 app um but the problem with that is that writing stuff in C for I think a lot of
00:36:14.520 people is not easy and actually learning like learning the language of C is not tricky it's like becoming good
00:36:20.560 enough to feel confident about the C code that you've written um
00:36:25.720 so an example that uh this is noar which is a if you're not familiar a wrapper
00:36:32.560 around lib XML 2 uh and just going through and searching for it you see that there are issues that come up for
00:36:38.720 just seg faulting and issues with using it uh that come up um so even like
00:36:43.960 seasoned Veterans of like libraries that basically that's all that this Library
00:36:49.440 does run into problems so like doing stuff in C I think for a lot of people is non-trivial and can be very tricky to
00:36:55.640 write safe code um so let me introduce you to rust uh
00:37:01.839 which is a systems programming language uh kind of meant to tackle these kind of issues and problems um and so this is a
00:37:09.480 copy and paste from the if you just go to rust l.org uh of what it is but I think what makes
00:37:16.200 it really neat is that it tries to tackle the safety concerns that people have um with doing stuff in systems
00:37:23.520 level pram languages and also introduces like High uh level Primitives that we're used to
00:37:29.280 inside of Ruby like iterators and U macros and things like that um so for
00:37:36.040 instance um when you actually compile a rust program um the the compiler
00:37:43.079 guarantees that you won't actually run into a Segal uh in the future at runtime
00:37:48.240 so this is really nice because as people who are used to not dealing with small things like this kind of stuff that you
00:37:55.480 have to do with c is definitely like a lot of small concerns that you definitely don't want to deal with um uh
00:38:03.359 so that level of confidence and uh the other nice thing benefit of doing
00:38:08.440 something in Russ is that uh you have these this thing called zero cost abstractions and what I mean by that is
00:38:14.960 in Ruby every time you define a method or you refactor something into something cleaner uh like we saw uh throughout
00:38:22.240 this conference um it there is a minor performance hit doing a method call you
00:38:27.480 put on the stack and you have to call it uh and generally this doesn't matter but if you actually care uh about the
00:38:33.599 performance of that thing like every little bit counts right but in Rust you don't actually have to make this trade-off because you pay that cost at
00:38:40.280 compile time the compiler is able to see these methods and kind of optimize the code in that way um where we're not able
00:38:46.440 to do that in interpreted language like Ruby um and I was talking about higher level Primitives like each and map and
00:38:52.760 things like that and uh it goes so far that when you do something like each in map
00:38:59.599 it actually gives the compiler more information so you it's actually faster than writing the loop by hand with like
00:39:05.920 a for Loop and because it doesn't actually have to do any of the balance checks which you would have to do with a for Loop um so it's nice that it
00:39:13.960 actually encourages you to use these higher level Primitives that we're used to using in Ruby so in Ruby like it
00:39:19.319 might be slower to actually like do something like these fancy things but in Russ it's actually not uh so that's what
00:39:26.040 I mean by zero cost subtractions um and so the implantation of a blank uh versus
00:39:32.400 that c code the kind of Corbit is this so uh not knowing any rust at all if you to read this uh you may not know
00:39:39.240 everything that it's doing but this is actually fairly readable code like there's pretty high level perim that are
00:39:44.520 here where like is white space uh the fact that it has this all iterator um so it uses uh you know parentheses instead
00:39:51.040 of curly braces um and it is statically typed as we see because there's signatures and stuff there but this this
00:39:57.440 code isn't actually that crazy uh as a rubius reading it not knowing anything about rust
00:40:05.319 um uh and so uh godr yood actually ran some
00:40:11.839 benchmarks of this implementation of blank versus Fast blank and of course Ruby and uh you can see that versus the
00:40:19.480 C implementation of fast blank we actually get fairly comparable performance which both are Sly faster
00:40:24.880 than uh doing an impure Ruby um and uh this this code in yellow are
00:40:32.800 the codes that I put on the slides that uh were earlier and all the other code and so that that's like kind of the
00:40:38.839 unique code that kind of describes solving that problem and uh the gray code around it is kind of the boiler
00:40:45.480 plate code that you have to write to get this ruby gem to actually work so as you'd see in the rust case it is kind of
00:40:50.839 a fib to say oh like it's not actually that much code because we're writing all this other boil plate to kind of make
00:40:56.480 the Rust part work um so that's not that great if we
00:41:03.200 actually want to do this on a more regular basis to have to have to copy paste and do those things uh all the time um so let me introduce you to this
00:41:13.000 other project that um is called Helix uh they work on this project called Helix which is kind of named after this bridge
00:41:20.119 and Singapore so I went out uh actually on Wednesday night to take this photo so I could put this in the slide um and so
00:41:27.079 this is a picture if you don't know of Yehuda and Godfrey who are actually working on this project
00:41:32.280 um and what Helix is is it's this bridge between uh Russ and Ruby that allows you
00:41:38.800 to kind of remove all that boil clay code all that stuff in Gray um so you can just focus on solving the problem
00:41:44.359 that you want to do in Rust and so you can actually Define like Ruby classes inside of rust that do the work that you
00:41:50.720 want to do so uh if you all that stuff can be replaced by this simple slide
00:41:56.400 here and this is all the code that you have to write in Rust to make that happen um soly smaller than that code
00:42:03.000 from uh a few slides ago um and what what makes this really
00:42:09.280 exciting is kind of having something like Helix uh unlocks a lot of different opportunities uh I think if the
00:42:15.960 cognitive load of actually writing a c extension is sniffy lower you can start talking about doing it for other things
00:42:21.559 Beyond fast blank right like even for a specific app that is not like a general rails thing you could start profiling
00:42:29.200 your app uh like Reger talked about and uh if there are things that are called a
00:42:34.760 lot or take a lot of CPU call time you can actually reimplement those things using Helix inside of Russ to get the
00:42:41.040 performance you need and uh massively improve the performance of your application um there's also talk of like
00:42:48.040 inside of active support like stable apis that would make sense to reimplement in Rust to kind of get
00:42:54.559 performance and kind of extra those kind of things out um I think there's a really exciting future where we can do
00:43:00.119 more things like Fast flank um and where all you have to do is basically include some type of gem like turbo blank or
00:43:08.079 Turbo whatever and actually just get that performance for free because we're running uh inside of an a
00:43:14.319 extension uh and if you want to learn more about that uh Godfrey did a talk at rails comp which is on uh conf freaks.
00:43:21.800 TV if you look up for look it up under rails cof 2016 or you can actually go to this blog post where he kind of
00:43:28.359 deserialized that talk into a blog post uh that kind of describes all this stuff in more
00:43:34.800 detail um and the last kind of big problem that I want to talk about is packaging and Ruby um and you know like
00:43:42.280 in Java you have stuff like Wars and stuff but in Ruby you kind of have to you know deploy all this source code and
00:43:47.760 then bundle install and do all this stuff just to deploy your app um and uh to kind of illustrate this
00:43:55.280 story I wanted to talk about the Heroku tool belt and if you aren't familiar with it it's the CLI command line that
00:44:01.599 you use to kind of to interact with Heroku uh instead of using the dashboard uh you can do stuff on the command lines
00:44:08.240 and it has a long history Heroku has been around for I don't know like 9 years or something at this point uh and
00:44:14.240 we when we first started uh trying to build something like this we started with a ruby gem uh so you would gem
00:44:20.280 install Heroku and you can still do this today though I don't think it's kept up to date uh and this was kind of a
00:44:27.000 decision at the time because Heroku started as a ruby company for Ruby developers and it made a lot of sense to
00:44:33.599 build something that was native for rubius to use so you would just gem install Heroku and then you know you
00:44:39.440 create a Heroku account you log in you're kind of Off to the Races um but it had its own set of problems uh as we
00:44:47.240 uh became polyglot um and started supporting other Stacks uh and languages uh it was an issue because as
00:44:54.599 a python person in order to use Heroku I had to now install Ruby just to gem install Heroku to then use this product
00:45:01.839 where I had no interest potentially in Ruby at all um so that was an issue for us uh and uh beyond that um even for
00:45:10.680 ruus like it became a support issue because people could have totally
00:45:15.880 different versions of Ruby uh and then this was uh even before like RBM was a thing so most people were using like
00:45:21.079 system level rubies so like if app you were running a different version of OSX you po actually got a newer version of
00:45:26.960 Ruby uh so then we had to make stuff always compatible with Ruby 187 cuz that was the oldest version of Ruby that
00:45:33.640 Apple kept keeping around for a long time so uh we could never use any the nice like syntax and things that came
00:45:39.960 out in Ruby 1 19 um so then to solve that problem we decided to uh package
00:45:46.880 the Ruby runtime inside of like a tarball itself and distribute that um in of itself and that was really great cuz
00:45:54.440 it solved that like what Ruby runtime are we using what are we supporting uh but then it kind of turned all this work
00:46:00.839 of actually packaging into our hands so then we had to have like actually a separate Windows box that sat under
00:46:06.920 someone's desk with like you know like Windows licenses and things and and build that Ruby binary with the package
00:46:14.920 and distribute that we had to do the same thing for OSX and then when Apple decided to add like all the signing
00:46:20.440 stuff like it broke like that whole tool chain we had to go fix that um and then same thing for we had to do special
00:46:26.960 things for Linux and then you run into all the distribution problems with uh Linux being fragmented too and so as you
00:46:33.520 imagine this is like not a great experience and it made it hard to actually like package and release new versions of the tool belt whereas before
00:46:40.359 like publishing and doing stuff inside of ruby gems is actually easy you just like publish the gem you just run a
00:46:45.520 single rate task and you're up and running um and since then there's been
00:46:52.040 uh a project and so now the current tool Bel is a mix of like go JavaScript and
00:46:58.480 uh Ruby though the Ruby codes being removed uh and at the start of that was this project called HK that a Heroku
00:47:05.760 employee uh worked on and the main there was two really big motivating factors for that one of them was that uh like I
00:47:13.319 was saying fast is a feature and so the speed of the HK binary was significantly
00:47:18.680 faster than doing stuff inside of Ruby um so if you just look at this top Benchmark here running Heroku version on
00:47:25.880 the Ruby CLI at that point took over a second and then the Go version midly it
00:47:31.839 did less things was like 16 milliseconds so if you want something that's like highly interactive you can imagine that
00:47:37.160 that kind of sucks to have to wait a second every time you're trying to do something with uh your product um and
00:47:44.000 part of the Crux of that is that like requiring Ruby is not very fast so like as we modulized the code base because we
00:47:50.880 didn't want to have like one single file that was huge that had all the commands and things we broke stuff out um um like
00:47:58.440 you have to actually pay that cost every time at Buddha and so then we did a bunch of work to kind of minimize all
00:48:03.920 that stuff uh so we don't require the files that we actually needed um and
00:48:09.000 then the second part of that was go was able to basically create these stly compiled binaries that were portable um so we could compile specific ones for
00:48:15.880 each of the different language versions uh that we needed um so that made a lot of sense and um even beyond the Heroku
00:48:23.200 case there are examples of like inside of Hashi Corp they've done a bunch of stuff in Ruby they had Ruby clis uh and
00:48:30.319 I think vagan is still a ruby CLI but all their new projects now are written in go for CIS because of just the
00:48:36.440 benefits I listed like it just makes a lot of sense when you're Distributing this to actual customers um and I kind
00:48:42.599 of found at the end of the day that there aren't any real great packaging stories like there's traveling Ruby
00:48:48.480 there's other things out there but all these things are kind of this manual process where you have to trust on them to build these packages for you and and
00:48:55.640 if you kind of stray off that golden path you're kind of out of luck so uh I
00:49:01.359 started a project called M CLI that was really focused on trying to tackle this problem um and at the Crux of it is this
00:49:07.760 project called Emy that Matt started which is a yet another Ruby VM um and it's an embed Ruby that is meant to be
00:49:15.200 embedded in other languages which uh provide a lot of benefits but also had various trade-offs so it's a lighter
00:49:20.880 weight Ruby it uses less memory but it also for go like all the io and kind of other things that are associated with uh
00:49:27.760 platforms a lot of things that you're used to inside of standard lib don't exist uh and the fact that it also doesn't have a standard lib um and we
00:49:36.040 had a bunch of design goals when working on this project the first one being I want to be able to write stuff in Ruby I
00:49:41.200 don't want write like a CLI in go or uh C or something else um and so inside of
00:49:48.440 M uh M CLI uh M Ruby uses this m lib directory and we generate all these
00:49:54.480 files and you can actually just write this Ruby code and you just write straight up M Ruby and it looks very
00:50:01.559 much it pretty much is like regular Ruby code minus a few differences um uh fast
00:50:07.359 as a feature I know I've said that a bunch of times in this talk but it's true and specifically what I mean for this case is the boot of time right like
00:50:13.440 how fast can I get to actually executing Ruby code and um in this case in MRI
00:50:18.799 here's the typical like Hello World MRI use case uh and uh this is a few
00:50:24.440 versions old so I think this like Ruby 22 it takes like 41 milliseconds just to print out hello world to the screen uh
00:50:30.799 and then when I was able to do this in mby CLI we can get get it down to 3 milliseconds which uh is a significant
00:50:37.839 uh speed Improvement and fast enough where it doesn't make a difference uh
00:50:43.319 like you don't have to get it that much faster to make that experience good um and how we do that is inside of
00:50:50.440 U there's no require so all the stuff is loaded up front at uh in memory so you're not paying that cost of searching
00:50:56.839 the disc because it's compiled into the binary um and then we also want to have
00:51:02.440 like go this portable solution that generated a single binary for every platform so uh with Emi when you run the
00:51:09.000 compile command you get a 32-bit and a 64-bit binary for both for Linux OSX and
00:51:14.480 windows uh so you can package that up and distribute that to its customers to your customers uh and then we also want a
00:51:21.920 file size that wasn't massive because we're packaging the entire uh MB interpreter and it's meant to be small
00:51:27.040 um so the OSX version of MB CLI is under a Meg it's like 4 and
00:51:32.119 21k um and then for people to actually use this like it has to be pretty simple
00:51:38.119 so uh to set up all these cross compilers to actually build these binaries you don't want to have to do
00:51:43.200 all that stuff by hand like in order to get started I have to download all these various versions of GCC I have to
00:51:48.319 download MW have to download all these things to get started uh so we actually set up a dock container uh that has all
00:51:54.599 this stuff setup for you uh that will cross compile from Linux to Linux itself
00:51:59.799 Linux to Mac and Linux to Windows and and kind of tackles uh all that setup
00:52:04.880 work that you have to do up front to get a working system uh so using this thing uh here's what a hello world example for
00:52:12.040 just running through the workflow is you download MB C from the MB CLI project
00:52:17.160 it's just a binary you can put it anywhere on your path and just run it um with the set of command it's like rails
00:52:22.960 new and it generates a bunch of files um you go into that directory you run the compile command with Docker and then
00:52:30.480 you're able to just execute the command and then you see Hello World um so that's all it takes to really get started there and uh here are all the
00:52:37.599 files that we generate um I think rails does a good job of like making sure we don't have to bike shed on stuff so we
00:52:42.960 want to provide a similar experience there uh so you don't have to set up any of these things by hand um and then all
00:52:49.839 you really have to do is you have to edit this file uh and this is really the hook into how you run stuff inside of MB
00:52:56.000 CLI so there's this underscore uncore maincore uncore that you can just write whatever code and then any class or
00:53:02.559 whatever that you put inside of mrb lib will become available that you can call and then the argv uh is just like the
00:53:09.079 standard array of arguments that are passed in um and so you can learn more
00:53:14.160 at mc.org U and um uh after I gave a talk about
00:53:21.880 MCL Steve gave this talked about this tweet about kind of just like it's great to learn other languages I don't think
00:53:27.599 you should stop exploring and learning those things um but it's also good to recognize like what ruby isn't good at
00:53:33.319 and if we want to continue doing stuff in Ruby we kind of have to look at these weaknesses and and look at actual
00:53:39.200 Solutions because people are running into these every day uh in the real world uh are causing people to leave um
00:53:47.200 and I've been doing this for 10 years at this point uh Ruby specifically and I'm definitely super excited about the
00:53:54.200 future of Ruby and I've never being more excited about kind of where things are going uh both all the things I've seen
00:54:00.280 with Ruby 3 uh the Ruby 3x3 project uh the projects I've talked about in this talk like being able to work on things
00:54:07.040 that solve the io bound problem uh the fact that I mean Helix isn't totally there yet but like a future where uh
00:54:14.240 being able to write native extensions that improve the performance of my running Ruby app and the fact that we
00:54:19.839 can start looking at packaging things and making that a better story uh is really neat um
00:54:26.599 and uh even uh this year uh there is this index that kind of measures the
00:54:31.920 ratings of like engineers and kind of searches for the language itself uh Ruby
00:54:37.520 went from 16 all the way to 8 last month which was really cool to see it like Spike up again and so it's the highest
00:54:43.760 it's been since kind of the peak rails hype um so that's also exciting that
00:54:49.359 there's kind of this Resurgence of stuff in Ruby itself and uh I implore you to
00:54:55.079 keep writing stuff in Ruby and um without the fear that you're going to hit some wall because it really sucks to
00:55:01.480 pick a technology and then be forced to move away from it because of some technal limitation I think we're getting
00:55:07.280 to a point where there's going to be a future where that won't be true anymore so uh thank you Red Dot uh I'm really
00:55:24.000 me we don't have time for questions uh thanks Terence for your wonderful talk
00:55:30.720 um it's been a while since I practiced some Ruby and I think I'm getting a bit
00:55:35.799 Rusty nice uh we have uh I I think I believe we have qu uh time for questions
00:55:42.000 for terrant I see people moving to the mic awesome yes I have two first question
00:55:50.880 when you were doing the example of the blank method in uh Ruby C and rust um it
00:55:58.039 just kind of like slammed into my head why aren't we testing for a blank string first return true if the string is blank
00:56:05.039 and then create the regular regular expression or whatever only if we need
00:56:10.280 to I don't have I feel like Godfrey could probably tell you a better answer
00:56:15.319 I don't know if you want to come up and answer that I I I guess it's
00:56:20.960 slower so rail rails 5 actually the the example on the slide was actually um was
00:56:29.839 actually the rail for implementation for Simplicity I believe um I I believe as
00:56:35.319 of this very moment um the version on Rails 5 on Master actually has the empty
00:56:40.680 check in front um there are some ongoing no it does not according to
00:56:46.640 them okay so there there basically people try different things and then
00:56:52.000 like the current version is um more fast in the in general case like if
00:56:58.880 you can get different res you pass in very long string very short string um padded strings and stuff like that right
00:57:06.119 and U I think it's hard the the takeaway is is hard to do it um generally for a
00:57:12.039 lot of cases with um with those kind of micro optimizations okay thanks thank you my
00:57:18.520 next question is will Rust work on J Ruby uh this was something I actually
00:57:23.920 talking to Godfree about uh I don't I think there's a way we can get it to work with jni uh in Helix uh
00:57:31.400 and making that code work um but probably out of the box uh not yet uh
00:57:36.760 and if we were to do any of this stuff inside of uh rails like you we would
00:57:42.160 probably maintain both the I was talking to Matthew Draper about this actually the speakers in last night we we would
00:57:48.039 probably maintain both the Ruby version to fall back to if your platform didn't support it uh and then we would have the
00:57:54.280 rust thing to uh for the cases where we could get that um and I think J Ruby specifically
00:58:01.119 is significantly less affected by this problem the MRI because of the VM itself and also uh when you're writing stuff in
00:58:08.200 the like if you wrote a native extension inside of java you're probably able to achieve uh the performance Delta would
00:58:15.160 be significantly smaller than it would be an MRI okay thank you hi um right think the extension in
00:58:24.119 Russ is a lot of us don't really know C but um I
00:58:29.359 tried learning rust and um I ran through a lot of uh H speed speed bumps with uh
00:58:35.559 the B Checker so do you have any tips for people like that uh for basically
00:58:41.480 fighting the borrow Checker yes um I definitely have had to read the doc the
00:58:48.079 in russling basically the borrows documentation a bunch of times uh I think that's just a thing that will be a
00:58:55.319 thing for a long time for anyone who's learning Russ uh but I think that's also kind of a huge benefit of Russ the fact
00:59:01.599 that there is the borrow Checker because the whole point of the borrow Checker is that uh they didn't let you compile that
00:59:06.680 code because you're doing something that's unsafe um and so that's just a thing that you know like over time
00:59:12.319 you'll have to learn uh I don't have any great tips uh I also run to I still fight the borrow Checker all the time uh
00:59:19.319 today as well um but I just recognize that's it's me doing something dumb uh
00:59:24.480 that uh the compiler is telling me I shouldn't be doing um and in C I probably would be able to just compile
00:59:29.520 this code and then I would find out later in production at runtime that I did something dumb
00:59:39.359 right any more questions okay uh it seems like uh
00:59:47.839 there's no more thank you parents
00:59:53.640 again
Explore all talks recorded at Red Dot Ruby Conference 2016
+17