WEBVTT

1
00:00:00.160 --> 00:00:03.439
Hey, folks, welcome back to
the Ruby Dev Summit. I am your

2
00:00:03.480 --> 00:00:06.240
host, Charles Maxwood, and we
are going to talk a little bit about

3
00:00:06.240 --> 00:00:10.240
the Ruby programming which language today.
Now we've talked about community, We've talked

4
00:00:10.240 --> 00:00:16.039
about the learning resources and media resources. We've talked about all kinds of different

5
00:00:16.039 --> 00:00:19.960
things coming in the Ruby programming language
as far as what platforms that can run

6
00:00:19.960 --> 00:00:23.600
on. And now let's just dive
into the language itself, right and so

7
00:00:24.079 --> 00:00:27.600
there are a whole bunch of things
that have come out lately with the Ruby

8
00:00:27.600 --> 00:00:31.399
three dot three and three dot two. I think the thing that most people

9
00:00:31.399 --> 00:00:36.039
are most excited about are just the
performance upgrades that come with Ruby. So

10
00:00:36.119 --> 00:00:40.000
let's talk about a few of those. One of the biggies is actually the

11
00:00:40.079 --> 00:00:44.359
justin time compiler or the JIT.
You'll hear people talk about wy jit.

12
00:00:44.520 --> 00:00:49.560
That's the justin time compiler that is
built into Ruby. Incidentally, I just

13
00:00:49.640 --> 00:00:54.439
installed Ruby three dot three on my
machine and it kept failing, so I

14
00:00:54.439 --> 00:00:57.560
had to figure out what the problem
was. It turns out you need Rust

15
00:00:57.759 --> 00:01:00.960
to compile Ruby these days, so
that's just a heads up if you're getting

16
00:01:02.000 --> 00:01:06.480
into that. But it's pretty hard
fast, so I'm pretty happy with that.

17
00:01:06.640 --> 00:01:10.519
It's it's awesome, but yeah,
diving in. So what is a

18
00:01:10.599 --> 00:01:12.400
JIT? What is adjusting a time
compiler? Well, I put out a

19
00:01:12.560 --> 00:01:18.079
short on some of the Ruby rogues
extras where I talked about what a JIT

20
00:01:18.239 --> 00:01:19.879
or just a time compiler is.
But effectively, what it does is it

21
00:01:19.879 --> 00:01:23.439
takes stuff that you run a lot
in Ruby and it compiles it down to

22
00:01:23.519 --> 00:01:29.000
machine language so that it can actually
run it faster every time it runs.

23
00:01:29.000 --> 00:01:33.840
It's right. So let's say that
you're running through a loop and you're going

24
00:01:33.920 --> 00:01:36.640
to run through it a million times
after the first I don't know, a

25
00:01:36.640 --> 00:01:41.079
few hundred times I think it is, it'll actually pick that loop up and

26
00:01:41.120 --> 00:01:45.000
it'll compile it down so that it
can run it natively on your machine,

27
00:01:45.400 --> 00:01:49.599
kind of like Sea and Rust and
those kinds of languages do it, which

28
00:01:49.640 --> 00:01:53.400
is way cool and it makes it
way faster. So that's just one thing

29
00:01:53.400 --> 00:01:57.719
to keep in mind. Now the
GIT is turned on, you can turn

30
00:01:57.760 --> 00:02:01.480
it on with a flag and Ruby
three two you can turn it on at

31
00:02:01.519 --> 00:02:06.719
run time in three dot three And
so if you want to run it,

32
00:02:07.280 --> 00:02:10.919
or if you are using a gem
or language or framework or something like that

33
00:02:10.919 --> 00:02:15.639
that decides that it wants or needs
it, then it can actually turn it

34
00:02:15.680 --> 00:02:20.800
on for you if you're running Ruby
three three And it looks like some of

35
00:02:20.840 --> 00:02:23.520
the more upcoming versions of rails are
going to actually take advantage of that turn

36
00:02:23.560 --> 00:02:28.759
it on. So pretty excited about
that. That's cool stuff. Another thing

37
00:02:28.800 --> 00:02:35.000
that we talked about is the parser, the Prison parser. I couldn't get

38
00:02:35.039 --> 00:02:39.919
Kevin Newton to come. There was
some deal with making sure that it worked

39
00:02:39.919 --> 00:02:43.919
out for his work, and there
just wasn't enough time to make them comfortable

40
00:02:43.960 --> 00:02:46.879
with him doing an interview. So
but yeah, he's been writing a whole

41
00:02:46.919 --> 00:02:53.080
bunch of stuff on his blog and
anyway, just just awesome, awesome stuff

42
00:02:53.080 --> 00:02:58.120
coming out with the prison parser.
Apparently it's faster, it's cleaner, it

43
00:02:58.159 --> 00:03:01.639
does a whole bunch of stuff,
and it's more fault tolerant, which means

44
00:03:01.680 --> 00:03:06.719
that if you write syntax problems into
your Ruby code, it will pick them

45
00:03:06.800 --> 00:03:10.560
up and it handles them better.
But what's really interesting about the prison parser

