Subj : Re: ECMAScript standards committee To : netscape.public.mozilla.jseng From : Igor Bukanov Date : Wed Oct 20 2004 04:54 pm zwetan wrote: >>... >> >>>right now the only easy way to produce an exe with JS >>>is to use JScript.NET (yep even in classic mode, /fast-). >> >>This is not true: you can use Rhino JVM class compiler + GCJ to produce >>executables on any platform where GCJ is available. Since all the >>necessary steps can be done in a simple shell script, I do not think it >>is a hard way. >> > > > ok, I have expressed myself badly > > "easy way to produce an exe" is somewhat very subjective > > what I meant was if you want to produce un exe application > targeting windows, but from an user point of view knowing only JS > > .NET: > jsc /fast- /out:blah.exe blah.js > then > click the exe to run the app > > Java: (rhino's JSC) > $ java org.mozilla.javascript.tools.jsc.Main blah.js > then (still in the console) > $ java blah > > for .NET after the compilation > you just have to warn your user to have > the .NET framework installed > > for Java after you got your class/bytecode generated > you need to do more work to produce an exe, > for exemple use swt-win32 > and also warn your user to have the Java RunTime installed No, with GCJ it is possible to write a Perl/shell script that can be used as rhinoJsToExe -o blah.exe blah1.js blah2.js ... to assemble Windows executable with JS scripts translated to native code. Obviously you can not make executables from AWT/Swing scripts as GCJ does not support AWT but since GCJ supports SWT, SWT GUI in JS as native executable is possible. In SpiderMonkey you can do almost the same with a script that would embed your JS code into C source and then compile/link it with XPCShell code. This would give you executable with embedded JS that can access arbitrary ActiveX object. The usage for script would be jsToExe -o blah.exe blah1.js blah2.js ... But I fail to see why converting JS to excutables is any better then associating .js with appropriate interpreter so in Windows one can simply double click on the script to execute it. Regards, Igor .