1.21 gigawatts
1.21 gigawatts

Reputation: 17770

If Tamarin is running in Mozilla Firefox is it possible to run ES4 code?

If Tamarin, the virtual machine that can run JavaScript v4 is built into Mozilla Firefox, is it possible to run ES4 in the browser? I'm tired of JS v1 and tired of ES6. I would like AS3/ES4 (it is fully featured and farther along than ES6).

Read this to understand why I'd like to run AS3 in the browser.

More info on Tamarin.
More info on Tamarin.
More info on Tamarin.
More info on EcmaScript.
More info on ActionScript3 (based on ES3 and ES4).
More info on ActionScript 3 Language Reference.

Upvotes: 1

Views: 90

Answers (2)

Estus Flask
Estus Flask

Reputation: 222528

The premise is wrong, Tamarin doesn't run in Mozilla Firefox. As this article states,

The only part of Tamarin used in modern Mozilla applications (i.e. Firefox 3.5+) via SpiderMonkey is NanoJIT, a module that is used to generate native code when performing just-in-time compilation.

ECMAScript 4 specification was abandoned, so there's no support for it in browsers.

If ES6 doesn't cover all expected ES4 features (e.g. it doesn't provide type checking), the possible alternatives are TypeScript and Dart. TypeScript is basically ES2018 with type checks and several own features, it doesn't require a developer to learn a new language. Neither of them can run natively in browsers, but Dart has Dartium to run the code in VM and skip transpilation step.

Upvotes: 1

Quentin
Quentin

Reputation: 943645

If Tamarin, the virtual machine that can run JavaScript v4 is built into Mozilla Firefox

It isn't. See the Wikipedia page you linked to:

There were plans to use Tamarin as part of Mozilla 2[7] (and therefore Firefox 4).

and

it has not replaced SpiderMonkey as the JavaScript engine of Mozilla applications


Is it possible to run ES4 in the browser?

No. ES4 was abandoned.

Some features were adopted into Harmony and have made it into newer versions of ES.

Upvotes: 1

Related Questions