A scripting language developed by Joshua Pollak and the core development team of HuskyLabs, Inc. in early 1998. Its purpose was to facilitate collaboration beween web design experts and the developers who wrote web-app backends. Inspired by the then-nascent ASP, Sanscript strove for a balance of simplicity and unobtrusiveness to the non-coder.
The name was derived from the word "sanscrit". The company's main product was called Chakra, and involved Shakti and Kayas. The developers had been calling it things like "kick-ass" and "BTL" ("better than livewire"), listing the ideas up on a whiteboard. The president heard about the naming woes, walked in and wrote "Sanscript" up on the board and circled it, and walked out.
Sanscript commands were embedded in HTML comment tags. Unlike ASP or JSP, which would follow later, Sanscript commands appeared in individual tags instead of as blocks of code. Basic Sanscript commands were just Java object references or method invocations. The result of such a reference replaced the tag in the output stream using Java's toString mechanism. Otherwise, Sanscript recognizes the folowing commands:
- <!--REQUIRE keyref-->
- generates an error if keyref could not be resolved into an object. keyref is usually a quoted string literal.
- <!--OPTIONAL keyref (DEFAULT value)?-->
- if keyref could not be resolved into an object, value is assigned to keyref. keyref is usually a quoted string literal.
- <!--INCLUDE value-->
- retrieves the resource indicated by value, which may be a URL or a system resource (i.e. something in your classpath), and replaces this tag in the input stream with the resource, running through the scripting engine as if it had appeared instead of the INCLUDE tag.
- <!--THROW exceptionref-->
- throws an exception out of the script engine
to the caller.
- halts script processing, returning to the caller, or original script, if it appears in an INCLUDEd resource. Originally STOP.
- <!--LET keyref = value-->
- performs a value assignment. keyref is usually a quoted string literal.
- <!--LOOP listref (INTO keyref)?--> ... <!--/LOOP-->
- (block) loop through a list once for each item, which is assigned to keyref each time. If the INTO clause is omitted, the item will be available via its classname.
- <!--IF value--> ... <!--/IF-->
- <!--IF value--> ... <!--/IF ELSE--> ... <!--/ELSE-->
- <!--IF value--> ... <!--/IF ELSE IF value--> ...
- (block) conditionally execute the following block of script. If value resolves to something other than a boolean value, any non-
null result is interpreted as
- <!--SKIP--> ... <!--/SKIP-->
- (block) do not execute the following block of script. SKIP tags may be nested like any other Sanscript block tag.
Code examples and more information will be added soon.