46
00:03:12.560 --> 00:03:15.879
in particular is that it is a
parser that can be used for other projects

47
00:03:15.960 --> 00:03:23.479
like Opal or Ruby WOSM or Truffle
Ruby or some of the other Ruby interpreters.

48
00:03:23.560 --> 00:03:25.639
Out there, right, And so
if you're running Ruby, that's not

49
00:03:25.919 --> 00:03:30.199
Ruby Ruby, maybe it's j Ruby. Right. All of these languages can

50
00:03:30.240 --> 00:03:36.120
take advantage of it and pars in
a nice, clean, awesome, automated

51
00:03:36.159 --> 00:03:39.039
way. But another thing that comes
out of it is that one of the

52
00:03:39.080 --> 00:03:46.000
things that we use Ruby for fairly
often on our development machines is programming language

53
00:03:46.000 --> 00:03:51.840
services. So, for example,
if you're using visual Studio code or Ruby

54
00:03:51.879 --> 00:03:55.120
Mine or something like that, then
it actually runs Ruby on the side,

55
00:03:55.280 --> 00:04:00.439
and it is consistently talking to that
Ruby VM and making sure that the stuff

56
00:04:00.439 --> 00:04:03.800
that you send to it is valid
Ruby. And so that's why you get

57
00:04:03.800 --> 00:04:08.000
the little syntax highlighting, the little
I don't know what it is, a

58
00:04:08.039 --> 00:04:12.960
little line that goes under you know, syntax issues and stuff like that.

59
00:04:13.879 --> 00:04:15.759
So when it highlights them, what
has done is it's taken the code in

60
00:04:15.839 --> 00:04:19.759
your file and it's handed it off
to the parser, and the parser parses

61
00:04:19.800 --> 00:04:23.279
it and then hands back, hey, this is valid, this isn't valid.

62
00:04:23.800 --> 00:04:27.279
And apparently the Prison parser does that
a lot better, and so it's

63
00:04:27.319 --> 00:04:33.000
a lot cleaner as far as picking
up issues within your Ruby code and getting

64
00:04:33.000 --> 00:04:39.519
that back to you in a timely
and accurate manner, and so that's that's

65
00:04:39.600 --> 00:04:43.480
way awesome. It does a whole
bunch of other things as well, but

66
00:04:43.639 --> 00:04:46.720
yeah, I'm really really excited about
that. Another one is I talked to

67
00:04:46.800 --> 00:04:57.600
Sam Williams about the Async library and
fiber schedulers and the Falcon web server,

68
00:04:58.759 --> 00:05:01.680
and so a lot of that speaks
to specifically the performance of Ruby and the

69
00:05:01.720 --> 00:05:08.439
concurrency models that Ruby's able to execute. And it makes things a whole lot

70
00:05:08.519 --> 00:05:13.480
faster without having to like optimize every
little tiny piece of the programming language,

71
00:05:13.959 --> 00:05:16.040
because it allows you to do multiple
things at the same time on a machine

72
00:05:16.079 --> 00:05:20.480
in a more efficient way. And
so anyway, our ability to be able

73
00:05:20.519 --> 00:05:26.040
to run things in parallel and to
do better work in Ruby and get things

74
00:05:26.079 --> 00:05:32.560
done more quickly is enhanced by those
kinds of advantages and things upcoming. And

75
00:05:32.600 --> 00:05:40.639
then also talk to Jeremy Evans about
some of the stuff that he's been doing

76
00:05:40.639 --> 00:05:45.439
with the Ruby programming language, and
specifically he talked about how Ruby allocates a

77
00:05:45.560 --> 00:05:48.839
rays and so if there's any kind
of list of anything, a lot of

78
00:05:48.879 --> 00:05:54.279
times I guess Ruby will break up
the array and store it across the heap

79
00:05:54.759 --> 00:05:59.160
instead of storing it in one continuous
part of the heap, and it might

80
00:05:59.199 --> 00:06:01.800
allocate things moreultiple times and things like
that. He explains it much better in

81
00:06:01.839 --> 00:06:05.279
the interviews to go check it out, and so anyway, he breaks down

82
00:06:05.319 --> 00:06:11.360
how he's put that together so that
it does fewer allocations and more efficient allocations,

83
00:06:11.800 --> 00:06:14.439
and then when it goes to clean
up, then it can do less

84
00:06:14.480 --> 00:06:16.879
work that way, and that also
enhances performance because the garbage collector doesn't have

85
00:06:16.920 --> 00:06:21.720
to run as long, and because
Ruby is more memory efficient. So anyway,

86
00:06:21.839 --> 00:06:26.439
tons and tons and tons of stuff. Another one that I talked to

87
00:06:27.879 --> 00:06:34.519
Sotro Matsumoto, and he's been working
on RBS or Ruby types or types in

88
00:06:34.519 --> 00:06:39.040
the Ruby language, and so we
went into all of that and what it

89
00:06:39.079 --> 00:06:44.240
means, and I'm I have to
admit I'm not completely sold on types or

90
00:06:44.279 --> 00:06:48.399
type annotations in Ruby. But at
the same time, I mean, there

