Embedthis Ejscript™

ejs

Ejscript is archived and no longer supported or maintained

Ejscript is an integrated JavaScript environment suitable for education purposeswhen studying compilers, language parsers, virtual machines and JavaScript.

Ejscript doesn't force you to use async-programming, unless you want to. Ejscript gives you freedom to choose the best and most natural design paradigm for your application. Ejscript uses an event-driven, non-blocking design so it can effortlessly run async applications. Ejscript couples this with a scalable multithreaded core so it can also run sync applications that need to block without callbacks.

Overview

Ejscript supports JavaScript ES6 with classes, modules, fat arrow functions, simplified object literals. But it goes much further and has an extensive system library and catalog of third-party extension modules.

The Ejscript Web Framework provides a complete environment for high-performance web applications. It is a Model-View-Controller web framework with integrated SQLite database and Object Relational Mapper (ORM). It has a library of data-binding Ajax view controls and includes jQuery for client side integration.

Ejscript is fast, compact and is optimized for server-side web applications. A direct-threaded VM and generational garbage collector provide fast runtime execution. A high-level system library of native classes provides C speeds for library methods and an in-memory web server module ensures rapid response for web requests.

Benefits

Features

Ejscript has the features and flexibility to meet the most demanding web and embedded application needs. It can run stand-alone as a language interpreter, or it can be embedded into an existing application.

Ejscript has the following features:

See the Ejscript Feature List for an extended list of capabilities.

Standards

Ejscript fully supports and complies with the standardized version of JavaScript known as ECMAScript Edition 3 (ECMA-262-3). Ejscript also implements the ECMAScript E4X for XML (ECMA-357) specification.

The Ejscript development community is also participating in the various JavaScript standards efforts including:

Ejscript enhances standard JavaScript with the addition of a comprehensive web framework and language extensions such as modules and classes.

Ejscript Design

The goal of Ejscript is to create a standards-based JavaScript environment that excels at hosting server-side JavaScript web applications. Web applications typically require compact and efficient memory utilization and modest CPU requirements. For embedded applications, this is because of device constraints. For enterprise applications, the necessity to scale requires that web frameworks are highly efficient in memory use.

However, most existing JavaScript implementations are designed for use inside a browser on the PC desktop. They have large memory footprints, typically more than 4MB and often larger than 64MB — not ideal for running server-side and hosting web applications or running in embedded applications.

By contrast, Ejscript, requires from 400K of code and has minimal memory requirements to execute (from 600K). To do this, Ejscript sheds browser baggage and prioritizes design trade-offs toward memory efficiency.

Why Enhance JavaScript?

JavaScript is now one of the most popular programming languages in the world. However, JavaScript was written many years ago during the height of the browser wars. It was written in a hurry and under corporate pressure. As a result, the language has some glaring weaknesses that impact the security of programs and the programming experience of users — especially when used for server-side JavaScript web applications.

Some of the more major issues are:

Ejscript corrects these issues with a set of extensions to the JavaScript language and environment that make Ejscript ideal for server-side web applications.

Ejscript Language Enhancements

Ejscript adds the following language enhancements:

You can choose to take advantage of the enhancements offered by Ejscript for a more secure, scalable and pleasant programming experience or you can can use it in strict ECMAScript compliant mode and utilize only standard features.

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 empower widget-style applications.

Licensing

Ejscript software products are available with either an Open Source or Commercial license. Our 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.

Commercial Licenses

Embedthis provides commercial licenses and support. See https://www.embedthis.com for details.

© Embedthis Software. All rights reserved.