Does Windows 8 Compile JavaScript? - windows-8

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?

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.

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.

Related

the safari javascript engine in webkit

I was recalled that the webkit javascript engine called "JavaScript core" by my friend,
however, when i searched around the answer is that safari runs SquirrelFish as its
JS engine. My friend told me that it might be an "open source" vs. "non-open source".
That means, webkit is an open source project so that it comes with "JavaScript core" as its
JS Engine while safari is not an open source project, it employees SquirrelFish as its JS
engine.
Wiki says,
On June 2, 2008, the WebKit project announced they rewrote JavaScriptCore as 'SquirrelFish'
Does this mean that long time ago, the webkit employees JavaScript core as its JS engine
but now it has been rewrote and named "SquirrelFish". Hence, the webkit only employees
SquirrelFish.
Is my understanding correct?
Thanks
The Wikipedia article for Webkit gives a pretty good summary:
JavaScriptCore
JavaScriptCore is a framework that provides a JavaScript engine for WebKit implementations, and provides this type of scripting in other contexts within OS X.[13][67] JavaScriptCore is originally derived from KDE's JavaScript engine (KJS) library (which is part of the KDE project) and the PCRE regular expression library. Since forking from KJS and PCRE, JavaScriptCore has been improved with many new features and greatly improved performance.[68]
On June 2, 2008, the WebKit project announced they rewrote JavaScriptCore as "SquirrelFish", a bytecode interpreter.[29][30] The project evolved into SquirrelFish Extreme (abbreviated SFX, marketed as Nitro), announced on September 18, 2008, which compiles JavaScript into native machine code, eliminating the need for a bytecode interpreter and thus speeding up JavaScript execution.[31]
So I would say that, nowadays, WebKit's JS engine is called Nitro.
Actually, the Nitro is the Apple's market term of JSC, you also could recognise SFX and SF as the internal version name of JSC.

Apple Script on iPhone

I have one Apple script and its working fine on Mac. I want to use it into iPhone application. How can I integrate to iPhone application?
Also AppleScript uses Carbon and Carbon AppleEvents, so trying to get this on a iPhone is pretty much impossible you would pretty much have to write your own AppleScript interpreter, I also would not see much point in having AppleScripts on an iPhone since the main purpose of AppleScript is to control other applications by sending the AppleEvents. Have you thought about using JavaScripts I was looking at that for a web scraping application, using Javascript meant I could update the web scraping code quickly without having to resubmit my app to Apple.
Unfortunately, you can't easily do that. This excerpt is from the latest iOS Developer Program License Agreement:
3.3.2 ... Interpreted code may only be used in an Application if all scripts, code and interpreters are packaged in the Application and not downloaded. The only exception to the foregoing is scripts and code downloaded and run by Apple's built-in WebKit framework, provided that such scripts and code do not change the primary purpose of the Application by providing features or functionality that are inconsistent with the intended and advertised purpose of the Application as submitted to the App Store.
So, in theory it is allowed, nut since AppleScript is not supported by iOS SDK, you should also package an AppleScript interpreter with your app.

How I can integrate browser engine to my MASM app?

I'm developing an app on MASM using the RadASM IDE. This IDE comes with an IE control (WebBrowser) but the content that I want to display is broken on that browser (XHTML+CSS), also I want to remove the dependency of an external IE dll so the only solution that comes to my mind is use an engine of other browser like Firefox or Chrome.
I've searched over the net and I found some DevKits that meets my requeriments, but they are designed to work with VS2005+ or they just are coded on C++.
If someone know a way to integrate a browser engine (Not IE) to a MASM app, will be highly appretiated.
I doubt you will find any browser SDK that specifically helps you call it from assembly language. Almost nobody actually writes applications in assembly language today. However, C is pretty close to assembly, so all you have to do is use the instructions for C and translate to assembly language. Since you're already writing an application in assembly language, that should be no trouble for you.
You can use any SDK that comes with pre-compiled binaries using the WinAPI functions LoadLibraryA and GetProcAddress. Or you can build your own import libraries for MASM by following what either Iczelion did write on that topic (definately worth a read) or by reading the 3 part guide on my website, which is based on Iczelions guide but works on a live example, namely creating your own MASM import library for the FMOD API.
Weather it is worth all the hassle is another question.

a couple questions about the titanium platform

I have recently been browsing frameworks such as JavaScriptMVC, qooxdoo, Sproutcore and others alike which are using javascript to create desktop-like apps in the browser with minimal, or none css/html (depending on the framework).
What I know of titanium is that it uses html/css for the views, and language of choice (javascript, ruby,python,php) for everything else. Then it gets compiled(?) into a native app.
What are the quirks? if any?
Is it necessary for the user to install some sort of a runtime to execute the compiled app?
I suppose javascript is the prefered language, but how are the other ones handled?
For example, which Ruby interpreter would be included, would I be albe to use the ruby stdlib or external libraries? Would it affect the speed of the app? I.e JS > Ruby in terms of speed.
Since the views are CSS/HTML, would it still be necessary to style the elements, add them effects via JS librarier to achieve a widget-like feeling? Or does it come with some pre-made settings/classes for that?
I am not sure if it applies to the desktop package, but is there some syncing with the appcelerator's server required? What would it be necessary for?
I am sorry if the questions sound stupid, but I didn't even realise there are than many tools until recent. I am ultimately looking for something which is easy to use, has an option to work with a back-end server for data exchange, looks preferably good 'out of the box' or doesnt require that much work to get it themed nicely and works on mobile as well as desktop devices.
With Titanium you build your app out using javascript. Titanium ultimately generates its own XCode project for you that is compiled and deployed to a device.
The user does not require any runtime be installed prior to installing your app.
Unless your building custom modules to hook up your own controls you stick with javascript.
Your javascript calls end up as native controls, early versions required css like styling due to reliance on webkit but this is no longer the case.
There is no IDE but it does come with an app to create Titanium projects, test in emulator, deploy etc. It also talks back to HQ for updates.
In answer to (2), Titanium Mobile is Javascript only, but Desktop also supports Python, Perl and PHP.

