James Hugard
James Hugard

Reputation: 3236

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

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:

Upvotes: 8

Views: 2535

Answers (7)

Sebastian
Sebastian

Reputation: 6493

The Jurrassic-Engine is alive and kicking.

From their codeplex site:

  • Supports all ECMAScript 3 and ECMAScript 5 functionality, including ES5 strict mode
  • Well tested - passes over five thousand unit tests (with over thirty thousand asserts)
  • Simple yet powerful API
  • Compiles JavaScript into .NET bytecode (CIL); not an interpreter
  • Deployed as a single .NET assembly (no native code)
  • Basic support for integrated debugging within Visual Studio
  • Uses light-weight code generation, so generated code is fully garbage collected
  • Tested on .NET 3.5, .NET 4 and Silverlight

Upvotes: 0

George Birbilis
George Birbilis

Reputation: 2930

Have you seen ROScript? http://www.remobjects.com/script.aspx

Supports both PascalScript and ECMAScript (Javascript) syntax

Upvotes: 0

user29439
user29439

Reputation:

I answered a similar question here. Have a look at IronJS, an implementation of JavaScript in F# running on the DLR.

Upvotes: 3

David Robbins
David Robbins

Reputation: 10046

I have used CSScript.net as it will allow you to run C# as a scripting platform. From the site:

CS-Script combines the power and richness of C# and FCL with the flexibility of a scripting system. CS-Script can be useful for system and network administrators, developers and testers. For any one who needs an automation for solving variety of programming tasks.

CS Script satisfies all the conditions that you laid out. I have used it in production as a substitute for Boo it has performed really well. You can see it in action here.

Upvotes: 1

ben
ben

Reputation: 223

The use of Com interop means you are limited to an MS solution Java and Opensource want as little as possible to do with it.

I dont see any solution that supports all your requirements either you ditch all the COM/.NET stuff and go Java (Rhino) /Linux/Open source or you question the use of Javascript as your server language even in the Linux world we use PHP/Python/Ruby more on the server if we cant run Java. Your not going to see big performance gains with Java script as the language is the main barrier.

I wouldnt count on people writing a new DLR as server Java script is dying fast.

Considering you want performance ,what about F# , Microsoft will keep the Jscript engine supported for at least 5 years giving you time to create new stuff in F# while you slowly migrate the code.

Upvotes: 0

thatismatt
thatismatt

Reputation: 9842

If moving away from .NET and Microsoft is ok for you then you should try Mozilla's Rhino. It is an open-source implementation of JavaScript written entirely in Java. Alot of modern server side js libraries target this platform.

Upvotes: 1

Julian Birch
Julian Birch

Reputation: 2758

Sooner or later, I imagine someone will write a DLR Javascript. I know that's not very convenient for you right now, but maybe you could start the project. I suspect it would have a better cost/benefit analysis to using JScript.NET.

Upvotes: 2

Related Questions