JScript .NET
   HOME

TheInfoList



OR:

JScript .NET is a .NET
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
developed by
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washing ...
. The primary differences between
JScript JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer 11 and older. JScript is implemented as an Active Scripting engine. This means that it can be "plugged in" to OLE Automation applicati ...
and JScript .NET can be summarized as follows: Firstly, JScript is a
script Script may refer to: Writing systems * Script, a distinctive writing system, based on a repertoire of specific elements or symbols, or that repertoire * Script (styles of handwriting) ** Script typeface, a typeface with characteristics of handw ...
ing language, and as such programs (or more suggestively,
script Script may refer to: Writing systems * Script, a distinctive writing system, based on a repertoire of specific elements or symbols, or that repertoire * Script (styles of handwriting) ** Script typeface, a typeface with characteristics of handw ...
s) can be executed without the need to compile the code first. This is not the case with the JScript .NET command-line compiler, since this next-generation version relies on the .NET
Common Language Runtime The Common Language Runtime (CLR), the virtual machine component of Microsoft .NET Framework, manages the execution of .NET programs. Just-in-time compilation converts the managed code (compiled intermediate language code) into machine instructio ...
(CLR) for execution, which requires that the code be compiled to
Common Intermediate Language Common Intermediate Language (CIL), formerly called Microsoft Intermediate Language (MSIL) or Intermediate Language (IL), is the intermediate language binary instruction set defined within the Common Language Infrastructure (CLI) specification. ...
(CIL), formerly called Microsoft Intermediate Language (MSIL), code before it can be run. Nevertheless, JScript .NET still provides full support for interpreting code at runtime (e.g., via the Function constructor or the
eval In some programming languages, eval , short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had b ...
function) and indeed the interpreter can be exposed by custom applications hosting the JScript .NET engine via the VSA interfaces. Secondly, JScript has a strong foundation in Microsoft's
ActiveX ActiveX is a deprecated software framework created by Microsoft that adapts its earlier Component Object Model (COM) and Object Linking and Embedding (OLE) technologies for content downloaded from a network, particularly from the World Wide Web. ...
/
COM Com or COM may refer to: Computing * COM (hardware interface), a serial port interface on IBM PC-compatible computers * COM file, or .com file, short for "command", a file extension for an executable file in MS-DOS * .com, an Internet top-level d ...
technologies, and relies primarily on ActiveX components to provide much of its functionality (including database access via ADO, file handling, etc.), whereas JScript .NET uses the
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
to provide equivalent functionality. For backwards-compatibility (or for where no .NET equivalent library exists), JScript .NET still provides full access to ActiveX objects via .NET /
COM Interop Com or COM may refer to: Computing * COM (hardware interface), a serial port interface on IBM PC-compatible computers * COM file, or .com file, short for "command", a file extension for an executable file in MS-DOS * .com, an Internet top-level d ...
using both the ActiveXObject constructor and the standard methods of the .NET Type class. Although the .NET Framework and .NET languages such as C# and
Visual Basic .NET Visual Basic, originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visua ...
have seen widespread adoption, JScript .NET has never received much attention, by the media or by developers. It is not supported in Microsoft's premier development tool,
Visual Studio .NET Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platfor ...
. However,
ASP.NET ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. The name s ...
supports JScript .NET.


Language differences

The following are prime examples of language differences between JScript .NET and other .NET languages, including comparisons.


Differences with C#

* JScript .NET does not require a main()
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
that the operating system must call directly when executing a JScript .NET application, as such, JScript .NET program flow can be based on global code. * JScript .NET, because of its very loose type checking system can be very easy to learn, since the convention of explicit type declaration is not required at all. * JScript .NET does not require explicit references to the .NET Framework Base Class Library, as certain functions found in earlier versions of JScript are present in JScript .NET (e.g. functions for finding the
tangent In geometry, the tangent line (or simply tangent) to a plane curve at a given point is the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points on the curve. More ...
of an angle for a
right triangle A right triangle (American English) or right-angled triangle (British), or more formally an orthogonal triangle, formerly called a rectangled triangle ( grc, ὀρθόσγωνία, lit=upright angle), is a triangle in which one angle is a right an ...
). * JScript .NET is closely linked to
C syntax C, or c, is the third letter in the Latin alphabet, used in the modern English alphabet, the alphabets of other western European languages and others worldwide. Its name in English is ''cee'' (pronounced ), plural ''cees''. History "C" ...
, and is thus very easy to learn for C#,
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
or
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
developers. * While JScript .NET can be used to create Windows Forms applications, JScript .NET will have some trouble, as delegates can only be consumed in JScript .NET and not created. Thus, custom events are hard to emulate in JScript .NET.


