Ask HN: Javascript for desktop apps?
I've been wanting to learn Javascript lately, and I've become curious as to how Javascript/ECMAscript fares as a language for writing software to be ran on the desktop. Are there any ECMAscript implementations with good FFIs? Are the good libraries/bindings for writing GUI desktop apps in ECMAscript? Is it possible to get acceptable performance(comparable to Python or at least Ruby, perhaps?) from ECMAscript?
If you were writing a desktop app in ECMAscript, which implementation would you use? Would you actually consider using ECMAscript to write a desktop app?
Are there any good books or other resources you would recommend on writing desktop apps in ECMAscript?
24 comments
[ 5.2 ms ] story [ 102 ms ] threadThis language (which is a good implementation of up-to-date ECMAScript) is somewhat light on texts however. There is a SAMS book by Justin Rogers which does cover the basics.
You might be better off looking at something like Adobe AIR which is an excellent approach to making a web style application run like a desktop application - well worth exploring and could be a good platform for developing portable (and applicable) JavaScript skills.
I've built a music management system along these lines and it works quite well. The internet ready part of it causes all kinds of unintended but useful side effects, stuff that I never thought of when building it.
I think it would be nice to have a launcher that launches both the client and the server then.
Depending on what you're trying to do you might want to try XUL Runner https://developer.mozilla.org/en/XULRunner . It will allow you build an html/js app that can run as a desktop app.
https://developer.mozilla.org/en/Rhino_documentation
Steve Yegge suggests it's the next big language.
Execution is as simple as 'jrunscript app.js'.
Written mostly in javascript, with dynamically-generated bindings to GTK+ et al.
GTK+ can be a pita to install, but it's as cross-platform as anything else.
http://techbase.kde.org/Development/Tutorials/Plasma/JavaScr...
Lua has also already been in use as a server-side and desktop language for some time, and while the available toolkits pale in comparison to what's available, say, for Java, Python or Ruby, there are still more options than there are for Javascript right now. Lua is very fast; for most benchmarks at http://shootout.alioth.debian.org it's the fastest interpreted language.
Sorry this is doesn't exactly answer the question you're asking but I thought it might be worth mentioning as another possibility to consider.