2021_winner_Interview

Maxime Chevalier-Boisvert Interview

host Yukihiro Matsumoto

まつもとゆきひろ委員長

Yes, then let’s start the interview.

Probably we met for the first time

I saw your videos and presentations, but probably I met you in the first time in the face and even online.

So,

May I ask you a few questions. So, first of all could you introduce yourself briefly?

Maxime Chevalier-Boisvert

Sure, nice to meet you. My name is Maxime Chevalier-Boisvert. I am working as a compiler engineer at Shopify, working on the YJIT compiler projects, which is just in time compiler for the Ruby programming language.

まつもとゆきひろ委員長

Tell, tell us how you come across programming. How did you start programming?

Maxime Chevalier-Boisvert

Sure, I think I first started programming when I was 10 years old. I had DOS386 computer with QBasic on it.

But at the time, I couldn’t read English. So I had access to all the help files, but I had a lot of difficulty making sense of it. So I couldn’t get very far. I think it’s only when I was 16 when I got access to the internet at home. And then on the internet, I could find many learning resources. And then I started learning C++.

まつもとゆきひろ委員長

So you started in Q basic, then C++.

Do you remember your first program?

Maxime Chevalier-Boisvert

Well, when I was a kid, when I was 10, I would write just like simple animations, just plotting some lines and having loops with that sort of thing.

まつもとゆきひろ委員長

So the then you majored in the Computer Science in the university? Right?

Maxime Chevalier-Boisvert

Yes, I did. I went to McGill University, and studied Computer Science.

まつもとゆきひろ委員長

Oh, so did you have any plan to have programming as an occupation when you were in high school?

Maxime Chevalier-Boisvert

I think I wasn’t exactly sure what I would do when I was in high school, I thought I would either go into programming or maybe computer engineering.

まつもとゆきひろ委員長

So, how did you come across Ruby?

Maxime Chevalier-Boisvert

I think the first time I came across Ruby was when I was maybe 20, or 21 years old. And I wanted to create a website with a forum. And Ruby on Rails was the best web framework at the time. That’s the first time I came across Ruby.

まつもとゆきひろ委員長

That I’ve heard your PhD thesis was based on the topic of the JIT compiler, similar to the YJIT currently you’re working on. So, how did you pick that theme for the PhD thesis?

Maxime Chevalier-Boisvert

Right? Well, I think I became very interested in programming when I did my undergrad. And I found I really loved programming. So I got interested in compilers, because I wanted to have a deeper understanding, you know, because if you can create a compiler, you can create a programming language.

For my master’s, I went into a compiler research group, and I did a JIT compiler for MATLAB. And my advisor, I think she was really interested in optimizing numerical computation. But the aspect that I found really interesting was the dynamic typing, because MATLAB is dynamically typed, like JavaScript and Ruby and other languages in that family.

So for my PhD, I decided to focus more on optimizing dynamic typing and that’s why we end up choosing to do a compiler for JavaScript.

まつもとゆきひろ委員長

So the how did you come to apply for Shopify?

Did they find you to do work on the JIT compiler?

Maxime Chevalier-Boisvert

Yeah, they did.

I got an invitation from Chris Eaton to discuss research, and potential job opportunities. And I decided to take the job, and I joined the Ruby and Rails infrastructure group at Shopify.

And then in that group, there’s many people working on optimizing the Ruby VM.

まつもとゆきひろ委員長

Yeah. So how big is the team?

Maxime Chevalier-Boisvert

I think the Ruby and Rails infrastructure team, the broader team in total is about 100 people, I believe, I could be mistaken. People who are specifically working on the Ruby VM, is probably on the order of 10 to 12 people, directly or indirectly. I hope I’m not quoting the wrong numbers. I apologize to my managers, if I am. (laughs)

まつもとゆきひろ委員長

That’s okay. That’s okay. (laughs)

Maxime Chevalier-Boisvert

And otherwise, for the project right now, we’re six people.

まつもとゆきひろ委員長

Thank you. Our core team is now really big. Shopify’s team is almost as big as us.

So there’re probably those in the audience who might not know about the JIT compiler. Could you briefly explain how JIT compiler works and, how it boosts the performance of the virtual machine?

I know, it’s pretty complicated.

まつもとゆきひろ委員長

このインタビューの視聴者の中には、JITコンパイラをご存知ない方もおられると思うんです。

JITコンパイラがどのように機能し、どのようにVMの性能をアップさせるのか、簡単にご説明ください。

とても複雑なことはわかっています(笑)

Maxime Chevalier-Boisvert

Right. Well, so where should I start?

Typically, most dynamic languages are interpreted, or at least they have an interpreter. And the interpreter will kind of execute the code, basically, one line at a time, more or less, one instruction at a time and there’s a loop that goes over the instructions in the program and just executes them.

