Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can JScript.NET be used to script a .NET application?

Tags:

People also ask

Is JScript the same as JavaScript?

A lot of people think that JScript and JavaScript are different but similar languages. That's not the case. They are just different names for the same language, and the reason the names are different was to get around trademark issues.

Can I use JavaScript in .NET framework?

Yes, there are several JS engines which you can use. Jurassic, Jint and IronJS are . NET-based, but you can also interface to others such as the V8 from the Chrome browser or the ActiveScript from IE.


Since MS appears to have killed Managed JavaScript in the latest DLR for both server-side (ASP.NET Futures) and client-side (Silverlight), has anyone successfully used non-obsolete APIs to allow scripting of their application objects with JScript.NET and/or can explain how to do so? A Mono/JScript solution might also be acceptable, if it is stable and meets the requriements below.

We are interested in upgrading off of a script host which uses the Microsoft JScript engine and ActiveScript APIs to something with more performance and easier extensibility. We have over 16,000 server-side scripts weighing in at over 42MB of source, so rewriting into another scripting language is out of the question.

Our specific requirements are:

  • Noteably better performance than the Microsoft JScript (ActiveScript) engine
    • Better runtime performance and/or
    • Retention of pre-parsed or compiled scripts (don't reparse on every run)
    • Lower or equal memory consumption
  • Full ECMA-262 ECMAScript compatibility
    • a little porting can be tolerated
  • Injection of custom objects into the script namespace
    • .NET objects (not a hard requirement)
    • COM objects or COM objects wrapped in .NET
  • Instantiation of COM objects from Script
    • à la "new ActiveXObject(progid)"
    • Low priority given the preceeding
  • Include files
    • Pre-loading of "helper scripts" into a script execution context
    • An "include" function or statement (easy to create, given the above)
  • Support for code at global-scope
    • Execution of code the global scope
    • Retention of values initialized at global scope
    • Extraction of values from the global scope
    • Injection and replacement of values at the global scope
  • Calling of script-defined functions
    • with parameters
    • and with access to the previously initialized global scope
  • Source-level debugging
  • Commercial or Open Source Support
  • Non-obsolete APIs