r/javascript • • Dec 05 '15

Microsoft Edge's JavaScript engine to go open-source

https://blogs.windows.com/msedgedev/2015/12/05/open-source-chakra-core/
317 Upvotes

84 comments sorted by

View all comments

75

u/bterlson_ @bterlson Dec 05 '15

As is becoming traditional at this point, I'm here for questions if anyone has them. I work on Chakra (and, it goes without saying, am realllllly excited about this announcement)!

64

u/[deleted] Dec 05 '15

Would you rather fight a Google-sized GNU, or a hundred GNU-sized Googles?

34

u/bterlson_ @bterlson Dec 05 '15

I don't know how to answer this. When in doubt, use Math.random() I always say.

Edit: this isn't an ama, but do you guys want one? I can try to set one up with the team. No promises of course :)

11

u/splargbarg Dec 05 '15

You might end up with an AMA anyway.

5

u/bterlson_ @bterlson Dec 05 '15

Going that way ;) But I'm just one perspective on a diverse team of badass engineers!

8

u/kenman Dec 06 '15

Please let us know if you intend to hold one, we'll support you however we can (such as an announcement sticky a few days in advance, stickying the AMA itself, etc.).

3

u/PitaJ Dec 06 '15

Awesome!

7

u/cosinezero Dec 05 '15

Do it, yes! Expect some haters, but...

6

u/AMorpork Dec 05 '15

dae microsoft evil

7

u/ivosaurus Dec 05 '15

New question: what RNG does your implementation of Math.random() use?

8

u/bterlson_ @bterlson Dec 05 '15

It's decent quality, if that's what you're asking. I don't know that it has a name per se. One of our devs recently posted more info here.

→ More replies (4)

3

u/franksvalli Dec 05 '15

Ok!

(Math.random() > 0.5) ? 'Google-sized GNU' : 'A hundred GNU-sized Googles';

11

u/bterlson_ @bterlson Dec 05 '15

Using a freshly built copy of ch.exe:

chakracore> type random.js
print((Math.random() > 0.5) ? 'Google-sized GNU' : 'A hundred GNU-sized Googles');

chakracore> Build\VcBuild\bin\x64_test\ch.exe random.js
Google-sized GNU

This is frightening to me.

→ More replies (1)
→ More replies (1)
→ More replies (1)

17

u/zerobugz Dec 05 '15
  1. What are the main reasons behind open sourcing only the core components?

  2. Are there plans to open source the entire Edge browser?

  3. Everything still good with working at MS?

32

u/bterlson_ @bterlson Dec 05 '15

Edge has been getting gradually more and more open as time goes on (opened the roadmap, community feedback via uservoice, opening the code to industry partners). This is another step along that path. Nothing new to share on Edge's OSS plans though!

Everything is great working at MS; my team is phenomenal. Get's better all the time too :)

→ More replies (4)

8

u/[deleted] Dec 05 '15

[removed] — view removed comment

5

u/bterlson_ @bterlson Dec 05 '15

Check out careers.microsoft.com (you can search for Chakra if you're interested in our team :-D) or send me a pm/tweet/email with a bit about yourself and your resume. Your peers would be jealous, probably ;)

→ More replies (2)

7

u/sensitivePornGuy Dec 05 '15

Is Edge's js engine built from scratch, or is it somewhat based on Internet Explorer code?

18

u/bterlson_ @bterlson Dec 05 '15

Chakra was started around 2008 as a from-scratch rewrite of the legacy JScript engine. IE9 was the first browser to host Chakra. Since then there have been no more rewrites thankfully :)

4

u/coolrudski Dec 05 '15

How do you get into building JavaScript engines? I'm a web dev who writes a disgusting amount of JavaScript and I've always been curious as to how that works behind the scenes

3

u/bterlson_ @bterlson Dec 05 '15

I got hired into it, but there are other ways! Working on OSS is a very good way to go. JavaScript engines are similar to compilers but are in general just very large software projects anyone can work on. I would suggest starting with making a JSRT app to get an idea for the basics of JavaScript outside the browser. From there you could probably ramp up on simpler features like new library methods pretty quickly - it's fairly simple C++ code in our case (until you start to optimize it). Things like JIT optimizations can require specialized knowledge and lots of experience, but there is plenty of engine work that isn't at that technical depth.

→ More replies (1)

4

u/[deleted] Dec 05 '15

Currently, Node has v8 baked in, but do you see potential for Node to switch out engines?

If not, do you think Microsoft would consider publishing a version of Node using Chakra? Is it even in the cards?

13

u/bterlson_ @bterlson Dec 05 '15

We're already working on it and are getting a pull request ready for upstream Node to enable Chakra if you like. More info here: https://github.com/Microsoft/node.

→ More replies (1)

0

u/[deleted] Dec 05 '15

[deleted]

14

u/bterlson_ @bterlson Dec 05 '15 edited Dec 05 '15

We will bring Chakra to other platforms but we don't have any date in mind. As I said elsewhere, the more we hear from everyone about what platforms they're interested in and what usage they're most looking forward to the better!

License will be MIT (this could conceivably change before release but suffice it to say the license will be something OSI-approved).

→ More replies (1)
→ More replies (25)