문제

Anybody has experience with the upcoming IE9 Chakra engine? I am currently considering whether to incorporate the Microsoft's JScript engine through the Window Script Interface or using one of those open source javascript engines (tracemonkey/v8 etc).

The JScript engine is a bit too slow and Chakra looks promising. But I am not sure if it will be accessible the same way as before since Active Scripting should be deprecated.

Anybody get some idea?

도움이 되었습니까?

해결책

I'm not aware that ActiveScripting is deprecated - I've seen no statement from Microsoft along those lines.

Microsoft's documentation suggests that IE9's Javascript engine (code-named "chakra") still gets loaded by IActiveScript. Though MS does not document a ProgId or CLSID, there is a CLSID you can use:

{16d51579-a30b-4c8b-a276-0ff4dc41e755}

The C# code to load the Chakra scripting engine looks like this:

    var guid = new System.Guid("{16d51579-a30b-4c8b-a276-0ff4dc41e755}");
    Type engineType = Type.GetTypeFromCLSID(guid, true);
    var engine = Activator.CreateInstance(engineType) as IActiveScript;

In my limited tests in various micro-benchmarks, Chakra is about 2x the speed of JScript v5.8.

See also:
What is the ProgId or CLSID for IE9's Javascript engine (code-named "Chakra")

다른 팁

You may be interested in checking this out too: JavaScript Runtime Hosting

It's not ActiveScript but it gives you very low level access to Chakra in a very nice new API.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top