r/javascript • • Jan 13 '16

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge)

https://github.com/Microsoft/ChakraCore
337 Upvotes

106 comments sorted by

View all comments

94

u/bterlson_ @bterlson Jan 13 '16

If anyone has any questions, I and many members of the Chakra team are around today!

8

u/talmobi Jan 13 '16

I assume you've extensively looked at V8 and SpiderMonkey. How would you say Chakra differs? Better documentation? Faster in X? Slower in Y? Overall pros cons? Thank you.

10

u/bterlson_ @bterlson Jan 13 '16

Many differences of course, but whether they matter (or are better or worse) depends on what your requirements are. Performance is better in many aspects. Great language support (most of ES6, bunch of ES7). JSRT APIs are pretty nice as well. If you've got something more specific in mind I could talk to it.

4

u/talmobi Jan 13 '16

What are the implementation of arrays in Chakra and their use cases? Does the implementation differ significantly from the others?

10

u/bterlson_ @bterlson Jan 13 '16

Oh man this is actually a huge area. Arrays are extremely commonly used and also very perf sensitive so we have many representations and optimizations in play. Hard to describe concisely. Maybe a good topic for a blog? That said I would bet given that all the runtimes have similar constraints we all use similar representations and optimizations.

3

u/compteNumero9 Jan 14 '16

Array and object optimizations would definitely be good topics for blogs, especially if coming with insightful and explained performance advises.

How a different implementation might change how we code (today mostly assuming V8) would be very interesting.

Some precision about typed arrays (for example the Uint8ClampedArray used for canvas data manipulation) would also fit.

6

u/brandf Jan 14 '16

Having used V8, JSC, and Chakra to power our app on various platforms, I'd like to call out Chakra as being both easy to integrate into your app (particularly using WinRT class bindings), and easy to debug (unlike v8 which requires jumping through hoops if you're not chromium).

Good work guys! Glad to see it open sourced.

2

u/bterlson_ @bterlson Jan 14 '16

Really happy to hear this! Feel free to reach out if you find less good things :)

2

u/nschubach Jan 14 '16

How's that WinRT work in Linux? ;)

0

u/brandf Jan 14 '16

ChakraCore doesn't actually have the WinRT binding stuff, I was using JSRT (full chakra on windows). Doesn't really matter because our app supports multiple JS backends and we only use Chakra on Windows.

On Linux (which we don't have plans on supporting outside the browser) we would likely go V8 to get JIT right now, which would be more of a pain for us in a number of ways.

2

u/bterlson_ @bterlson Jan 14 '16

ChakraCore has JSRT! ch.exe (our console host) is implemented using it. But you're right that we don't have the WinRT (UWA API?) projection layer as part of ChakraCore.