views:

785

answers:

7

I'd like to write some small applications for Windows and OSX.

Portable is good. For instance, the simple TclKit solution for TCL would work well if I could stand to look at Tcl for any length of time.

I'm considering using Javascript + extensions -- I really like Javascript -- seems to me there should be some way to connect a Javascript engine to WxWin or even the Tk toolset -- it's been done for Perl, Python, Ruby, etc. Why not JS?

Any comments appreciated.

+3  A: 

If you want to write a desktop app in Javascript, check out HTA: http://msdn.microsoft.com/en-us/library/ms536496(VS.85).aspx

Here is an example of an app that I wrote a long time ago in HTA: http://www.boltbait.com/htmleditor/

Hope this helps.

BoltBait
Why the down vote? I answered the question and gave an example. I'm curious why you didn't find my answer helpful. Please explain so that I don't make the same mistake again. Thanks.
BoltBait
I would imagine that there might be some difficulty running an HTA in OS X...
wrt
True. Good thing the OP wrote "...or Windows app".
BoltBait
+7  A: 

I would rather recommend using Adobe Air execution container, it offers way more capabilities / OS integration features compared to HTA of Microsoft or even XULRunner of Mozilla.

Sergey Ilinsky
A: 

Rhino would probably give you access to swing. Though, I don't know how much work would be involved.

On the other hand, building a swing app with JRuby is so easy even a sock puppet can do it, so it shouldn't be too hard.

Aaron Maenpaa
+2  A: 

If you have experience with HTML+JS web applications, I'd recommend Mozilla XULRunner. It gives you native-looking interface widgets (every piece of Firefox interface is a XUL element), and a workflow similar to building HTML-based interface.

You define the interface using XUL, an XML-based language, so it's almost like writing HTML, minus browser incompatibilities and CSS (you can use CSS, but only if you want). All application logic can be written in JavaScript, but in XULRunner you can do a lot more in JS than in a browser (read/write files, execute system commands, make cross-domain XMLHTTPRequests, and a lot of other stuff).

More: http://xulplanet.com/

A lot of example applications: http://code.google.com/p/xulapps/

pawel
It also make sense to mention XBL, one of the most powerful core technologies enabled in Gecko. XBL allows developer to writing binding documents that can implement logic and define layout for abstract components that later on can be bound to the elements on the hosting page.
Sergey Ilinsky
A: 

Definitely if you want to implement it using JavaScript, Adobe Air is the way to go. You will even have support on Linux.

jaircazarin-old-account
+1  A: 

Mac OS X users tend to dislike applications that don't follow usability guidelines of the platform (menu must be at top of the screen, standard shortcuts & drag'n'drop must work, "OK" must be at right-hand side of alertboxes, no "Apply" button in prefs and so on).

With one-size-fits-all toolkit this may be very difficult to achieve.

The good news is that there's JavaScript<>Cocoa bridge that can be used to create stand-alone full-featured Mac OS X application in JS – just keep front-end and back-end of your application separate enough to be able to plug different UI for each OS.

porneL
A: 

Give Titanium Appceletaror a look: http://www.appcelerator.com/.

ravi