Amber on .NET

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Amber on .NET

peter.ode
For quite some time, I've been keeping an eye out for a Smalltalk on .NET
Has anybody ventured down this path?
Does anyone see any initial show stopper problems with such an approach, proposed below, to host Amber on .NET?

I'm wondering about the viability of Amber Smalltalk on a Javascript implemented for .NET?

There are several different implementations of Javascript on .NET and some may be viable to support Amber.
Based on my reviews, Jurassic may be most promising.

http://jurassic.codeplex.com/

What is Jurassic?


Jurassic is an implementation of the ECMAScript language and runtime. It aims to provide the best performing and most standards-compliant implementation of JavaScript for .NET. Jurassic is not intended for end-users; instead it is intended to be integrated into .NET programs. If you are the author of a .NET program, you can use Jurassic to compile and execute JavaScript code.

Features

  • 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
And, the following tools would ease the integration with .NET classes...

Intro

I’m developing a helper library for the awesome .Net JavaScript engine Jurassic. This will make it easier to control exactly what .Net classes you want to expose to JavaScript, just add some custom attributes, no need to inherit from ObjectInstance or similar. Types are converted automatically (e.g. a DateTime in C# becomes a Date in JS and Lists/Collections/etc. in C# become Arrays/Objects in JS). You can even expose members of third-party / framework stuff.

I felt the need to clearly define what gets exposed and what not. Although Jurassic has EnableExposedClrTypes, that didn’t give me control over what gets exposed, e.g. I think it would be possible to call any method or do some other nasty stuff from JS via GetType() and some Reflection magic. Also, it still was a bit tedious and the other cool features were missing. :)

Another thing that is important to me, is to write code that can not only be used from JS but also via .Net. That means write code once, use it via .Net or JS, your choice. No need to worry aboutScriptEngine in your code, but if you want it, there’s HasEngineParameter (see Statics). That will be really helpful for some other projects I’m currently working on!

Check out some of the features and examples below (and compare them to the original way). No modifications were made to the Jurassic code, everything is done by the JurassicTools themselves!


Then, there is Javascript.NET, an integration of Google's V8 Javascript VM with .NET

and, IronJS

https://github.com/fholm/IronJS IronJS 

http://stackoverflow.com/questions/7167690/what-is-the-progid-or-clsid-for-ie9s-javascript-engine-code-named-chakra

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.