All about E: The language that permeates JavaScript

2992ff90 12angrymen e1666203291605


Doug Crockford is best known for his many years of work in JavaScript and the creation of the JSON data interchange format. His opinion tends to be heavily weighted, and Crockford said he said it was time to do away with JavaScript.

In an interview with IT outsourcing firm Evrone, Crockford said, “JavaScript, like other dinosaur languages, is a hindrance to progress.” It should be more like E than JavaScript.”

What is D? Wikipedia calls E “an object-oriented language for securing distributed computing”, and by design, E is security-focused. But to learn more about E’s impact on JavaScript, The New Stack spoke with E’s main designer, Mark Miller. Chip his morning star in the mid-1990s.

“Both Doug and I were very involved in the birth of this language,” says Miller. “We were totally in love with the language we created.”

Miller believes the language itself is dead — an open-source language, E never attracted more than 100 users to its community, he said.

But E didn’t slip into that good night. The influence of E can still be seen in JavaScript today, thanks to the efforts of Miller, Crockford, and other members of the ECMAScript standards committee. In his The New Stack, Miller talks about how E inspired JavaScript, how his company Agoric is still using E’s ideas in his blockchain-powered DeFi, and I explained that I wanted to upcycle additional aspects of E to JavaScript.

12 Angry Men and ECMAScript

“Have you seen the movie 12 angry men? ’ Miller asked me. I answered yes. “I think this movie is the best way to explain what the ECMAScript committee was like when I joined Google.”

Crockford persuaded Miller to join the committee as an additional Google representative in 2007. The committee focused on upgrading from ECMAScript 3 to he ECMAScript 4, but it didn’t work.

“The committee was meeting continuously from 1999 to 2007 at this point and still had no successor standard. Most of the committee was focused on ECMAScript 4, which It was terrible language in my opinion,” said Miller. “Doug was one of the holdouts at first. Henry Fonda’s character said, ‘No, I don’t agree with this.'”

JavaScript was nasty, complex and weird, Crockford to Miller, ECMAScript 3 has the seed of an E-like experience, the core elements that allow it to become a secure distributed programming language like E. I was convinced that I had

“I joined his rebellion against ECMAScript 4, which by then had several other members. 12 angry men — he gradually convinced jurors to come to his camp,” Miller said. In the end, the rebellion won. The successor to ECMAScript 3 became his ECMAScript 5. This was the version Rebel designed, and the rest of the committee focused on his ECMAScript 4.

“The ECMAScript 5 standard had enablers for using JavaScript as an easy, simple and safe programming language. We are very proud of what we have done for ECMAScript 5,” he said. said.

One of the fundamental aspects of E they brought into ECMAScript 5, he said, is support for the Object Functional Security model.

“You can combine JavaScript objects used as records with JavaScript functions to create a pattern that Doug named the objects-as-closures pattern. As of ECMAScript 3, there is no security yet.”

The enablers they brought into ECMAScript 5 let you create SES-shims. SES-shim is a library that brings a safe language state, now called Enhanced JavaScript.


ECMAScript 5 introduced several enablers. The main one is Object.freeze() . Despite its name, Miller says it has nothing to do with immutability. Instead, it tamper-proofs the surface of an object so that clients of the object can only interact with the object according to the object’s explicit behavior, Miller explained. A provider of an object can enter methods into the object that retrieve internal state variables and encapsulate that state so that clients of the object cannot tamper with the object. He added that “frozen” means that the object’s properties can no longer be changed.

“The client can no longer change the shape of the object, so the shape of the object is fixed. The internal state is hidden from the client,” he said. “The object is now something that can only interact according to the object’s design.”

Security issues have been resolved at this stage. In prototype poisoning, any object created in traditional JavaScript is mutable, and anyone who accesses it can destroy it in order to confuse or monitor other parts of the program.

“One of the things you do with freeze and other enablers built into ECMAScript 5 (Object.getOwnPropertyNames() and Object.getPrototypeOf()) is that you can now write something called ‘harden()’. is a transitive freeze that traverses the object graph, performing property traversal and freezing all objects found that any JavaScript program in the same environment, such as Array or Array.prototype , implicitly We could enumerate all the shared objects, all the primitive objects,” Miller said.

I/O type

The SES-shim library repairs primordials and hardens all primordials when first initialized. This makes all implicitly shared objects completely immutable.

“We fixed the committee so that primordials don’t have hidden mutable state or hidden I/O capabilities,” he said.

He added that sharing does not violate isolation, because everything implicitly shared is completely powerless and immutable.

Another key factor was the ability to virtualize all I/O. According to Miller, one of the beautiful and underappreciated aspects of JavaScript is that the language is about computation, not I/O. JavaScript programs express I/O by performing global variable lookups on host-provided objects such as browser “documents” and node “processes”.

These host-provided global variables are not standardized as part of the language standard, but provide all I/O functionality for affecting or sensing the outside world. populated by the host.

“In other words, if you can intervene in global scope lookups, you can fully virtualize all your I/O. You intercept the global scope using scope lookups,” he said.

Enhanced JavaScript is what Agoric still uses today. Agoric writes most of its code in a curated subset of hardened JavaScript called Jessie (a name meant to evoke the combination of JS and E). Jessie highlights Crockford’s objects-as-closures pattern as an alternative to JavaScript’s inheritance mechanism.


Another important aspect of E ported to JavaScript is the promise of non-blocking, which is the first language E has, said Miller. Promises occur in ECMAScript 6, and those Promises are directly based on E promises.

“A promise is an object returned by an asynchronous function. …a promise object provides methods to handle the eventual success or failure of the operation,” explains the MDN web doc. E in a Walnut explains promises in more detail. Basically, in the pre-E promise system, the calling thread would block at some point, waiting for the operation to complete. Just as you don’t wait for someone to complete a project task before starting to work on your own task, E’s non-blocking promise allows you to handle the eventual success or failure of an operation without blocking waits. It is now possible to resolution.

While JavaScript’s promises only provide out-of-the-box local asynchrony, Agoric’s Endo library extends them to also provide E-like distributed object functional security via cryptographic protocols, making JavaScript an E Make it a distributed secure language like

ECMAScript 6 introduced non-blocking promises for E. But ECMAScript 6 also introduced classes, which have at least doubled in size and continue to grow, Miller said. It became more complicated and anathema to both Miller and Crockford. Mr. Crockford left the committee while Mr. Miller remained on. Basically, according to Miller, he thought JavaScript was a lost cause.

Miller still sees potential in JavaScript.

“I don’t see it as a lost cause,” he told New Stack. This allows it to be used as a decentralized secure language like E.”

group Created by sketch.


Source link

What do you think?

Leave a Reply

GIPHY App Key not set. Please check settings

    7d949e9d1dc0ed3fa5deb29f17078d09 M

    More than ever, adoption is an important part of pregnancy support

    1666295237 GettyImages 1173401062

    UI/UX design is not just data. This is also why intuition is important.