Menu
Sign In Search Podcasts Libraries Charts People & Topics Add Podcast API Blog Pricing

Alice Ryhl

๐Ÿ‘ค Speaker
505 total appearances

Appearances Over Time

Podcast Appearances

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

I mean, if you compare with something like JavaScript in the browser, you might compare Tokyo with the browser itself.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

For example, in JavaScript, you have this loop.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

this event loop, which has all the tasks that are able to run, and then they get executed one after the other.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

And especially if you use the await stuff, then you can have tasks pause, and then another task starts running on the same thread.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

And Tokyo does something similar.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

It has a queue of things that are able to run, and then it will run them.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

So unlike JavaScript, Tokyo can be multi-threaded, so you can have multiple queues running in parallel.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

I think part of what I liked about Rust is this feeling that as you write the code, when it compiles, it works.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

I mean, this has to be in quotes, right?

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

Because obviously it's possible that there are bugs.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

But this is something a lot of people say about Rust, and there's a reason people say it, even though it's not necessarily literally true.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

To begin with, I think to have a language that feels this way, you have to have a type system.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

That's where it all starts.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

I do think that even compared to other languages with type systems, I think Rust does a better job than many languages, even others with type systems.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

I mean, the classic example is Java's Null.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

It was Tony Herr.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

who invented the null, and he called it his billion-dollar mistake because it's so easy to have... I mean, every time you call a function, you might have a crash in your program.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

And in Rust, I think they're really good at making sure that when you call a function, there's no chance that it might be null, right?

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

That problem just doesn't exist.

The Pragmatic Engineer
Why Rust is different, with Alice Ryhl

So you can't have that kind of crash.