2.3 Programming Languages

Before delving into the specifics of each component, let's take a moment to discuss the programming languages employed by Deno. As we proceed, we'll provide a concise overview of the languages utilized within the Deno ecosystem. This understanding will lay a foundation for comprehending the subsequent details about Deno's various components.

Rust

A significant portion of Deno's codebase is crafted using Rust, a highly popular and secure programming language. Rust's robustness adds an extra layer of reliability to Deno's architecture. Various essential elements of Deno, such as the CLI (Command Line Interface), module graph management, runtime execution, operational functionalities, and core mechanisms, heavily utilize Rust.

Rust stands as a versatile programming language with multiple styles and applications. It's designed to excel in overall performance, safety in handling data types, and managing tasks running concurrently. It boasts a unique feature: memory safety is enforced, meaning that it ensures all references point to valid memory locations. Surprisingly, it achieves this without relying on a garbage collector or reference counting, methods often used in other languages prioritizing memory safety. The magic behind this memory safety and the prevention of data conflicts happening at the same time lies in its "borrow checker." This checker closely observes the lifespan of object references throughout the program's compilation process.

In Rust, you'll notice traces of functional programming concepts interwoven with its design. These concepts include static typing, meaning that variable types are known and checked at compile time, immutability which avoids accidental changes to variables, higher-order functions allowing functions to be treated as variables, and algebraic data types that elegantly represent data structures. All these elements contribute to Rust's stronghold in the realm of systems programming, where control over hardware and memory is paramount.

The journey of Rust started with a developer named Graydon Hoare, who embarked on creating it as a personal venture while employed at Mozilla Research in the year 2006. Eventually, Mozilla recognized the potential and officially backed the project in 2009. Since its inaugural stable release in May 2015, Rust has garnered significant adoption from major players like Amazon, Discord, Dropbox, Facebook (now known as Meta), Google (under the Alphabet umbrella), and Microsoft. The year 2022 marked a historic milestone for Rust, as it became the first language, apart from C and assembly, to receive support for Linux kernel development.

One of the most intriguing aspects of Rust is its rapid growth as a newer programming language, earning it a special place in the ever-evolving world of programming. This surge in popularity has also caught the attention of academia, leading to its exploration and examination in the realm of programming language research. The multifaceted nature of Rust has attracted the curious minds of researchers, setting the stage for further advancements and discoveries in the world of programming languages.

C++

It's important to note that while Deno's foundational codebase relies solely on Rust, the complete V8 engine, which Deno utilizes for executing JavaScript and WebAssembly, is constructed using the C++ programming language.

V8 stands as Google's open-source, high-performance engine for JavaScript and WebAssembly, constructed using the C++ programming language. This impressive engine finds its applications not only in Chrome but also in Node.js and various other software. Its primary function involves the interpretation and execution of ECMAScript and WebAssembly, which are essential components of modern web development.

V8 finds compatibility across multiple operating systems, including Windows 7 and later versions, macOS 10.12 and beyond, as well as diverse Linux systems that rely on x64, IA-32, ARM, or MIPS processors. This broad compatibility allows developers to harness the power of V8 across various computing environments.

What makes V8 particularly versatile is its capability to function both as a standalone entity and as an embedded component within any C++ application. This flexibility empowers developers to tailor their software solutions to their specific needs while benefiting from the high-performance capabilities that V8 brings to the table. Whether it's powering web browsers or enhancing the capabilities of applications, V8's influence is far-reaching and impactful in the realm of modern software development.

JavaScript

Deno's primary runtime user-facing code is crafted using JavaScript. This integral element furnishes Deno's JavaScript APIs, which you can readily invoke within your own code. A handful of illustrative instances encompass functions such as getEnv, setEnv, alert, confirm, and console logs. Additionally, this encompasses the APIs stemming from the ext component, further enriching the scope of utility.

This overarching component encapsulates a suite of essential user-level functionalities. Among these, you'll encounter key elements like Buffers, File System interactions, Process management, Signal handling, HTTP communication, and user prompts, to name a few. This comprehensive array of functionalities lays the foundation for Deno's versatility and its potential to empower diverse applications.

In its early days, the runtime code of Deno was originally written in TypeScript. However, due to certain challenges that arose, the decision was made to transition it to pure JavaScript. This adjustment was made to address specific issues that were encountered during the development process.

Last updated