Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Javascript IDE that has nothing to do with a browser?

Tags:

javascript

ide

Does anyone know of a program that lets you write javascript; then execute it - all the while having nothing to do with a browser? I don't want DOM manipulation, the equivalent of Console.Write is enough for me.

I'm thinking of something along the lines of DrScheme - nice big code editing window, let's you run it, stop it. While all the other features (debugging, etc) would be wicked, they're not vital. DrScheme
(source: plt-scheme.org)

like image 818
Tom Ritter Avatar asked Jun 14 '09 22:06

Tom Ritter


1 Answers

I've been doing some JavaScript work lately using Mozilla Rhino (basically scripting the Apache POI library), which is a JavaScript interpreter written in Java (you can also compile JavaScript scripts to Java classes). I was running my scripts from command line, but I could have easily set my editor (PSPad) to execute and output the script result inside the editor. I believe the same can be done in Eclipse using External Tools, if that's what you're more comfortable with.

Using Mozilla Rhino is kinda nice. You aren't bothered by all the browser quirks out there and you get a pretty nice version of JavaScript to work with, version 1.7. This version of JavaScript has iterators, generators, let expressions, array comprehensions, destructuring assignment, new array functions and Mozilla Rhino has even built in support for continuations.

The down side of Mozilla Rhino is that its exceptions reports are inconsistent and not that informative at times (sometimes the file name and file line is missing). On the other hand though, the package ships with a debugger built with Java Swing. You can set break points right there and do all the things you'd do with a normal debugger.

I've been using a binary version compiled by myself from the CVS sources as there was a bug in the implementations of iterators, which Norris Boyd fixed it immediately after I reported it.

like image 93
Ionuț G. Stan Avatar answered Nov 15 '22 21:11

Ionuț G. Stan