BT

Windows 10 uses Chakra to Provide JavaScript For All Applications

| by Jeff Martin Follow 16 Followers on May 29, 2015. Estimated reading time: 1 minute |

Microsoft is expanding the use of its Chakra JavaScript engine in Windows 10, giving developers the ability to use new APIs with their applications.  Named JavaScript Runtime (JSRT) APIs, they originally debuted in Windows 8.1 but focused on server-side functionality.  In Windows 10 these APIs won't be limited to server-side projects and instead can be used in both classic Win32 applications or the Universal Windows Applications.

These APIs are being offered with several additional customization options.  For long-running or frequently used programs, developers can utilize JsSerializeScript to serialize their code prior to execution.  This allows it to be cached and improve startup speed if needed.

Since the inclusion of the JavaScript engine in an application would by design allow users to insert their own code, application developers need ways to limit the resources consumed by these scripts to prevent rogue scripts from causing performance problems.  The JSRT APIs provide the ability to limit these script’s memory and CPU utilization. 

Since Microsoft intends to continuously update their new Edge web browser, they need a way to update its associated Chakra JavaScript engine without disrupting legacy applications that may rely on older features.  Chakra accomplishes this by being split into two versions.  The current (legacy) Chakra engine is contained in jscript9.dll while the new Chakra engine (found in Windows 10) is contained in chakra.dll.  Developers can choose which DLL to target based on their needs.  Machines running Internet Explorer 11 can use apps targeting jscript9.dll providing a separate option for applications that have yet to migrate to Windows 10.

Microsoft summarized the criteria to guide the decision of what library to use as follows:

  • If you need to emphasize backward compatibility of your existing applications, target the legacy engine.
  • If you want your app to be forward looking and support new JavaScript features as they are released (for example, ECMAScript 6), target the Edge engine.

Besides ECMAScript 6 support, targeting the latest DLL will also make for a simplified debugging experience in Visual Studio.  To experiment with the new Chakra and Windows 10, visit Microsoft’s Windows 10 developer tools page.  Some initial Chakra samples are provided on GitHub.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT