Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Microsoft Open Source

Microsoft Open-Sources Its JavaScript Engine Chakra (windows.com) 141

An anonymous reader writes: As promised, Microsoft has open-sourced the core components of Chakra, the company's JavaScript engine used in Microsoft Edge and Internet Explorer. The project, dubbed ChakraCore, has been released under the MIT License on GitHub. The official blog post reads in part: "The ChakraCore repository provides a fully supported and open-source standalone JavaScript engine, with the same characteristics as the Microsoft Edge’s Chakra engine, to embed in projects, innovate on top of and contribute back to. We will be accepting community contributions and input to ChakraCore. Once the changes from any pull request have been vetted, our goal is to ensure that all changes find their way to be shipped as a part of the JavaScript engine powering Microsoft Edge and the Universal Windows Platform on Windows 10."
This discussion has been archived. No new comments can be posted.

Microsoft Open-Sources Its JavaScript Engine Chakra

Comments Filter:
  • by Anonymous Coward on Thursday January 14, 2016 @06:40AM (#51298921)

    "...with the same characteristics..."

    So, not the same code, then. That isn't really the intent of open source, now is it?

    • by CSHARP123 ( 904951 ) on Thursday January 14, 2016 @07:42AM (#51299079)
      From the blog at https://blogs.windows.com/msed... [windows.com] there are two differences
      1. It does not expose the bindings to Windows platform
      2. Instead of COM based diagnostic APIs, there provide a different set for Open source one.
    • by etinin ( 1144011 )
      Not that there is much use to this, since there's V8 out there which is multiplatform, but the fact is that they didn't open source all of Chakra. Things like browser hooks probably got removed. But they do claim it's the same code, as can be seed by the following quote from TFA link:

      "Once the changes from any pull request have been vetted, our goal is to ensure that all changes find their way to be shipped as a part of the JavaScript engine powering Microsoft Edge and the Universal Windows Platform on W
    • "...with the same characteristics..."

      So, not the same code, then. That isn't really the intent of open source, now is it?

      Oh please and OpenJDK with IcedTea gets a free pass right? Same kind of deal and the reason with Java was because Adobe and others owned the patents and IP property of the code and didn't want to share it.

      MS like IBM is not the same company it was 15 years ago. It lost it's monopoly and competition made them friendlier. Any corporation whether it is Apple (Boy I am glad they didn't win the pc wars based on what I saw during their comeback ) , or IBM, or even Google is heading will always be evil. It is what

  • by Anonymous Coward

    ...opening their chakra

    *puts sunglasses and walks away without looking looking at explosions*

  • I'm confused as to where the impetus is to have these standalone javascript engines such as Chakra and googles V8 anyway. Javascript is a poor scripting language compared to something like Python and a poor general purpose programming language compared to C++ or Java (Why? Google it). I know a lot of kids these days kick off their coding doing web based stuff, but thats really no reason to try and drag that 2nd rate mishmash of an enviroment out of its niche into other areas of computing such as Databases (

    • by CSHARP123 ( 904951 ) on Thursday January 14, 2016 @07:11AM (#51298999)
      because it is already well trenched. Abandoning now will create problems to already existing applications that depends on JavaScript. Also some of the JavaScript frameworks has made maintaining the code much easier.
      • by Viol8 ( 599362 )

        Ah "frameworks". The euphamism for a APIs that are far more bloated & complicated than they need to be.

        • by Anonymous Coward

          Careful with the generalizations. They risk exposing your lack of solid arguments and presenting you as someone who doesn't really - actually - know what you're talking about.

          • by Viol8 ( 599362 )

            I've probably had to use more "frameworks" in the last 25 years that you've had hot dinners mate but if it makes you feel better being a typical sneering AC loser then enjoy.

        • hugs. If only I had mod points today.

      • Seconding this - at this stage in the game, JS is here to stay so the emphasis is on improving it rather than replacing it. Too much money is invested in JS right now across the board for the possibility of replacement to be taken seriously - and even if it was replaced, the sunset period would be longer than that of XP...

        JS has improved a lot over the past few years, and is set to improve a lot more with the continuing adoption of EcmaScript 6 - thats the best you are going to get Im afraid.

        • JavaScript is not a completely terrible language (though the implicit conversions and weird semantics of the + operator make it far from one of the best - at least it has first-class closures and sane variadics), but every time I try to use it for something serious I get hit with the problem that it only supports 53-bit integers. For interoperability with code written in pretty much any other language, not having a 64-bit integer type is annoying.
    • by brunes69 ( 86786 )

      ES6 Javascript engines are actually superior to Python in many ways.

      The Python scripting engine is actually quite poor. It doesn't even have true multithreading (there is a global lock on all Python threads. V8 and Chakra have no global locks).

    • by monkeyxpress ( 4016725 ) on Thursday January 14, 2016 @08:24AM (#51299163)

      Install base. JavaScript is installed on almost every PC/mobile platform in existence, and has been in some shape or form for nearly a decade. You can't say the same about iOS, Windows, Python etc.

      Sun tried to make Java into a universal platform, Adobe came close with Flash, and Microsoft had a go with Silverlight/.NET. None of these have endured in the same way JavaScript has. Why it did is a complex question.

      JavaScript isn't as bad as you might think, but does require a lot of discipline (much like C++) to be done well. It definitely shouldn't be the universal language. I consider it really a high level language builder, rather than a high level language in itself. It is actually quite incredible that some newbie can naively bash out decently structured imperative code using it, while an advanced user creates quite well formed functional stuff. But, like C, the downside of this flexibility is that it is extremely easy to shoot yourself in the foot - something that I don't think should be a characteristic of a high level language.

      Anyway, the way things are trending in the JavaScript world, eventually most people won't work directly in JavaScript but use derivative languages (such as CoffeeScript is doing now) better suited to their problem domain, so longer term you'll probably have your wish of developing in Python/C++ and then having that compiled to JavaScript. For now though, if you want the best performance (particular on mobile), you need to be developing in JavaScript and have a reasonable understanding of how the interpreter is working for you.

      • by gbjbaanb ( 229885 ) on Thursday January 14, 2016 @09:09AM (#51299303)

        I'll tell you why those didn't succeed where javascript did - proprietaryness.

        Java wanted to be "pure java" where you only wrote Java. Flash and Silverlight were the same, in all cases you had to drink the kool-aid and become one of "them". Javascript was just so boring and crap that the major players ignored it, but as it was there, developers knocked out little bits of code using it until eventually everyone could program javascript but only a third could do Java, a third could do Flash and a third do Silverlight (you get my point, hopefully - nobody became a developer for all three of those competing proprietary platforms)

        And so the impetus for each of the big platforms waned while javascript kept growing.

        To replace it would have to be a standards thing, and get implemented in every browser and be recognised as better. Not Dart or Typescript or whatever, which are all failing too.

    • Re: (Score:3, Interesting)

      by drinkypoo ( 153816 )

      I'm confused as to where the impetus is to have these standalone javascript engines such as Chakra and googles V8 anyway. Javascript is a poor scripting language compared to something like Python

      Python, where a typical copy from a webpage and paste into the IDE will destroy the code? No, Javascript is fucking brilliant compared to that.

      I know a lot of kids these days kick off their coding doing web based stuff, but thats really no reason to try and drag that 2nd rate mishmash of an enviroment out of its niche into other areas of computing such as Databases

      I know a lot of kids these days learn to toggle an LED on a Raspberry Pi using orders of magnitudes more resources than necessary by using Python, but that's really no reason to try to use it everywhere even though it makes no fucking sense.

      I know people who say Javascript is much improved over what it used to be but I do get the feeling that a lot of these people have never really used any other language in depth.

      Maybe they're just living in the really real world, where Javascript is very like other programming languages for your convenien

      • Python, where a typical copy from a webpage and paste into the IDE will destroy the code? No, Javascript is fucking brilliant compared to that.

        That's a feature meant to catch Stack Overflow coding. :)

      • by Viol8 ( 599362 )

        "Maybe they're just living in the really real world"

        That would be the "real world" where implementing the full Posix API is a must for most serious backend programs running on unix systems? Which javascript can do can it? Oh, no , it can't....

        Perhaps you should try visiting the real world occasionally rather than the small part of it you live in.

        • Perhaps you should try visiting the real world occasionally rather than the small part of it you live in.

          First you present a false dichotomy, then you're a fucking moron.

          • by Viol8 ( 599362 )

            Oh dear, did I hit a nerve? Get over it and answer the fucking point if you can, though given you resorted to Ad Hominem I suspect not.

            Q. Does any javascript intepreter implement the full posix API?
            A. ?

            Because if it can't, for example, do full process control including forking, limit setting and IPC, signal handling, terminal control, shared memory , semaphores, queues, system configuration etc etc then its of limited use in the Real Real World. Say what you like about Python, but it does all of the above.

            • Because if it can't, for example, do full process control including forking, limit setting and IPC, signal handling, terminal control, shared memory , semaphores, queues, system configuration etc etc then its of limited use in the Real Real World.

              Oh, so because it's of limited use it's not good? A car is not a can opener but I can still drive it to work.

              Say what you like about Python, but it does all of the above.

              Python is based around a stupid premise, and there are other languages which do all of those things which are not based around that stupid premise.

              • by Viol8 ( 599362 )

                "Oh, so because it's of limited use it's not good? A car is not a can opener but I can still drive it to work."

                A car that can only be driven down main highways but not suburban streets and back roads would be of limited use.

                "Python is based around a stupid premise,"

                Your whole argument is based around one. I suggest you go back to your javascript playpen and let the rest of us get on with some real backend development.

                • A car that can only be driven down main highways but not suburban streets and back roads would be of limited use.

                  A car that can only be driven on developed roads is of only limited use, but guess what? That use covers the vast majority of cases.

                  "Python is based around a stupid premise,"

                  Your whole argument is based around one.

                  It is a fact that copying and pasting python code from typical webpages, which use stupid tricks to reformat code snippets, will destroy its control flow. That is not a stupid premise, that is a fact. The idea that program flow should be controlled by indent is the stupid premise. The people who thought they should subject the rest of us to this by using python to create fundam

            • by Dog-Cow ( 21281 )

              It would be a good idea to find a python and lock yourself in a room with it for a few weeks.

    • I frickin hate javascript but I've been playing with TypeScript and it's palatable. I'm ready to use TypeScript and node for writing server code that'll I'll eventually run on a RPi or C.H.I.P.. I've been a Java developer for quite a while but Java isn't handy to use on these small embedded chips. TypeScript and node can give me a decent server platform that I could use everywhere, even at work maybe.
    • by Dog-Cow ( 21281 )

      JS is no picnic, but anyone who prefers Python doesn't really know about good languages anyway.

  • Microsoft Chakra not to be confused with Chakra, the GNU/Linux distribution: "Chakra is a GNU/Linux distribution with an emphasis on KDE and Qt technologies that focuses on simplicity from a technical standpoint and free software." ref [chakraos.org]
  • by tlambert ( 566799 ) on Thursday January 14, 2016 @08:19AM (#51299151)

    The missing bindings are expected. The browser bindings expose Windows APIs into the JS engine within the browser ("standard + extensions"), and the COM bindings on the debug API not being present are there to make it platform agnostic.

    The part that I find really amazing is that they are targeting x86, x64, and ARM binary support, with two levels of JIT, with feedback optimization. That's a pretty cool thing to have out there in the wild, under an MIT license:

    https://github.com/Microsoft/C... [github.com]

    I think that some of the first contributions need to be buildability support on other platforms, which means CLang/LLVM and GCC support. Ideally, it would handle agnostic conversion from some common representation into both the project build mechanism in Java ("Jenkins"), and Makefiles. Not sure if I'm willing to jump on this, since it would mean a familiarity with both, and I'm not sure they'd accept something like that back (it looks like they specifically picked Jenkins for its cross-platform-ness, even though it adds a Java dependency).

    This would enable someone external to Microsoft to run *at least* nightly builds and regression testing for other platforms.

    I really have to wonder if it's been thought through, however, to enable people to identify the JavaScript engine, and decide *not* to use the Microsoft specific extensions to the Core platform, so as to keep the things that try to use it portable, or if that's of interest to them. A long time ago, I tried, and failed, to get a common cross-platform ABI adopted, and one of the *key* requirements for it would have been the ability to *turn off* vendor extensions in the runtime, so that you could build cross-platform software targeting it, by causing it to error out when the software used a vendor private API/ABI component.

    Without something like that, I fear, it will become an "embrace -- then extend and make incompatible", similar to gcc'isms being incorporated into otherwise portable source code, or the bash extensions to the Bourne shell that resulted in shell scripts actually not being runnable on any shell, but instead only runnable on bash due to bash'isms.

    A nice barrier enforcement mechanism that extended up through browser space to enable committing to portability would be nice. Otherwise, when a remote website sent JavaScript content down because of the runtime it though it was hitting, it could include them, unintentionally or no, and non-Microsoft browsers based on the Core implementation would fail to operate.

    • The missing bindings are expected. The browser bindings expose Windows APIs into the JS engine within the browser ("standard + extensions"), and the COM bindings on the debug API not being present are there to make it platform agnostic.

      Bullshit. They could simply refer to that stuff as extensions. The COM bindings on the debug API not being present are there so that people don't replace their JS engine with the Open Source one, probably because there is spyware included in the real one and they don't want you to compromise that.

    • This would need a huge market share before incorporating Windows-specific Chakra code did anything other than ruin 90% of your visitors' experiences with your site, and I suspect if Chakra Core did see widespread adoption there would be more work on this specific problem or possibly forks of the project that block it.
  • * I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.

    * I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer.

    Copyright License. You grant Microsoft, and those who receive the Submission directly or
    • by HiThere ( 15173 )

      If I had a strong belief in the benevolent intentions of MicroSoft then those conditions would be reasonable.

      Actually, my opinions don't matter, as I'm not likely to work on a JavaScript compiler, but if they did then I would be strongly disinclined to work on THIS one. Where MicroSoft is concerned I *almost* would consider a GPL license to be sufficient protection.

      • A GPL would be completely useless under those terms. Microsoft could take it proprietary without a problem, since they already can distribute what they wrote under any license they like, and with that copyright license they can use anybody else's contributions in the same way.

        • by HiThere ( 15173 )

          Only if there's a copyright assignment provision, which I wasn't even considering granting to MS.

  • Chakra is Sanskrit for Wheel. Core of the wheel is the axle. Sanskrit for Axle is Aksa. So shouldn't ChakraCore be Aksa?

    English and Sanskrit both belong to the Indo-European family of languages. S it is not a surprise the word for such an ancient invention as the axle sounds alike in both English and Sanskrit. But what about wheel? Well, Sanskrit word for wheel Chakra comes from circle, which is a cognate in so many languages. Why English disconnected the word for circle from the word for wheel, I don't

    • by e r ( 2847683 )

      Why English disconnected the word for circle from the word for wheel, I don't know.

      Because [etymonline.com] the English word is derived from a notion of conveyance (which almost always used a wheel/circle) not directly from the root "circle".

E = MC ** 2 +- 3db

Working...