Embedthis Embedthis
Embedthis
Embedthis

Ejscript™ Overview

Ejscript is an enhanced implementation of the Javascript language intended for use outside browsers. It is an interpreted, object oriented scripting language that supports classes, objects, interfaces, exceptions, namespaces, iterators, statements, expressions and a powerful suite of data types.

Ejscript is based on the standardized version of Javascript known as ECMAScript Edition 3 (ECMA-262-3) and the emerging ECMAScript Edition 4 (ES4) standard, but it is an enhanced implementation of the language intended for use outside browsers.

Ejscript Design Goals

The Problem with Browsers

We created Ejscript because existing javascript implementations are designed to run inside browsers and are less well suited to running as native applications. Implementations such as SpiderMonkey in Firefox are excellent, but they carry extra weight due to specific browser requirements. These demands fall into 2 categories 1) Integrating with the browser DOM and 2) supporting a vast legacy of web applications that use an extensensive variety of programming exploits. These two forces constrain browser based implementations of Javascript to be larger, slower and more complex than a clean slate implementation can be when running outside a browser.

Free From Legacy

The goal of Ejscript is to create a language based on ECMAScript that is ideally suited for embedded applications running outside the browser, where efficiency of execution is a paramount concern. Most ECMAScript implementations are designed for the PC desktop and the resultant memory footprint is typically more than 2MB and often as larger than 64MB — too large for many embedded applications. Ejscript in contrast, requires approximately ~200K of code and modest memory requirements to execute. Ejscript implements the full functionality of ECMAScript 262, 357 and ECMAScript 4.X. Ejscript sheds browser baggage and focusses its features solely for embedded applications

ECMAScript Edition 4 (ES4)

The Javascript of today's browsers is largely based on the ECMAScript-262 specification and has not been significantly updated in many years. The ECMAScript Edition 4 standards efforts is attempting to rectify this by doing a major upgrade on the language. Borrowing heavily from Adobe's ActionScript 3.0, ES4 adds classes, interfaces, type annotations, iterators, namespaces and upgrades throughout the language. It is a long overdue upgrade.

ECMAScript Edition 4 is backwards compatible with ECMAScript-262. It is syntactically similar to C in some regards, but also draws on many languages including: Python, Scheme, Lisp, C, ActionScript and Java. Edition 4 is a major upgrade, but it retains the soul of its roots and adapts the best current thinking and language design to forge a major new release.

What's New with Ejscript

Ejscript is a complete implementation of ECMAScript Edition 4 with the following characteristics:

  • Embeddable and highly configurable
  • High performance C and Java VMs (Java VM is not published yet)
  • Native code compiler for very fast compilation
  • Very compact high level byte code
  • High performance native class interface
  • Module (units) directive for scalable programming
  • Extensive system class library with classes for Events, Timers, File I/O, Streams, Sockets, HTTP and SSL
  • Significant upgrades for the core system classes: Array, Object, String
  • Generational garbage collector with slab allocators for fast object allocation
  • Symbolic assembler listings
  • Documentation generator tool
  • Eclipse based IDE (Not yet published)
  • Support ROMed programs and XIP
  • Dynamically loadable modules (both scripted and compiled native code)
  • Cross-platform and portable
  • Clean, modular source code and documentation provided

See the Ejscript feature list for an extended list of capabilities.

Legacy Free

Ejscript offers a no-legacy mode wherethe browser specific parts of of current ECMAScript implementations can be eliminated. This results in a more compact, faster implementation suited for embedding in applications and devices outside the browser. Users and OEMs can configure Ejscript using a granular, fine-grained configuration control to select which features and capabilities are built into Ejscript.

Browser Free

ECMAScript has several significant weaknesses that impair robust and secure implemenetations. Unfortunately, due to backwards compatibility with legacy browser applications, this behavior cannot be changed in browser based implementations. Ejscript however, running outside the browser, offers an enhanced-compliance mode where these issues are rectified.

When run in enhanced-compliance mode, Ejscript innovates and fixes these issues. For example, one of these fixes changes the default behavior of variable assignments inside functions. In the ECMA standard, assignments to undeclared variables automatically create global variables which has proven to be problematic. Ejscript changes this behavior to declare such variables as locals instead of as globals by default.

Ejscript can optionally be run in strict ECMA Edition 4 compliant mode, but you lose the benefit of these important improvements.

Ejscript History

Early versions of Ejscript have been used in the Embedthis Appweb embedded web server for years and is now embedded in millions of devices. The new VM based version has also been used in a range of mobile devices to power widget style applications.

Open Source and Free

Open Source Embedded Web ServerEjscript software products are created using an Open Source development model where a community of developers contribute enhancements and fixes. Products are licensed under the GNU GPL open source license and are provided with full source code. Embedthis Software has generously provided infrastructure, developers and funding to make this possible and is also providing commercial support and licenses for Ejscript.

jscript™ Overview

Ejscript is an enhanced implementation of the Javascript language intended for use outside browsers. It is an interpreted, object oriented scripting language that supports classes, objects, interfaces, exceptions, namespaces, iterators, statements, expressions and a powerful suite of data types.

Ejscript is based on the standardized version of Javascript known as ECMAScript Edition 3 (ECMA-262-3) and the emerging ECMAScript Edition 4 (ES4) standard, but it is an enhanced implementation of the language intended for use outside browsers.

Ejscript Design Goals

The Problem with Browsers

We created Ejscript because existing javascript implementations are designed to run inside browsers and are less well suited to running as native applications. Implementations such as SpiderMonkey in Firefox are excellent, but they carry extra weight due to specific browser requirements. These demands fall into 2 categories 1) Integrating with the browser DOM and 2) supporting a vast legacy of web applications that use an extensensive variety of programming exploits. These two forces constrain browser based implementations of Javascript to be larger, slower and more complex than a clean slate implementation can be when running outside a browser.

Free From Legacy

The goal of Ejscript is to create a language based on ECMAScript that is ideally suited for embedded applications running outside the browser, where efficiency of execution is a paramount concern. Most ECMAScript implementations are designed for the PC desktop and the resultant memory footprint is typically more than 2MB and often as larger than 64MB — too large for many embedded applications. Ejscript in contrast, requires approximately ~200K of code and modest memory requirements to execute. Ejscript implements the full functionality of ECMAScript 262, 357 and ECMAScript 4.X. Ejscript sheds browser baggage and focusses its features solely for embedded applications

ECMAScript Edition 4 (ES4)

The Javascript of today's browsers is largely based on the ECMAScript-262 specification and has not been significantly updated in many years. The ECMAScript Edition 4 standards efforts is attempting to rectify this by doing a major upgrade on the language. Borrowing heavily from Adobe's ActionScript 3.0, ES4 adds classes, interfaces, type annotations, iterators, namespaces and upgrades throughout the language. It is a long overdue upgrade.

ECMAScript Edition 4 is backwards compatible with ECMAScript-262. It is syntactically similar to C in some regards, but also draws on many languages including: Python, Scheme, Lisp, C, ActionScript and Java. Edition 4 is a major upgrade, but it retains the soul of its roots and adapts the best current thinking and language design to forge a major new release.

What's New with Ejscript

Ejscript is a complete implementation of ECMAScript Edition 4 with the following characteristics:

  • Embeddable and highly configurable
  • High performance C and Java VMs (Java VM is not published yet)
  • Native code compiler for very fast compilation
  • Very compact high level byte code
  • High performance native class interface
  • Module (units) directive for scalable programming
  • Extensive system class library with classes for Events, Timers, File I/O, Streams, Sockets, HTTP and SSL
  • Significant upgrades for the core system classes: Array, Object, String
  • Generational garbage collector with slab allocators for fast object allocation
  • Symbolic assembler listings
  • Documentation generator tool
  • Eclipse based IDE (Not yet published)
  • Support ROMed programs and XIP
  • Dynamically loadable modules (both scripted and compiled native code)
  • Cross-platform and portable
  • Clean, modular source code and documentation provided

See the Ejscript feature list for an extended list of capabilities.

Legacy Free

Ejscript offers a no-legacy mode wherethe browser specific parts of of current ECMAScript implementations can be eliminated. This results in a more compact, faster implementation suited for embedding in applications and devices outside the browser. Users and OEMs can configure Ejscript using a granular, fine-grained configuration control to select which features and capabilities are built into Ejscript.

Browser Free

ECMAScript has several significant weaknesses that impair robust and secure implemenetations. Unfortunately, due to backwards compatibility with legacy browser applications, this behavior cannot be changed in browser based implementations. Ejscript however, running outside the browser, offers an enhanced-compliance mode where these issues are rectified.

When run in enhanced-compliance mode, Ejscript innovates and fixes these issues. For example, one of these fixes changes the default behavior of variable assignments inside functions. In the ECMA standard, assignments to undeclared variables automatically create global variables which has proven to be problematic. Ejscript changes this behavior to declare such variables as locals instead of as globals by default.

Ejscript can optionally be run in strict ECMA Edition 4 compliant mode, but you lose the benefit of these important improvements.

Ejscript History

Early versions of Ejscript have been used in the Embedthis Appweb embedded web server for years and is now embedded in millions of devices. The new VM based version has also been used in a range of mobile devices to power widget style applications.

Open Source and Free

Open Source Embedded Web ServerEjscript software products are created using an Open Source development model where a community of developers contribute enhancements and fixes. Products are licensed under the GNU GPL open source license and are provided with full source code. Embedthis Software has generously provided infrastructure, developers and funding to make this possible and is also providing commercial support and licenses for Ejscript.

 

© Embedthis Software LLC, 2003-2008. All rights reserved. Privacy Policy and Terms of Use. Updated June 19, 2008.