91
00:06:48.399 --> 00:06:54.519
are a lot of people out there
doing typescript because it helps eliminate certain classes

92
00:06:54.519 --> 00:06:59.600
of bugs, and so I can
understand the attraction if you're consistently running into

93
00:06:59.639 --> 00:07:03.000
those. I still think that in
Ruby the most common error is the type

94
00:07:03.079 --> 00:07:08.480
error. This function doesn't exist in
nil or this method doesn't exist on nil

95
00:07:08.959 --> 00:07:12.439
and so you look at that and
you go, Okay, well, maybe

96
00:07:12.480 --> 00:07:15.600
if we could eliminate a whole bunch
of those, we'd have better, more

97
00:07:15.639 --> 00:07:23.079
reliable programs. And maybe, but
there are other ways to infer types if

98
00:07:23.079 --> 00:07:25.680
you look at type prof and other
things. So but anyway, he dives

99
00:07:25.680 --> 00:07:29.079
into that and he talks about some
of those differences between the two philosophies that

100
00:07:29.120 --> 00:07:32.120
I kind of outlined, and why
it may or may not make sense under

101
00:07:32.120 --> 00:07:35.759
one circumstance or another, and what's
been done there. So if you're interested

102
00:07:35.800 --> 00:07:40.439
in Ruby types, definitely check that
off or check that out. I talked

103
00:07:40.439 --> 00:07:46.399
to Stephen Markheim about sequel LIGHTE on
rails and sequel LIGHTE and Ruby, which

104
00:07:46.439 --> 00:07:50.079
isn't directly the programming language, but
again, you know, it comes back

105
00:07:50.120 --> 00:07:54.600
to these options that we have on
how and where we run Ruby, and

106
00:07:54.639 --> 00:07:59.639
so that's all very very exciting.
And then you know, another engine that's

107
00:07:59.639 --> 00:08:03.399
out there is Dragon Ruby and I
talked about it in the platforms discussion that

108
00:08:03.439 --> 00:08:07.680
I had a few days ago,
but it's also a Ruby engine that runs

109
00:08:07.720 --> 00:08:11.920
on the mobile and does its thing
there. And so that and Ruby WASM

110
00:08:13.079 --> 00:08:18.079
and the opportunities that come out of
that are just anyway, very very exciting

111
00:08:18.120 --> 00:08:20.680
stuff. So if you want to
dive into some of the performance stuff,

112
00:08:20.759 --> 00:08:24.639
or if you want to dive into
some of the language feature stuff that it's

113
00:08:24.680 --> 00:08:28.600
coming out, they definitely check those
out. Again. Those are the talks

114
00:08:28.639 --> 00:08:37.679
by Utah Zito for Ruby, WAM
for Samuel Williams with a Sink and Falcon,

115
00:08:39.279 --> 00:08:43.399
Jeremy Evans where he talked about the
allocation stuff and gems and sequel and

116
00:08:43.480 --> 00:08:50.120
Rode and all that good stuff,
and then Soto Matsumoto talking about RBS and

117
00:08:50.120 --> 00:08:54.240
typing. So anyway, today's talks
are going to be Alex Rudahl talking about

118
00:08:54.240 --> 00:08:58.320
the open aigm and stuff like that
that he's doing, Jeremy Evans, like

119
00:08:58.360 --> 00:09:05.399
I said, wrote a sequel and
performance, Sotoro Matsumoto is today he's talking

120
00:09:05.399 --> 00:09:11.360
about RBS and the typing system,
Andy Mala talking about Glimmer and Glimmer UI

121
00:09:11.399 --> 00:09:16.480
which incidentally is also running Ruby on
the desktop, and Jason Sweat from Code

122
00:09:16.480 --> 00:09:20.559
with Jason and since they Ruby.
So if you're into all that, check

123
00:09:20.600 --> 00:09:24.120
it out. If you want the
talks from from the last few days,

124
00:09:24.480 --> 00:09:28.200
you can get them by signing up
for Ruby bits, rails, clips or

125
00:09:28.200 --> 00:09:33.879
a combo of both, and yeah, looking forward to meeting up with you

126
00:09:33.960 --> 00:09:37.080
all as time goes on and keep
an eye out for things. I'm also

127
00:09:37.200 --> 00:09:41.879
going to really briefly tease that I
am working with Alex Alex Rudall to put

128
00:09:41.879 --> 00:09:48.679
together and open Ai five Day Ruby
Challenge, and so if you want to

129
00:09:48.759 --> 00:09:52.720
check that out, go to five
day Ruby dot com and we will have

130
00:09:52.799 --> 00:09:56.240
that all available so that you can
sign up for the challenge. And then

131
00:09:56.279 --> 00:10:01.080
if you're looking to get into some
of that AI or ali AI tooling from

132
00:10:01.120 --> 00:10:05.240
open ai, will definitely do that. I'm also talking to a few other

133
00:10:05.279 --> 00:10:09.879
people about other options either within the
AI space or with building SaaS, so

134
00:10:09.360 --> 00:10:13.720
we'll do other challenges going forward.
But that's what I got for today,

135
00:10:13.799 --> 00:10:16.679
So until next time, Max out

