JScript .NET
   HOME

TheInfoList



OR:

JScript .NET is a
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
developed by
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
. The primary differences between
JScript JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer web browser and HTML Applications, and as a standalone Windows scripting language. JScript is implemented as an Active Scripting eng ...
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 instr ...
(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 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 been incl ...
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 W ...
/ COM 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 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 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 (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language developed by Microsoft and implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the ...
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. However,
ASP.NET ASP.NET is a 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 stands for Ac ...
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-orie ...
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, intuitively, the straight line that "just touches" the curve at that point. Leibniz defined it as the line through a pair of infinitely close points o ...
of an angle for a
right triangle A right triangle or right-angled triangle, sometimes called an orthogonal triangle or rectangular triangle, is a triangle in which two sides are perpendicular, forming a right angle ( turn or 90 degrees). The side opposite to the right angle i ...
). * JScript .NET is closely linked to
C syntax The syntax of the C programming language is the set of rules governing writing of software in C. It is designed to allow for programs that are extremely terse, have a close relationship with the resulting object code, and yet provide relatively ...
, and is thus very easy to learn for C#,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
or C++ 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-orie ...
. * JScript .NET does not require explicit type declaration on variables. (In C++, 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 are similar to
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
in that both are derived from C. JScript was originally Microsoft's implementation of
ECMAScript ECMAScript (; ES) is a standard for scripting languages, including JavaScript, JScript, and ActionScript. It is best known as a JavaScript standard intended to ensure the interoperability of web pages across different web browsers. It is stan ...
, which is more commonly known as
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
, 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 ...
, 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. 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 as the compiler can generate standalone
executable In computer science, 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), in ...
s and assemblies. However these still require .NET Framework to be installed in order to run. * JScript .NET provides access to the .NET Framework BCL (
Base Class Library The Standard Libraries are 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 a 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 stands for Ac ...
, the technology used to generate web pages; thus, JScript .NET takes a similar role to
PHP PHP is a general-purpose scripting language geared towards 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 JavaScript OSA, (originally ''JavaScript for OSA'', abbreviated as ''JSOSA''), is a freeware inter-process communication scripting language for the Macintosh computer. JavaScript OSA uses the "core language" of the Mozilla implementation of the Ja ...
 – A system-level scripting language for the
Apple Macintosh Mac is a brand of personal computers designed and marketed by Apple Inc., Apple since 1984. The name is short for Macintosh (its official name until 1999), a reference to the McIntosh (apple), McIntosh apple. The current product lineup inclu ...
*
JScript JScript is Microsoft's legacy dialect of the ECMAScript standard that is used in Microsoft's Internet Explorer web browser and HTML Applications, and as a standalone Windows scripting language. JScript is implemented as an Active Scripting eng ...
*
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 (mean ...


Notes


References


Getting Started With JScript .NET

Introducing JScript .NET


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