Differences with C++

* JScript .NET does not require a main()
function Function or functionality may refer to: Computing * Function key, a type of key on computer keyboards * Function model, a structured representation of processes in a system * Function object or functor or functionoid, a concept of object-oriente ...
. * JScript .NET does not require explicit
type declaration In computer programming, a declaration is a language construct specifying identifier properties: it declares a word's (identifier's) meaning."A declaration specifies the interpretation and attributes of a set of identifiers. A ''definition'' of a ...
on variables. (In
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
, the use of templates and generics can be compared to this, loosely emulated with template specialization, etc.) * JScript .NET also does not require explicit type casts on variable use in the program. Code used to retrieve a string of characters, but only used for integer numbers can be cast implicitly; the vice versa can be done without error at compile time, but there is a chance of loss of precision or data. e.g.: import System; Console.WriteLine("Hello, what's your name?"); Console.WriteLine("Type your name: "); var _name = Console.ReadLine(); Console.WriteLine("Hello, " + _name);


Differences with Java

* JScript .NET syntax and
lexical conventions Lexical may refer to: Linguistics * Lexical corpus or lexis, a complete set of all words in a language * Lexical item, a basic unit of lexicographical classification * Lexicon, the vocabulary of a person, language, or branch of knowledge * Lexical ...
are similar to
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
in that both are derived from C. JScript was originally Microsoft's implementation of
ECMAScript ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262 ECMAScript is commonly used for client-side scripting o ...
, which is more commonly known as
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
, though it is unrelated to Java. Thus, users of Java and other C-derived languages will find JScript easier to learn. * JScript .NET allows developers to use untyped variables, and can sometimes infer their type from their usage to optimize the compiled code. On the other hand, Java requires all variables to be typed. * JScript .NET can add properties and methods to objects in run-time, while Java objects always conform to their declared interface. * JScript .NET supports
global variables In computer programming, a global variable is a variable with global scope, meaning that it is visible (hence accessible) throughout the program, unless shadowed. The set of all global variables is known as the ''global environment'' or ''global s ...
, something Java does not.


Differences with older versions of JScript

* JScript .NET allows developers to declare variables and functions with type information (e.g., var x : String;), while type information for JScript's variables and functions can not be declared (e.g., var x;). * JScript .NET scripts are not interpreted, but executed independently. When executed, a JScript .NET application will invoke the
CLR CLR may refer to: * Calcium Lime Rust, a household cleaning-product * California Law Review, a publication by the UC Berkeley School of Law * Tube_bending, Centerline Radius, a term in the tubing industry used to describe the radius of a bend * Cen ...
. The CLR will execute the CIL instructions without using an interpreter. * JScript .NET can be run without the presence of a browser or another
scripting engine A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
as the compiler can generate standalone
executable In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), instructi ...
s and assemblies. However these still require
.NET Framework The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
to be installed in order to run. * JScript .NET provides access to the .NET Framework BCL (
Base Class Library The Standard Libraries is a set of libraries included in the Common Language Infrastructure (CLI) in order to encapsulate many common functions, such as file reading and writing, XML document manipulation, exception handling, application globa ...
), providing much more functionality. * JScript .NET is only available as a scripting language for
ASP.NET ASP.NET is an open-source, server-side web-application framework designed for web development to produce dynamic web pages. It was developed by Microsoft to allow programmers to build dynamic web sites, applications and services. The name s ...
, the technology used to generate web pages; thus, JScript .NET takes a similar role to
PHP PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group ...
and other server-side scripting languages. Internet Explorer, however, is still using only the older JScript engine, so JScript.NET cannot be used to script web pages (or HTAs or HTCs). In this regard, JScript is much more versatile than JScript .NET.


See also

* JavaScript OSA – A system-level scripting language for the
Apple Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and software en ...
*
JScript JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer 11 and older. JScript is implemented as an Active Scripting engine. This means that it can be "plugged in" to OLE Automation applicati ...
*
ActionScript ActionScript is an object-oriented programming language originally developed by Macromedia Inc. (later acquired by Adobe). It is influenced by HyperTalk, the scripting language for HyperCard. It is now an implementation of ECMAScript (meaning i ...


Notes


References


Getting Started With JScript .NET

Introducing JScript .NET


{{DEFAULTSORT:Jscript .Net .NET programming languages JavaScript programming language family Object-based programming languages