jsish
Home
Not logged in

Jsi is a small javascript interpreter designed for embedding in C and integrating Database and Web code.

Features


Enhancements

Jsi provides the following enhancements to vanilla Javascript.

Functions

Functions can specify types for parameters/return, with warnings when called with mismatched types or number of arguments.

function foo (a:number, b:string):number {
   return a+1;
}

Parameters can also be given a default value, allowing them to be called with reduced arguments:

function foo (a:number=0, b:string='') {
}
foo(99);

System

The System methods contain all the builtin toplevel commands in Jsi, which can be invoked either at the toplevel, or via System, eg:

puts('hi');
System.puts('hi');

OS-Support

Jsi provides several Operating-System enhancements:

Filesystem

There are several File-system related groups of commands:

Modules

Modules can interprets Js files or load extension commands upon their first invocation using source and load.

Threads

Threads are supported in Jsi, by allowing interps to run in their own thread.

Interp

Jsi executes scripts in a context called an interpreter. This provides a number of configurable runtime options.

Info

The Info commands provide Jsi with introspection capabilities.


Extensions

Sqlite

Jsi comes with an Sqlite driver that by default is builtin to jsish. To ensure standalone compatibility, it also includes the source to a version of Sqlite.

MySql

Jsi comes with a MySql driver. It is not by default builtin to jsish. But it can be added easily enough, or built into a shared library and loaded dynamically.

Websocket

Jsi comes with an Libwebsocket driver that by default is builtin to jsish. To ensure standalone compatibility, it also includes the source to a version of Libwebsocket.

Socket

The Socket extension provides access to both TCP and UDP sockets

Zvfs

Jsi allows the creation of Zero Install database applications with seamless web access. Moreover, as Jsi's C-API is modelled after Tcl, it is well suited for embedded development.

C-API

Amalgamation

Amalgamation provides the source for all Jsi files wrapped into file jsi.c.

Jsi-Lite

Jsi-Lite is the set of functions from jsi.c usable in C without an interpreter.

Jsi_DbQuery

Jsi_DbQuery is the part of Jsi-Lite used for accelerated Sqlite-C development .

Jsi_DString

Jsi_DString provides efficient, stack-oriented string handling for C.

C-Extensions

C-Extensions are where Jsi shines.