📜 ⬆️ ⬇️

Chakra officially adopted by Node.js

As previously reported, Microsoft made a pull request with the addition of support for the open JS engine Chakra of its own design in Node.js. Microsoft developers made a very controversial change, which caused a fierce discussion among the project participants: they sounded accusations addressed to MS, with subsequent blockages of the discussion thread, and sober criticism sometimes sank among overly enthusiastic comments. And despite the fact that the pull request itself has not yet been adopted, Microsoft received the official support of the Node.js community.

This pull request looks controversial because it proposes to do what the community hasn’t been able to do over the past few years - to create an abstraction layer over the JavaScript engine and to keep C / C ++ code from constantly rewriting after the v8 architecture change. MS wrote a shim, a v8 emulation behavior, and named it ChakraShim.

Many were outraged by MS’s attempt to become a first-class participant in the project and to influence the development of the kernel. It really can be called unfriendly intervention, because the fork mechanism has existed for a long time and has proven itself well. And given the fact that Chakra is quite a new engine and only earns its first reputation in the open source environment, the fork looks much more logical. Moreover, the engine works only under Windows.
')
During the discussions, it was decided not to merge the projects together and limit the fork, but already in the nodejs repositories, until the appearance of at least some stable version. After that, Chakra will become a full Node.js engine. Here, in fact, the whole news, if not for a few interesting details.

Interesting details


Microsoft never ceases to amaze with its newfound openness, providing previously closed technology to the public. The corporation provides the community with a lot of what the developers wanted to see open from the beginning onwards. Moreover, MS opens up completely new developments. Against this background, the company's participation in the development of Node.js looks logical. Moreover, MS plans to use the result of symbiosis in its IoT products, while node.js has a huge code base.

But, why all this is MS, if they have their own stack from IoT to the mobile platform and servers, why not make another own product by adding XAML to it? Enough to make it compatible with Nodejs. Why invest in a community that is not too loyal and in a product that does not occupy a significant share in your technical process? Someone may believe that MS abandoned the strategy of self-development. But it does not pull at all for an exhaustive explanation.

Let's look towards WebAssembly. This is a browser bytecode technology that combines speed and energy efficiency close to C; the safety of execution and the highest speed of delivery available today only to the browser. Also add here the widest distribution among other media. Plus an abstraction from any language! It is extremely likely that this technology will turn the software development market over, as once mobile applications have turned the development and grabbed a huge share of the web. But who today occupies a leading position on the web, is it Google with Chrome and v8 under the hood !? For Microsoft, this has serious consequences, at least an exhausting struggle.

But this is only one detail, it is impossible to make reliable predictions for it. As a js developer, I really look forward to the emergence of wasm, and predicted the inclusion of experimental support in June-July 2016 — after all, it’s not such an easy task to develop a new comprehensive technology for the web. But the pace of development was significantly higher - Google was already testing wasm in v8. Interestingly, the decision to start developing the layer of abstraction in Node.js was not taken for several years due to the obvious difficulty of the task and the lack of any idea how to do it. With the advent of ChakraShim, the decision was made in less than a week. And, no less interesting, without any clear reason, the technical committee decides to complete the work by April and assigns the highest priority to this task. The fact is that with the advent of wasm, the need for abstraction will disappear, since most of the modules can be transferred to wasm without significant loss of performance, but with getting rid of platform dependency. And this means that Google will grab a big chunk already inside Windows itself, if not directly, but still.

Of course, maybe Microsoft is just trying to strengthen the position. But, judging by the risks that arise in front of MS, the company strives to secure its ownership and, perhaps, tackles on Nodejs before buying (remember that Nodejs is a Joyent trademark, which means it can be sold). In any case, these are the first signs of a new technological war unfolding around wasm. And, in the near future we can expect an increase in the presence of Microsoft in Node.js.

Source: https://habr.com/ru/post/276617/


All Articles