2

Are there any good JavaScript frameworks out there which primary audience is not web programming? Especially frameworks/libraries which improves the object orientation? The framework should be usable within an desktop application embedding a JavaScript engine (such as Spidermonkey or JavaScriptCore), so no external dependency are allowed.

5 Answers 5

4

As far as "improving object orientation" goes, Javascript is already great. You just need to get used to thinking in prototypes instead of classes.

After reading Douglas Crawford's great page on prototypal inheritance I really started to enjoy working with javascript. (He also has a page on class inheritance if you must use classes.)

Edit: If by asking for a framework you also mean, helpful libraries that don't use the DOM, you might be interested in Functional Javascript.

Sign up to request clarification or add additional context in comments.

2 Comments

Well, Javascript as a language is rather chatty, at least for me who is coming from a python background. A framework to reduce the amount of typing needed would be great.
I'm a Python user too, so I know what you mean :) For me the biggest pain in javascript is the for loop, but the Functional library mentioned in my edit greatly helps that.
3

Dojo can be used (and is used) in non-browser environments (e.g., Rhino, Jaxer, SpiderMonkey). It can be easily adapted for other environments too — all DOM-related functions are separated from functions dealing with global language features.

dojo.declare() (more docs) comes in the Dojo Base (as soon as you load dojo.js) and implements full-blown OOP with single- and multiple- inheritance, automatic constructor chaining, and super-calls. In fact it is the cornerstone of many Dojo facilities.

Of course there are more low-level facilities like dojo.mixin() to mix objects together and dojo.extend() to extend a prototype dynamically.

More language-related features can be found in dojox.lang. Following parts of it are thoroughly explained and documented: functional, AOP, recursion combinators.

Dojo comes with other batteries included from string-related algorithms to the date processing. If you are interested in those you can discover them yourself, or contact the Dojo community.

Comments

0

Objective-J(avascript) is one. Is that the kind of thing you are looking for?

1 Comment

Not really. I'm just looking for a framework, not another language.
0

The most widely known one is XULRunner from Mozilla. This is framework that FireFox and Thunderbird are built on.

https://developer.mozilla.org/en/XULRunner

Although not strictly javascript only, it incorporates a host of technologies closely tied to web for the purposes of building desktop applications.

1 Comment

I'm actually using the javascript engine (spidermonkey) from xulrunner, but I don want the rest of the technoligies related to firefox such as gecko,xpcom,xpconnect etc. I have my own replacement for those.
0

Have you looked at Adobe Air? It allows you to use JavaScript/AJAX to write Desktop applications.

http://www.adobe.com/products/air/

2 Comments

Not interested in web stuff. Besides, is air really free software?
You never mentioned 'free' Johan.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.