Recently, Ryan Dahl, the founder of Node.js, discussed his views on Javascript containers in the community with the title of "JavaScript Containers" - Javascript is the "future" of general-purpose scripting languages, and Javascript containers are "pioneers" that simplify server abstraction. "Practitioner.
As we all know, most server programs run on Linux systems, they consist of a file system, some executable files, some shared libraries, and they may interface with system software such as systemd or nsswitch.
But since server software typically relies on many system resources and configurations, deploying it has been a challenge in the past. The emergence of Linux containers has solved this problem very well. Especially after Docker further popularized the use of Linux containers, OS-level virtualization provided an excellent mechanism for distributing server software, and each container image was a dependency-free, ready-to-run software package.
Ryan Dahl said that similar closed environments can still be found in browser JavaScript, albeit at a higher level of abstraction. It wasn't until 2018 that Cloudflare's Zack Bloom launched the Workers service that "prompted us to think about whether JavaScript itself could provide a new kind of self-sufficient server container" — "The more we can remove unnecessary abstractions, the better Approaching the concept of 'The Network Is the Computer'.
JavaScript is the "future" of general-purpose scripting languages
Ryan Dahl believes that technology is difficult to predict, but the World Wide Web (World Wide Web, Wide Area Network) will definitely appear in 10 years. As more and more human infrastructure is connected through web applications, 10 years from now, the standards that make up the web, such as HTTP, HTML, CSS, JavaScript, will certainly emerge. Hence, "I believe that JavaScript will continue to be developed and improved".
We know that the network is the basic medium of human information, and scripting languages are like the "cornerstone" that drives the development of the network. Among them, JavaScript is different from other programming languages because it is closely connected to this infrastructure.
Scripting languages make sense for solving many server-side problems, allowing business logic to be written faster and cheaper, but most of the code being written is not limited by computation, but by productivity - speed of writing and developers monetary cost.
Scripting languages (Python, Ruby, Lua, Shell, Perl, Smalltalk, JavaScript) are very similar, with differences in syntax and API, but few other comparisons. At this point, I believe that everyone who has worked in Rust or C can understand the feeling of scripting languages.
Ryan Dahl concluded that scripting languages are useful, but they are all pretty much the same, with "JavaScript being much more widely used and future proof. So it makes sense to think of JavaScript as a general purpose scripting language".
High-level container for server software: JavaScript sandbox
The sandbox in Javascript is not a sandbox in the traditional sense, it is a syntactic hack, which refers to a closure in Javascript that handles module dependencies.
The "container" of the JavaScript sandbox itself is not intended to solve the problems that Linux containers are aimed at, it is a result of its simplicity - minimizing boilerplate for web service business logic, sharing concepts with browsers, and reducing programming Concepts that programmers need to know (like when writing web services, most likely any systemd configuration is just unnecessary boilerplate).
When it comes to the JavaScript browser API, I believe every web developer knows that because the JavaScript container abstraction is built on the same browser API, the total amount of experience developers need is reduced, which is precisely because the versatility of Javascript reduces its complexity. sex.
In this new server abstraction layer, JavaScript replaces the Shell and is more suitable for scripting than Bash/Zsh. The JavaScript sandbox can call Wasm instead of calling Linux executables like a shell.
Overview
It is undeniable that JavaScript is a general-purpose scripting language, and it is because of the ubiquity of JavaScript that a new container-like abstraction is emerging - the JavaScript container, which simplifies the server.
The advent of JavaScript containers does not mean that Linux containers are "dying", this level of abstraction is always useful. Especially for developers who write a lot of "business logic", when you build a website, perhaps most "web services" can be simplified by using JavaScript containers instead of Linux containers.
Currently, in an attempt to radically simplify server abstractions, and to further explore these ideas, JavaScript containers may be a "pioneer" practitioner. Do you feel the same way? Welcome to leave a message in the comment area to interact.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。