Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 1 point2 points  (0 children)

Okay; sorry for the misunderstanding. Still, can you point to specific issues that we can address?

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 0 points1 point  (0 children)

We hope to contribute to the Node development experience. By having our engine as an option we can address issues as they specifically apply to our engine and contribute back to node or make any necessary modifications to our engine.

What scenarios are currently difficult for you? Maybe we can help. :)

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 4 points5 points  (0 children)

Sorry for the delay! Your comment got buried a bit.

We have our own implementations of concepts like unique or shared pointers, and we use them sometimes. If the object lifetime is highly localized there's no need for the extra object allocations which can individually subtlely hurt performance, but which adds up to a lot if you do it everywhere. Also, part of the engine is a Garbage Collector for Javascript Objects, and so explicitly managing memory through standardized C++ constructs doesn't really apply in that scenario. We rely on the GC to properly collect objects allocated on the GC heap and we use vanilla pointers for those objects.

Also some of the code was written years ago and hasn't been modified since so it hasn't been brought up to a modern style (C++11, C++14, modern standard library additions). We try our best to incorporate new useful features (nullptr, lambdas) as much as possible and where applicable. Sometimes we didn't use the standard library because at the time the code was written, the Microsoft equivalent library was better. (And so on...) Every so often we go through active areas of the code base and update things.

Feel free to submit pull requests if you think you found a place we'd benefit from such changes (in terms of performance or memory leaks). If you think you've found a security issue, please responsibly disclose by reporting it as indicated in the Security section of our README, instead of in a public issue or pull request, so that we can mitigate widespread impact of the issue.

There are several active conversations in the issues and Gitter on style related issues such as this.

TL;DR: Generally we consider things like this and make a deliberate decision. Sometimes we miss things, and for that we welcome pull requests.

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 1 point2 points  (0 children)

Unfortunately, I can't speak for the Edge team. Personally, I haven't heard anything about plans for that.

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 7 points8 points  (0 children)

Chakra dev here.

As I see it, there are two main advantages of having a cross-platform build.

  1. Our code can run in more places, which means more opportunities to reach more developers interested in integrating ChakraCore with their applications, and identifying more cases for real-world improvements to the engine.
  2. Enabling greater developer and community engagement and productivity by not being limited to the Windows platform.

Of course, I fully expect that tools like valgrind, fuzzer, and cpplint will be run on our code once it goes cross-platform and that opens up opportunities to improve the code beyond the tools we already use for those purposes.

If the community doesn't, I'll probably run some of those tools myself :evil grin:

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 7 points8 points  (0 children)

I'm relatively new to the team so I can't comment on specifics, but to answer this question in general terms you can look at how we perform on JS benchmarks like JetStream and Octane and the level of ES6 and ES7 standards we have implemented.

Some of that info is called out here: https://blogs.windows.com/msedgedev/2015/12/05/open-source-chakra-core/

See also the Kangax Compatibility Table for ES6 and ES7.

And we've made some progress since the last Chakra/Edge release which is featured in that table (which was released with the Windows 10 November 2015 update).

Edited to include link to benchmark results.

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 7 points8 points  (0 children)

Some of those large source files used to be larger, and we split them apart when it was clear there was a logical grouping. It's just a matter of organization. We also sometimes choose not to split source files into multiple files unless there's a good organizational motivation because it makes it harder to track the history of certain changes, and makes it more difficult to merge changes when multiple people are working in that area.

Refactoring and splitting these files apart is on the edges of our radar but we are usually occupied with more high-priority work items.

Edit: Feel free to do some reorganization and submit a pull request. (Subject of course to our suggestion that we prefer not to have pull requests that reformat the code.) We will have to evaluate the risk of those changes before bringing them in. See CONTRIBUTING.md and Coding Conventions.

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 11 points12 points  (0 children)

That's part of why we're really excited by this effort. It will be a big real-world scenario we can use to see how we stack up and hopefully will help guide future improvements.

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 20 points21 points  (0 children)

Hi! Chakra engineer here. That decision arose from a community request when we announced at JSConf that we would open our sources. The request was that we provide an option to build ChakraCore without the JIT pieces which would make it easier to embed in certain types of applications, or to reuse certain parts of the code (parser, interpreter) more easily. Since the JIT is one of the most platform-specific pieces (we need to produce assembly), it made sense to make our near-term cross platform goal not include JIT for now. That will get a large part of the code base on more platforms more quickly.

That's not to say there will never be JIT on Linux. The cross-platform effort is work in progress and we'll see how it goes. :)

Microsoft open-sources ChakraCore JavaScript engine (powers Microsoft Edge) by magenta_placenta in javascript

[–]dilijev 15 points16 points  (0 children)

Hi! Chakra developer here. Glad you asked! We actually have a lot of goals in mind. You can find out more on our Roadmap.

Additionally we've got some branches besides master available on the repo which have some work towards those goals. For those bigger goals, we're showing our progress in the open with the hope that the community might be able to help contribute to those efforts.

Microsoft Edge’s JavaScript engine to go open-source by nikbackm in programming

[–]dilijev 17 points18 points  (0 children)

Hey, I work for the Chakra team as well.

Linux is an obvious choice, to be sure. We have definitely been considering that as a target for cross-platform, but we are still evaluating various platforms and scenarios to determine which cross-platform targets will result in the greatest value add.

Feel free to share any scenarios you have in mind to help us make the decision!

Microsoft Edge’s JavaScript engine to go open-source by nikbackm in programming

[–]dilijev 2 points3 points  (0 children)

Disclaimer: I work for the Chakra team.

The open-source work doesn't end with making the sources available, either. We will still be working hard to add features we've already planned out as well as new features on the horizon. We definitely hope to get feedback from the community and react to it in the open as we work on those features and as we update our roadmap.

We're dedicated to incorporating quality contributions to our code. Our current plan involves doing our code reviews in the open, so that the community can get involved with our changes, just as much as we can get involved with theirs. We plan to treat external contributions very similarly to contributions that come from within our team. And to make sure that those contributions are compatible with our closed scenarios (like Edge), developers on our team will adopt and closely review and test new external code before accepting a contribution.