How to write a cross-platform program?

Greetings,
I want to write a small cross-platform utility program with GUI in it. What language/GUI-library should I stick to? Is it possible whatsoever?
This is gonna be a small program, so I don't want to make people download JVM or .NET Framework. Is it possible to develop it natively?
Update 1.
By "natively" I mean that the end result will be native code without intermediate layers like Java Virtual Machine or .NET Common Language Runtime
Update 2.
A FREE solution is preferable ;)
If you know C or C++ the first cross platform GUI framework I can think of are:
QT (C++, proprietary but free with the LGPL licensing)
wxWidgets (C++, the most complete and stable but also huge)
FLTK (C++)
FOX (C++)
IUP (C, simpler and cleaner than the ones above)
If you know Pascal, you can try freepascal+Lazarus. I've never used it, though.
The problem is: If you do not want to have a GUI but you do not want to ask the user to download an eternal API, Framework or virtual machine to run it in, be it TCL/TK, Java or QT etc. then you get lost pretty fast.
The reason is: You would have to rebuild all the (GUI) functionality those APIs, frameworks and virtual machines provide you with to be platform independent. And that's a whole lot of work to do... .
On the other side: The Java virtual machine is installed on nearly any operating system from scratch, why not give this one a shot?
You want to develop a cross-platform program natively? Uh...I don't think that'll work, mainly because that phrase is a paradox. If you write native code, it by its very nature will only run on the platform you programmed it for. ;-) That's what the Frameworks are all about.
So what you should do instead is use a very slim framework if your program is going to be so small. itsmatt's idea of Qt is a possibility.
WxWindows? Oh, it's called WxWidgets now: http://www.wxwidgets.org/
wxWidgets has bindings to all sorts of languages - python for instance, if your app is small enough.
Lazarus is great. GTK2 on Linux, win32/64 on Windows, WINCE on euh, Wince. It even uses Carbon on Mac (working on COCOA). Also easy to sell to your boss (the code is Delphi compatible)
How about Python using Qt or Wx and then using PythonToExe to make a 'distributable'
Thought will have to giving to the development to ensure that no native functionality is used (i.e. registry etc.) Also things like line breaks in text files will have different escape characters so will need to be handled
Which OS's do you have in mind when you say cross-platform?
As Epaga correctly points out, native and cross-platform are mutually exclusive. You can either write multiple versions that run natively on multiple platforms, or you need to use some cross-platform framework.
In the case of the cross-platform framework approach, there will always be extra installs required. For example, many here suggest using Python and one of its frameworks. This would necessitate instructing people to install python - and potentially the framework - first.
If you are aiming at Windows and OS X (and are prepared to experiment with alpha-release code for Linux if support for that OS is required), I'd highly recommend you take a look at using Adobe AIR for cross-platform GUI applications.
I agree with Georgi, Java is the way to go. With a bit of work, you can make your desktop application work as a Java applet too (so that users do not need to actively download anything at all). See http://www.geogebra.org as an example of an application with runs smoothly as a cross-platform Java application AND has a simple port to a web applet.
Two other advantages to using Java are:
They have extensive libraries for building the UI, including UI component builders.
The Java runtime framework is generally updated automatically for the user.
One disadvantage:
The version of Java installed on your end users computer may not be totally compatible with your application, requiring you to code to the lowest likely denominator.
Try RealBasic. Visual Basic-like syntax, targets Win32, OS X and Linux. I don't know any details about targetting Linux, but for any cross-platform development I've done between Win32 and OS X its been a dream.
http://www.realbasic.com
Edit: Generates native executables. There is a small cost - $100.
Have you looked at Qt?
Flash? It's installed pretty much everywhere.
If it "HAS" to be Desktop use Qt. Nothing beats it right now.
However personally I gave up on desktop and any UI based project I do is normally Browser/Server based. You can easily write a little custom server that listens to some port so the program can run locally with no need for your users to install Apache or have access to the net. I have a small Lua, Python and C++ framework I made for that purpose (Want to add Javascript for the backend with V8 :)
If you're going to look at Qt and WxWidgets, don't forget to also check out GTK+ !
I agree with David Wees and Georgi,
Java is cross-platformness par excellence. You literally write once and run everywhere. With no need of compiling your code for each target OS or bitness, no worries about linking against anything, etc.
Only thing is, as you pointed out, that a JRE must be installed, but it's quick and straightforward to do even for novice end-users (it's a matter of clicking "Next>" a few times in the installer).
And with Java Web Start deployment gets even easier: the user just clicks the launch button on a webpage and the application runs (if the proper JVM is installed according to what specified in the JNLP descriptor) or the user gets redirected to the Java download page (if no suitable JVM is found).