The way that JIT compiler works is, it takes those instructions, and it turns them into machine code. And it removes the need to loop over the instructions. And it also allows to eliminate a lot of the conditional checks that happen inside of an interpreter, to make the code more streamlined so that the CPU can execute it faster.

まつもとゆきひろ委員長

Could you explain about that trade off to the to the JIT compiler compared to the interpreter?

Maxime Chevalier-Boisvert

Yes. I think there’s multiple tradeoffs.

One of the tradeoffs is that when an interpreter you can have very fast startup time.

This is why even optimizing JavaScript engines, for example, like Google V8, there’s still an interpreter in there, which is kind of like level zero optimization, and level zero is still an interpreter.

Because compiling the programs to machine code takes a certain amount of time.

So that’s one trade off the potential slightly slower startup.

There can also be like an increase in the complexity of the code. Because often, when you have a JIT compiler, you have multiple levels of optimization. You can have an interpreter, a baseline JIT, and sometimes one or two more levels of JIT on top of that.

And then there’s also memory usage. JIT compilers typically store some auxiliary data, along with the generated code to keep track of the assumptions that are made to the optimized code. And that takes a certain amount of memory as well.

まつもとゆきひろ委員長

Thank you, the JIT compiler seems to be pretty promising in the improving the Ruby performance. Do you have any future plan on the improving the YJIT?

Maxime Chevalier-Boisvert

Yeah, we have. We have many future plans.

One of the things that we want to do this year is that we want to add an ARM backend because right now we only support x86-64. We’d like to add a 64 bit ARM back end. So we can support ARM M1, and also Raspberry Pi, etc.

We want to, at the same time add a new intermediate representation for our backend so that we can have some optimization passes of the machine code to generate better quality machine code.

まつもとゆきひろ委員長

Yeah, that pretty exciting. Do you have any other plan?

Maxime Chevalier-Boisvert

Yes, well, I think I think one day I’d like to maybe create a programming language on my own one day, maybe.

まつもとゆきひろ委員長

I think it will be fun.

Maxime Chevalier-Boisvert

Yes. It also seems like a very scary project. A lot of work.

まつもとゆきひろ委員長

Creating a programming language is pretty exciting. And it could be a lifelong project.

I really encourage you to do that someday in the future.

Maxime Chevalier-Boisvert

If I do, I think I will start small.

まつもとゆきひろ委員長

Yeah. Yeah. Start small. Even I started small.

It seems you are very enthusiastic about programming. Your Twitter account is @Love2Code.

Could you tell us about the your, love and passion for programming?

Maxime Chevalier-Boisvert

Yeah, sure. I think, when I was a kid, I grew up poor.

My mother was on welfare. I was raised by a single mom. I was very passionate about machines and electronics. But the problem is, especially at the time, electronic parts were very, very expensive. And when you want to do electronics, you always need to buy new parts. So it was the kind of hobby that was not very accessible. But eventually, I discovered computers, and it was like the ultimate machine.

Because you can write code, the only limit is your imagination. You don’t need any parts. You just need, time and focus and there’s no limit to what you can create with quick codes.

まつもとゆきひろ委員長

Yes, it’s as you say. As a child, I thought it was magic. I used to wonder if I could do with my imagination. Programming made it possible.

I used to think the same in high school. Probably some people listening to this interview, who want to become programmers, working on the core of the system. Do you have any words of advice for them?

Maxime Chevalier-Boisvert

First, well, I guess it depends where you are, but I think if you want to learn programming, I would encourage you to start learning on your own. It doesn’t matter how old you are.

Just if you’re curious about programming, you know, do some internet searches, find some tutorials online, maybe download Ruby and start reading some codes starts playing with it experiments don’t be afraid of failure, just keep trying. And the more you do it, the better you’ll get.

まつもとゆきひろ委員長

Yeah, you know, good things is that you know, you usually don’t burn the computer, whatever you pronounce.

In electronics craft you put to big a current and you know, you you will burn the circuit. But yeah, programming is much, much safer.

Maxime Chevalier-Boisvert

It’s hard to know what to say without the audience being there but follow your passion. Have fun.

まつもとゆきひろ委員長

Yeah, indeed. The last question is what makes you a great programmer?

Maxime Chevalier-Boisvert

I think attention to detail.

I think programming is a form of communication. And as with other forms of communication, it’s good to write your code in a way that’s easy to read. To put yourself into in the users’ shoes. When people run your program what is their experience going to be like? What are the things that could be not obvious to them? And how can you make the user experience better?

まつもとゆきひろ委員長

As your programming grows, the community is formed around the project and that is the community is based on the communication there. The communication is very crucial to the programming.

Okay.

That, I think that’s all so that yeah, thank you for the time and thank you for

being with us. And that congratulation to the getting the Ruby prize.

Maxime Chevalier-Boisvert

Thank you very much. Very nice to meet you today.