|
GSR
GPSEE Script Runner
Introductiongsr is the standard GPSEE Script Runner ("scripting host"). This is a program, built with GPSEE-core, which allows users to run CommonJS programs in the GPSEE environment. If you are using GPSEE simply to run CommonJS programs as shell scripts, then this the executable you are looking for. If you want a fancy interactive REPL, you might want to look at JSIE, or [gpsee-js]. If you are embedding GPSEE into your own software, gsr may provide an alternative to minimal.c as a starting point, and can serve as a test or evaluation platform. Recommended Flags
Reserved Options and Flags
Command Line Helpgsr 1.0-pre1 - GPSEE Script Runner for GPSEE 0.2-pre1 Copyright (c) 2007-2009 PageMail, Inc. All Rights Reserved. Sample gsr program#! /usr/bin/gsr -dd
print("Hello, world!");Don't forget to give it execute permissions: chmod 755 myprogram.js Shebang Path & /usr/bin/envHistorically, we have expected a link to your gsr installation in /usr/bin. A fixed location is required to do /usr/bin/env's inability to pass along shebang arguments (i.e. -dd above). An alternate solution, which will allow gsr to be found anywhere along your PATH, allows comment-embedded options. This is outlined in Issue 12. Pre-compiled CodeBy default, all GPSEE programs support pre-compiled JavaScript. What this means is that JavaScript byte code is recorded to disk when it is tokenized for the first time, and loaded on subsequent invocations rather than re-tokenizing. When GSR is run with the -n option, the pre-compiled JavaScript will be generated even though the script is not executed. You can avoid this side effect with -nC if desired. Pre-compilation requires that the user running the script have write access to the directory where the script is located. Inability to update to the pre-compiled tokens, due to permission errors or other reasons, will not affect the correct execution of the program. |