Alice Ryhl
๐ค SpeakerAppearances Over Time
Podcast Appearances
I mean, if you compare with something like JavaScript in the browser, you might compare Tokyo with the browser itself.
For example, in JavaScript, you have this loop.
this event loop, which has all the tasks that are able to run, and then they get executed one after the other.
And especially if you use the await stuff, then you can have tasks pause, and then another task starts running on the same thread.
And Tokyo does something similar.
It has a queue of things that are able to run, and then it will run them.
So unlike JavaScript, Tokyo can be multi-threaded, so you can have multiple queues running in parallel.
I think part of what I liked about Rust is this feeling that as you write the code, when it compiles, it works.
I mean, this has to be in quotes, right?
Because obviously it's possible that there are bugs.
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.
To begin with, I think to have a language that feels this way, you have to have a type system.
That's where it all starts.
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.
I mean, the classic example is Java's Null.
It was Tony Herr.
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.
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?
That problem just doesn't exist.
So you can't have that kind of crash.