Let's now dig into its architecture, how Deno works.
The three building blocks of Deno are :
- Rust is a multi-paradigm programming language focused on performance and safety, especially safe concurrency. Rust is syntactically similar to C++ but provides memory safety without using garbage collection.
- Tokio is an event-driven, non-blocking I/O platform for writing asynchronous applications with the Rust programming language. At a high level, it provides a few major components: Tools for working with asynchronous tasks, including synchronization primitives and channels and timeouts, delays, and intervals.
A process is simply a program in execution. Now Deno uses Rusty_V8, a program written by Deno people. Remember, Deno is written in Rust. But why Rust, unlike Node, which is written in C++, C. They choose Rust because it has really good safety when it comes to memory.
Now, here's the final part. We need to have now asynchronous IO.
What does that mean?
Well, let's pretend that we make a request, set time out a request in order for us to be able to run multiple things, multiple operations at the same time in the background. We need something called an event loop. It's a way to run events in the background. And this is where the Tokio Library comes in. The Tokio Library is a rust project, rust library that allows us to use what we call a threat pool and workers to do work for us primarily.
That's it, that's how the web works. That's how Deno works.
Zero to Mastery Academy