DMDScript

What is DMDScript?

DMDScript is Digital Mars' implementation of the ECMA 262 scripting language. Netscape's implementation is called JavaScript, Microsoft's implementation is called JScript. DMDScript is a very fast compared with other implementations, which you can verify with the included benchmark.

DMDScript is implemented in the D Programming Language. (A C++ implementation is also available.)

Note: DMDScript is not the D Programming Language, nor is it Java.

Here is the ECMAscript FAQ.

Key Benefits of DMDScript in D

Implementation of ECMA 262 v3.

Ideal for ECMAscript enabling browsers, email clients, and any application that needs a scripting language.

Source code is available under the Boost license.

Installing DMDScript

Standalone Console Version of DMDScript

ds

test.ds

ds sieve

sieve.ds

.ds

Download DMDScript with no arguments will compile and run the dscript file. With an argument, it will compile & run that file:will compile and run. Theis the default extension.

The console version has some additional builtin functions available:

getenv(string) Get and return value of environment variable string. print(string) Print string to stdout. println(string) Print string to stdout followed by a newline. readln() Read and return an input line from stdin, not including the newline.

Differences Between DMDScript (Digital Mars), Jscript (Microsoft) and Javascript (Netscape)

goto Statement

goto label;

goto

assert() Function

__proto__ Property

Conditional Compilation

DMDScript implements thestatement, like in C.is not part of the ECMA 262 v3 standard.DMDScript implements the assert() function property of the Global Object. assert() throws a RuntimeError exception. If there is an argument to assert(), that argument is converted to a Boolean and a RuntimeError exception is thrown if the argument is false.Javascript supports the __proto__ property. Neither ECMA nor Jscript nor DMDScript supports it.

JScript's conditional compilation statements are not supported by DMDScript, Javascript, nor ECMA.

This article is translated to Serbo-Croatian language by Web Geeks.

This article is translated to Punjabi by Bydiscountcodes Team.