На моём круге от тындекса глюкОфигенная вообще слышимость во влажную погоду до аэропорта

Using JavaScript and C++ to build Metro apps

01.
The whole idea of using JavaScript and HTML as a way of creating Metro style apps for Windows 8 is something of a mystery. Why would you go that way. The UI may look as if it is just HTML, but the JavaScript is about as custom as you can get simply because of the range of specific library calls needed to make it work.Microsoft, however, seem to be backing JavaScript, but there are problems - JavaSript is slow and not suitable for writing things like video processors or advanced 3D graphics. The solution suggested is to use C++ and JavaScript in combination. You use JavaScript to build the UI and do the "easy" stuff and C++ to do the deep technical stuff.To show you how to mix these two very different languages, there is a video for you to watch.The real meat of the talk starts at around the 7-minute mark. The example simply displays an input image and a processed image - the processing is done using C++The basic idea is that you add a WinRT layer that allows communication between the JavaScript and the C++. This WinRT layer takes the form of a WinRT component, which is a sort of COM component but without the hard work. Basically you create a WinRT component and this becomes a runtime extension to the WinRT subsystem. You can then call you WinRT component from any WinRT enabled language. The process is a simple matter of using the Visual Studio template and adding some public methods. If you remember COM development, you will find things strangely familiar - GUIDS and so on. To tell the JavaScript project or any WinRT language to make use of the new component you simply have to add a reference, instantiate the class and make use of its methods.It is all very easy but it's another reinvention of the wheel. Or is it a return to a simplified wheel? At first there was COM and it was difficult and had lots of problems. Then there was .NET and introspection, which did away with the complexities of COM. Now there is the WinRT component, which is COM reinvented to be as easy to use as a .NET runtime object.All of this isnt' bad - it's just very strange and, dare I say it, not very logical.(c)