Slashdot Mirror


Microsoft Asks Node.js To Allow ChakraCore (Edge) Alongside Google's V8 Engine (softpedia.com)

campuscodi writes: Microsoft has submitted an official pull request to the Node.js project, through which it's asking the project's maintainers to enable support for ChakraCore, the JavaScript engine packed inside Microsoft's Edge browser, as an alternative to Node's built-in V8 engine, developed by Google. Earlier in December 2015, Microsoft open-sourced ChakraCore. Microsoft has also been one of the biggest companies to adopt Node.js early on, and is also part of the Node.js Foundation's Board o Directors. The main reason to add ChakraCore support in Node.js will help the IoT version of Windows 10 to run JS apps on IoT devices, just like Samsung is also thinking about.

77 of 146 comments (clear)

  1. What if they say no? by itomato · · Score: 1

    Who sits on the board, and whose thumbs are they gonna twist?

    1. Re:What if they say no? by LifesABeach · · Score: 1

      Microsoft involved? What could possibly go wrong?

  2. Why not... by Anonymous Coward · · Score: 2, Insightful

    Edge is a lot faster than Chrome in a lot of areas and handily spanks Firefox. Nothing wrong with competition.

    1. Re:Why not... by Z00L00K · · Score: 3, Insightful

      Do you have any documentation available on that?

      Not only benchmarks but also perceived performance by the user.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    2. Re:Why not... by Anonymous Coward · · Score: 5, Funny

      If only there was a queryable index of websites you could search by keyword this would be a lot easier. Guess we'll never know.

    3. Re:Why not... by mwvdlee · · Score: 2, Insightful

      Does it matter? If ChakraCore's language support for JavaScript covers 100% of V8's language support, no more no less, they can integrate it in Node.js just let the user decide which is better in which situation.

      The main issue is this language compatibility. Node.js would need to define the language syntax they officially support, possibly defined by just taking most of V8's language support, and would have to get a binding commitment that the other one will stay in line within a reasonable time and not enable any additional language features.

      If the two start to deviate in any significant way, it'll be Embrace, Extend & Extinguish all over again.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    4. Re:Why not... by jopsen · · Score: 1

      main issue is binary modules...

    5. Re:Why not... by Anonymous Coward · · Score: 1

      Why would MS have to restrict themselves to the subset implemented by V8? Who's to say that node won't change their mind and use Chakra and replace V8?

      In fact, who's to say that V8 won't change their language implementation in ways incompatable with node.js anyway?

        There clearly is a push inside node.js to target ES6 instead of V8's particular variant.

    6. Re:Why not... by Anonymous Coward · · Score: 1
    7. Re:Why not... by Anonymous Coward · · Score: 1

      Probably not much. See benchmarks of a pre-release version of Edge from May last year.

    8. Re:Why not... by Melkman · · Score: 2

      So basically you say this is the embrace step with an extend step to follow by using binary extensions ?

    9. Re:Why not... by Anonymous Coward · · Score: 2, Insightful

      That's nice, but that's

      1. A benchmark of WebGL and not the JavaScript engines
      2. A benchmark of asm.js which is a Firefox thing

      All it proves is that a benchmark optimized for Firefox is fastest in (gasp) Firefox.

      Any benchmark designed around testing real-world browser performance shows Chrome and even Edge handily spanking Firefox. Firefox is only "fast" in the benchmarks that either are designed to test Firefox technology (asm.js) or benchmarks Firefox has optimized itself for. But never in the real world.

    10. Re:Why not... by mwvdlee · · Score: 3, Insightful

      There's nothing stopping V8 from doing the same dick-move.
      But right now, Node.JS's language effectively IS whatever V8 is.
      If Node.js can set their own language standards and block syntax outside that standard, it would make swapping engines a total non-issue.

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
    11. Re: Why not... by tigersha · · Score: 1

      I have a web app that uses javascript heavily to render a complicated table

      In my experience edge is much faster with HTML rendering of a large table but the js is slower

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    12. Re:Why not... by Anonymous Coward · · Score: 1, Informative

      Nothing wrong with competition.

      Very true. But this is Microsoft. A corporation that will wiggle into protocols and standards, then use their market share to gain instant market penetration, and then add proprietary extensions or redefine existing functionality with the sole purpose of breaking compatibility to ensure their implementation is the only one people can use.

      That's the biggest issue, and why people are deeply concerned. They never want to help, they want to embrace, extend then extinguish. It's their modus operandi since the 1980s, and nothing they've done since has said they'll work with others to the mutual benefit of us all. Their end-game is always the same. Sometimes they'll just cause delays, purely to get their own copycat version out first.

      Trust them at your peril!

    13. Re:Why not... by Anonymous Coward · · Score: 1

      Because when V8 does it, it will be called progress and be hailed as innovative.

    14. Re:Why not... by Anonymous Coward · · Score: 1

      I believe it has a more complete ES6 implementation as well.

    15. Re:Why not... by LifesABeach · · Score: 1

      It's not what Microsoft does that's the problem, it's what it doesn't do that is.

    16. Re:Why not... by LifesABeach · · Score: 1

      Somebody modded you insightful? Well, lets see the benchmarks that Microsoft has. But don't worry, everyone with an once of common sense will understand if Microsoft doesn't "come out."; and while we're on the subject, lets throw Apple in there also.

    17. Re:Why not... by LifesABeach · · Score: 1

      "The main issue is this language compatibility," my ass. When Microsoft shows up, no good comes of it, unless you're Microsoft; a review of the public record on lawsuits is ample evidence.

    18. Re:Why not... by BarbaraHudson · · Score: 1

      main issue is binary modules...

      main issue is wtf are we putting javascript into more and more things connected to the Internet for? We already have tons of examples of "what could go wrong."

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    19. Re:Why not... by oh_my_080980980 · · Score: 1

      You're an idiot. Remember JavaScript. Microsoft did fuck all to JavaScript by supporting proper JavaScript and introducing it's own version such that developers had to check to make sure the code they wrote worked and even write separate code for Microsoft browers and everyone else.

    20. Re:Why not... by dave420 · · Score: 2

      It was probably created by an adult.

    21. Re:Why not... by KingMotley · · Score: 1

      Not done by Microsoft, but here is a benchmark that was done in July between IE, Edge, Chrome, and Firefox by Anandtech:

      Benchmark IE 11 Edge 20 Chrome 43 Firefox 39
      Sunspider 149.7ms 133.4ms 247.5ms 234.6ms
      Octane 2.0 9861 22278 19407 19012

      These are the relevant tests that stress the javascript engines. I've omitted the ones that test chrome's proprietary HTML extensions, or graphic rendering. There are plenty of other benchmarks testing the entire browser for page load times, and Edge does even better in those tests. Edge may not have the most features, or rolled in the experimental HTML5 stuff, but it is very very fast.

    22. Re:Why not... by KingMotley · · Score: 1

      I think the review of public record on lawsuits against google would be a much larger pile about now.

    23. Re:Why not... by tigersha · · Score: 1

      All the browsers did and still do this. If all browsers strictly used the WWW standards all our website would still look like geocities pages ca 1995.
      It is called innovation.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    24. Re:Why not... by unencode200x · · Score: 1

      Note that one of the purposes of these benchmarks was to test the 64-bit version of Firefox vs. the dominant browsers.

      --

      Chance favors the prepared mind.
      Perfect is the enemy of good.
    25. Re: Why not... by Billly+Gates · · Score: 1

      So IE 6 is innovation then? Why does Google get a free pass?

    26. Re:Why not... by KGIII · · Score: 1

      I know it's not JavaScript but, damn it, I'm waiting for a resurgence in Java applets in the browser. I shit you not, I seriously expect to see this happen in the not-to-distant-future. Why? Someone will think it's a grand idea, all over again.

      --
      "So long and thanks for all the fish."
    27. Re:Why not... by BarbaraHudson · · Score: 1

      Better to just have Java applications on the desktop, etc. At least get rid of the web browser portion and the risks of XSS, etc. HTML was supposed to be for rendering and cross-linking texts, not an "application platform."

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
  3. Embrace and Extend by mr.dreadful · · Score: 4, Insightful

    Why would this be beneficial to anyone but microsoft?

    1. Re:Embrace and Extend by Z00L00K · · Score: 1

      That is a good question.

      Another interesting question is the risk of bugs in that engine that might infect other applications as well. If the same engine is used in multiple platforms this may mean that malware may be more successful than expected.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    2. Re:Embrace and Extend by Anonymous Coward · · Score: 1, Insightful

      Yeah, choices are silly.

    3. Re:Embrace and Extend by Dog-Cow · · Score: 1

      An actually interesting question is who allowed you on the Internet? Your question makes absolutely no sense at all, considering that V8 is currently multi-platform and backs every Node.js implementation in existence (outside labs).

    4. Re:Embrace and Extend by sosume · · Score: 1

      Why would this be harmful to anyone but Google?

    5. Re:Embrace and extend by Z00L00K · · Score: 1

      It's not very different from the Nigerian Prince mail scams we see now and then. It's a bait that can be used to reel in Node.js under the cover of Microsoft.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    6. Re:Embrace and extend by tigersha · · Score: 1

      gcc has things that are not standard C++, Linux has API calls not in Windows, Firefox, Chrome, Opera all have things that IE and the other browsers can't do.

      It is called "innovation"

      Javascript is horrifying enough as it is, it could use some of that "innovation" thing.

      --
      The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
    7. Re:Embrace and Extend by thebjorn · · Score: 1

      Because ChakraCore is faster and more standards compliant than V8 (not to mention the version of v8 that node is using).

  4. Re:But why? by Pseudonym · · Score: 5, Insightful

    V8 is already cross platform and open source, what is the need to have alternative engines?

    We've been here before. What's the point of Linux when we already have 386BSD?

    --
    sub f{($f)=@_;print"$f(q{$f});";}f(q{sub f{($f)=@_;print"$f(q{$f});";}f});
  5. The next question is - why? by DrXym · · Score: 1
    Is ChakraCore measurably faster? Is it more portable? Is it more adherent to standards?

    Perhaps it is or perhaps it isn't. If it's only marginally better, or not better at all, then why would Node.js want the maintenance headache of two backends with no meaningful differentiation?

  6. V8 doesn't support Windows? by Black.Shuck · · Score: 1

    The main reason to add ChakraCore support in Node.js will help the IoT version of Windows 10 to run JS apps on IoT devices

    V8 doesn't support Windows?

    1. Re:V8 doesn't support Windows? by DrXym · · Score: 3, Insightful
      Yes but maybe it doesn't compile under UWP which is Microsoft's universal API across IoT, mobile, desktop. UWP only supports of a subset Win32 so code that compiles to Win32 may not compile to UWP without lots of patching.

      I've been lead on this merry dance of bullshit before with Windows Embedded where the toolchain only supports a subset of Win32, a subset of STL classes and C headers and suddenly code that used to be portable no longer is.

      I wouldn't see that as an excuse to replace the entire backend though. Microsoft should supply patches to fix V8.

    2. Re:V8 doesn't support Windows? by ChunderDownunder · · Score: 1

      Possibly not, for the specified architecture. Windows 10 IoT targets the raspberry pi 2.

      Google Chrome on Windows is amd64 and i386 only.

    3. Re: V8 doesn't support Windows? by lisaparratt · · Score: 1

      Presumably chakracore will already be there, whereas V8 won't. Size is important in IoT.

    4. Re: V8 doesn't support Windows? by DrXym · · Score: 2
      I haven't used Windows 10 IoT but previous Windows Embedded versions had a thing called platform builder where you got to pick and choose what components you wanted and then you built it. e.g. if you didn't need IE, you didn't choose it. So I wouldn't be so sure that a standalone JS engine is already there.

      More likely V8 drags in a bunch of open source libs and tools like gyp and porting them to work on UWP is a bother. But its a problem of Microsoft's own making and I don't see that sidestepping the issue by kludging in another engine is to Node.js's benefit so much as it is Microsoft's.

    5. Re: V8 doesn't support Windows? by StonyUK · · Score: 1

      Presumably chakracore will already be there, whereas V8 won't. Size is important in IoT.

      The engine used by node is embedded inside node, so currently it has an embedded version of v8 and if you were to install a chakra based version of node, it will have it's own copy of ChakraCore embedded in it.

  7. Argh, matey by wonkey_monkey · · Score: 5, Funny

    the Node.js Foundation's Board o Directors

    Yargh, and it be a fine board too.

    --
    systemd is Roko's Basilisk.
  8. don't support engines, OS's and devices by Anonymous Coward · · Score: 5, Insightful

    support standards instead.

    1. Re:don't support engines, OS's and devices by MobyDisk · · Score: 1

      There is no standard Javascript engine implementation, and no standard for linking to JavaScript engines. So that isn't really an option here. I suppose someone could create a standard interface for linking to JavaScript engines, and make node.js support that. Then someone would have to either update V8 and ChakraCore to support that, or make an adapter.

      Hmm... now that you fooled me into proposing a way to make it possible to do as you suggest, I actually like that approach

  9. Re:Mafia by bluescrn · · Score: 4, Insightful

    Isn't Google the scarier massive corporation these days?

    There's more choice of OS than ever (if you consider mobile, too) - but Google have a lot of power over huge aspects of the Internet that Microsoft has very little influence over

  10. Re:But why? by Dog-Cow · · Score: 2

    Then you expend those resources. MS is submitting a PR, which means they did the work. If you want them to use V8 and not their own code, convince them.

  11. Re:But why? by Dracos · · Score: 3, Insightful

    Improving V8 would be more worthwhile to anyone who doesn't have a crippling case of not-invented-here syndrome.

    And I don't get the IoT angle here... no hobbyists care about W10IoT, the Microsoft JS engine doesn't make the bait any better. Linux on RaspberryPi is a full fledged OS, not a glorified app bootloader.

  12. Re:But why? by h33t+l4x0r · · Score: 2

    Improving V8 is not on the Node.js agenga. And how is having options a bad thing? Put down the MS hate for a minute and try to form a rational opinion.

  13. Embrace and extend by Anonymous Coward · · Score: 1

    Microsoft will quickly add non standard extensions to their engine and suddenly you'll have node.js applications which will only work if engine == ChakraCore.
    That's how Microsoft plays. This is not a "good competition", the only winner is MS.

    They're pretending to be very nice those days, like a bully that's been ousted from the playground. Because they've been ousted from the playground.
    But it's OK, we have new friends now and we don't need you any more Microsoft.

    Now, let the MS PR guys down vote my comment into oblivion.

  14. Re:But why? by ChunderDownunder · · Score: 1

    Options are great! I have about half a dozen different JavaScript runtimes on this Linux box alone - V8 for Chrome, several different versions of JavaScript Core bound to webkit embedded in Qt and GTK+ plus SpiderMonkey for iceweasel. So I'm hardly going to drown with one more...

    Does the world *need* yet another open source runtime? Well possibly not but if Microsoft are prepared to spend time and money in liberating Node from v8-isms then good luck to them. c.f. Python and Ruby have benefited in terms of multiple runtimes to the extent of portability. The bigger picture may be implementation-independent bindings to not just Node but other use cases above.

    And before someone plays the "'brace, 'tend and 'tinguish" card, I'd give Nadella the benefit of the doubt before comparing his era to the dark days of Gates and Balmer.

  15. Re:But why? by Z00L00K · · Score: 4, Insightful

    I think that Microsoft needs to get their engine spread more than what Node.js needs the Microsoft engine.

    However I also see a danger here - if Microsoft gets their engine as default into Node.js then they can change the licensing terms and effectively block Node.js from being viable. This has happened before, and will happen again. It smells like bait.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
  16. SpiderMonkey, ChakraCore, JavaScriptCore, Duktape by SirJorgelOfBorgel · · Score: 4, Informative

    I know a bunch of you think V8 is cross-platform enough, but really it isn't. It uses way too much memory for many platforms, there's no non-JIT mode (so can't run on iOS), oh and it is a female dog to compile.

    Node.js' use cases are not limited to running a Node.js server. Embedding the core inside a bigger application and using it for some types of cross-platform logic, scripting, etc is a real thing. Maximizing compatibility is a must in that case.

    Aside from just having options, various engines offer different features you may want to use, and better compatibility with your target platform.

    JXCore has done a great job extending Node.js to support mobile, and they support SpiderMonkey and ChakraCore alongside V8. Compatibility wise they're king of the hill already, though they could still add JavaScriptCore and maybe even Duktape for good measure.

  17. Resistance is futile .. by tetraverse · · Score: 1

    "We are the Borg. Lower your shields and surrender your ships. We will add your biological and technological distinctiveness to our own. Your culture will adapt to service us. Resistance is futile."

  18. Re: But why? by Anonymous Coward · · Score: 2, Insightful

    As node.js is FOSS, Microsoft is actually being very polite about this. They could've just forked the source code and made their own compatible release. As it stands, I hope the folks at node.js take heart that MS didn't just pull a dick move on them. One of the few times when MS is actually playing fair and even

  19. Re:But why? by jabuzz · · Score: 1

    Because at the time BSD/386 was still the subject of litigation so it was entirely possible that 386BSD might also disappear if the USL v. BSDi law suite had gone the way of USL.

    Further while the case was settled in 1993, the terms of the settlement did not become public till 2004, so the potential for further litigation was seen to be a potential possibility as the terms of the settlement where not know.

    This produced a window of opportunity for Linux to gain critical mass.

  20. Re:But why? by Anonymous Coward · · Score: 1

    Yes, it does smell like bait. If Microsoft wants Node.js + Chakra then Microsoft should just fork Node.js and add Chakra. That way MS gets expend the labour ($) to maintain their own JavaScript environment (and not someone else).

  21. Re:But why? by oh_my_080980980 · · Score: 1

    Yeah ass-wipe and it's called JavaScript. Microsoft didn't support the JavaScript standard and there in created all kinds of problems. Fuck Microsoft. They don't adhere to standards.

  22. Re:But why? by sumdumass · · Score: 1

    The only bait i see here is having lines of products that require Windows to remotely administer or take advantage of all the bells and whistles.

    I doubt it is about gaining control of node.js. Think along the lines of activeX plugins and such. A company uses node.js in their lights controller and MS makes a snazzy app for the Windows phone and tablets that use extensions they built into chakra.

    I bet that's what it is about. That or they see the momentum and do not want third-party browsers to be required on all Windows devices just to have the best experience.

  23. Re:But why? by Z00L00K · · Score: 1

    I think it's about getting control of node.js in order to take it off the market. Not to take control of how it's used on the market.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
  24. Re:But why? by tigersha · · Score: 1

    Language and compiler design is a tricky, difficult problem and innovation is a good idea. Microsoft has a world-class language/compiler group.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  25. Re:But why? by tigersha · · Score: 1

    Window sucked very much in 1993. I used Linux then. It was waaaaay better.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  26. Re:But why? by tigersha · · Score: 1

    The Windows 8 GUI is much better than the one on 7, and I am a Mac user before you accuse me of being a Windows fanboy.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  27. Re:But why? by tigersha · · Score: 1

    Finally, a professional engineer who has a reasonable opinion as opposed to the MS hating bunch here. I would also love to use Chakra under node, would be interesting to see. Microsoft's C compiler, for one, runs rings around gcc.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  28. Re:SpiderMonkey, ChakraCore, JavaScriptCore, Dukta by tigersha · · Score: 1

    Exactly. Language platforms are not just about the syntax and libraries. It is also about the implementation underneath. And there different implementations have different pros and cons.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  29. Re:Is it released GPL3? by mark-t · · Score: 1

    Chakracore uses the standard MIT license, afaik.

  30. I actually kind of like Chakra's design by mark-t · · Score: 1

    In embedded v8, it is a headache and a half to create custom types that vitally need to perform some task such as releasing used memory held by a native implementation upon cleanup. In v8, if you simply want to have some cleanup code get called, you have to allocate a Persistent along with your data, explicitly invoke SetWeak on that Persistent to specify the finalize callback, and then make sure that you keep the allocated persistent around for the lifetime of your custom object (which means that your finalize callback needs to release the memory allocated for the persistent itself in addition to releasing memory used by your custom type). In Chakracore, it appears that you can pass a finalize method directly to JsCreateExternalObject when you create the javascript value... no messing around with the extra storage that v8 needs for persistent types that are not allocated on the stack.

    Also, the ChakraCore API also has an advantage of having a smaller and much simpler C API than v8's C++-only API.

    Additionally, I have to say that Microsoft's documentation of Chakra's javascript runtime kicks ass over Google's documentation of v8's.

    I haven't had a chance to play with Chakra yet myself, having only perused the API docs so far, and the projects that I'm working on that use embedded v8 are far too v8-entrenched to migrate them to using another javascript engine, but I will strongly consider using it in any future new projects.

  31. No, No, No!!!!! by Johnny+Loves+Linux · · Score: 1

    This request is pointless. It's clear how it's advantageous to Microsoft to have their engine used instead of Google's.

    But it has NO advantageous to either the node.js project OR the people who make use of node.js. Please don't even consider it.

  32. Re:SpiderMonkey, ChakraCore, JavaScriptCore, Dukta by MobyDisk · · Score: 1

    Node.js' use cases are not limited to running a Node.js server. Embedding the core inside a bigger application

    Ding ding ding!!!

    I am working on a project that needed an internal scripting engine. We first looked at nodeJS, but then realized exactly the limitation you point out: we can't "embed" node inside of an app. So I can't make in-process calls to/from JavaScript. There are various other wrappers that allow you to embed V8 into apps, and we went with one of those. But if Node supported that mode of operation, we would have used it. Most other scripting languages work this way: They are in-process libraries that let you call into and out of the language.

  33. Re:SpiderMonkey, ChakraCore, JavaScriptCore, Dukta by MobyDisk · · Score: 1

    When I use node.js I want 100% of node.js available

    It would be.

    The OP is referring to features of the JavaScript engine, not features of the node environment. Think of it as the difference between the compiler and the platform. I can write C++ code on Windows using gcc, msvc, or llvm. Each compiler offers different features. But either way, 100% of the Windows API is available. Using another platform as an example: I can write C++ code on Linux using gcc or llvm. Both offer different features. But both support 100% of the POSIX APIs.

  34. Re:But why? by thebjorn · · Score: 1

    It seriously wasn't. Linux was horribly difficult to work with, and get work done with, in 1993. Windows 3.1x was also horrid in 1993, and most people ran some version of DOS with memory extenders and various TSR programs (like Norton SideKick)

    In 1993 I owned a NeXTstation, and that was indeed a a lot better :-)

  35. Re:But why? by thebjorn · · Score: 1

    You do realize that ChakraCore is more standards compliant than the V8 that node uses, right..? From https://kangax.github.io/compa... es2015 features supported: spidermonkey=73%, v8=60%, ChakraCore=79%, Node 5=54%.

  36. Re: But why? by CrashNBrn · · Score: 1
    Microsoft haven't forked Node.js, although they have been submitting to it's module library: Visual Studio Code, Updates

    Improvements for non US standard keyboard layouts
    VS Code dispatches key bindings based on [keyboard codes](https://msdn.microsoft.com/en-us/library/windows/desktop/dd375731(v=vs.85). In keybindings.json and in all the UI, we used to render the key codes with the produced characters under the US standard keyboard layout. We received feedback that this was very confusing, therefore, we created a new Node.js module native-keymap that is used in VS Code to render the key bindings using the system's current keyboard layout.