mckyj57 wrote:
On Sep 8, 2:04 pm, Daryl Stultz <[email protected]> wrote:
On Tue, Sep 8, 2009 at 1:20 PM, mckyj57 <[email protected]> wrote:
I don't want to learn about Java. I want to use a Java application.
I don't think of Rhino as an "application" but rather a "library" for
embedding JavaScript in a Java application. If you don't have a Java
application you want to expose to JavaScript, this probably isn't the
project for you. Maybe you should look for a different JavaScript
interpreter.

Thank you. It came up as the top match when I searched for "linux
JavaScript interpreter". Perhaps I was unrealistic to expect to find
something as simple as being able to do "cat script.js | js" like I
can "cat script.pl | perl -wc". After all, Python doesn't have one
either -- you have to do "python -c 'import foo'".

I still think it would make sense to provide a README, INSTALL, or
other file that gave you something useful you can do from top to
bottom. If it said at the top of the README that the audience was Java
developers, I would quietly delete the file and look for the next
thing.
spidermonkey is the other JavaScript interpreter Mozilla has, I'm not sure about it's install (it should be in the README or somewhere in that case) but it should have more of that same compiled sort of feel.

The big /issue/ (besides documentation within the open-source community as someone else noted) is Java's portability. Java applications can be built and distributed as a .jar that can be run on nearly any system, but as a side effect that means that because you no longer have a compiled executable (you can't build a portable executable that works on any system by dropping it in place, you need to compile for the system) you have to execute all apps through a central point `java`. Note that like your example above in this case `java` is the equivalent of `perl`. You're executing Java, which executes Rhino.

As for the note on `man`... I haven't actually seen any project myself which does include man pages. afaik, that's normally the kind of thing added by a package maintainer or might be included in a linux specific app.

Actually on that note, what distro are you using?
I know Ubuntu has a spidermonkey-bin which should easily install SpiderMonkey and provide you with a js binary that'll open a shell for you just by typing `js`.

Side notes.

You're linting a JavaScript file? Unlike the other languages I don't believe I have seen any of the js interpreters offering a lint command, just execution. There is jslint, and it appears to have a way to use rhino to lint files on your machine: http://www.jslint.com/rhino/index.html

Other than interpreters there are environments/engines that build on top of them, you might want to look at some of them. The CommonJS <http://groups.google.com/group/commonjs> pesudo-wg group is working on standardizing out-of-browser JavaScript and a variety of projects are participating in it. Mine is MonkeyScript <http://monkeyscript.org/> though MonkeyScript Lite (the implementation that uses Rhino) is a bit documentation lacking and I haven't setup an install yet. Though I have gotten to a point where on *nix with the help of a nice ./setenv.js to tweak some env variables you can easily call `monkeyscript` `jake` (Like ruby's Rake) and `banana` (My package tool, like gem... so far it just creates package registries), since I wrote some bash scripts (I'll do .bat for Windows sometime in the future). <solicitation>I have all the information chunked in my head, if you felt like it I could give you all the information needed to write a USE page or README, that's just not something as easy for me to write as a whole api spec or code. Heck, considering your notes, I might consider adding a simple lint mode to monkeyscript.</solicitation>

--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to