6

It is exciting that Windows 8 is supporting so many languages for Metro App development. One that especially interested me was the HTML5/CSS/JavaScript. What I don't understand, is this code going to get compiled in a sort of executable (like the C#, VB, and C++ option), or would my app basically be running in IE as an actual web page?

Kevin Vermeer
  • 2,736
  • 2
  • 27
  • 38
Greg Potter
  • 527
  • 1
  • 5
  • 18
  • So how does it run in Windows 8 Metro Apps? In a slimmed down IE? – Greg Potter Dec 28 '11 at 16:22
  • @GregPotter Yes, pretty much. It's "slimmed down" in a sense that there's no chrome other than what's standard for Metro apps. It's extended in a sense that you can load WinRT components (including your own custom one) and call them, which you cannot do in IE proper. But it is a browser, with DOM etc. – Pavel Minaev Dec 28 '11 at 17:35

2 Answers2

12

Yes. Javascript is executed on Windows 8 by the Chakra engine. Similar to the .NET just-in-time compiler, it translates javascript to optimized machine code. Also the approach taken by Google's V8 and Mozilla's TraceMonkey engines. Some background info is here.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • 2
    To be clear, it is just-in-time compiled, but not pre-compiled. As in, you can't ship an app using JS without shipping the source code? – Gabe Dec 28 '11 at 18:26
  • It is jutted, not compiled. Unlike, Net code, it cannot be compiled (NGened) – Larry Osterman Dec 29 '11 at 12:03
2

Here's a video overview of some of how to use JavaScript with the new Windows 8 Runtime from BUILD2011 (slides also available on the same page). The presenter goes through a simple project with JavaScript and the WinRT and gives a pretty nice overview of WinRT in general. You can read more about all that on this related SO thread.

Community
  • 1
  • 1
sczizzo
  • 3,196
  • 20
  • 28