jackxiao / jslibs

Automatically exported from code.google.com/p/jslibs
0 stars 0 forks source link

rc script #72

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
An script run on startup of jslibs would be very useful to have.

In Common Lisp we normally have a rc script for whatever Lisp interpreter
we are running (for SBCL ~/.sbclrc, for CLISP ~/.clisprc (i think), and so
on...)

A ~/.jslibsrc script file that would be Exec'ed when jshost is run before
the script is run would be handy.

The simplest use of this would be if someone made common use of a function.
ie: They used a PrintLine extension to Print all the time. They could just
define PrintLine in ~/.jslibsrc

Though that's not the underlying intended use. My JSDF system would make
good use of a ~/.jslibsrc in the same way that ASDF makes use of ~/.****rc
files for Common Lisp.

Basically someone would download JSDF, use the script included to download
a variety of JavaScript libraries. Various programs would use LoadSystem to
load needed libraries and modules. And inside of ~/.jslibsrc one would Exec
the jsdf system and define the locations where they download the libraries.
That way all LoadSystem calls would know where systems are located.

Original issue reported on code.google.com by nadir.se...@gmail.com on 15 Nov 2008 at 6:39

GoogleCodeExporter commented 9 years ago
I think this is not the role of jslibs to do such things.

Original comment by sou...@gmail.com on 15 Nov 2008 at 7:47

GoogleCodeExporter commented 9 years ago
Possible workarounds:
- Use the shebang to launch the script without using jshost.
- Use an small intermediate .sh or .bat .

Original comment by sou...@gmail.com on 16 Nov 2008 at 8:24

GoogleCodeExporter commented 9 years ago
I added the ability to embed a XDR compiled script into jshost and jswinhost 
binaries.
This is done at the compilation time.
The file embeddedBootstrapScript.js is compiled, serialized (using XDR) and 
stored as
a data resource in the binary.
In addition, jshost has now the same ability as jswinhost, if it is launched 
with -b
command line option, it will execute the JS script file that has the same name 
as the
binary. ie. jshost.exe.js on windows and jshost.js on Linux (perhaps I will 
remove
the ".exe" part)

Original comment by sou...@gmail.com on 19 May 2009 at 10:21

GoogleCodeExporter commented 9 years ago
Oh heh... by this point I already planned on setting up an actual host 
environment
for monkeyscript.

Original comment by nadir.se...@gmail.com on 19 May 2009 at 10:25