Origins of Jsi
Although not much of the original source code remains (Jsi is about 5 times larger) ancestry can be seen in the parser, eval-engine and test suite.
Jsi is a C-centric, byte-code interpreted focused on embedded development.
This makes it very different from Node-js, a C++-centric compiler that is non-trivial to embed.
Internally Jsi is modelled after Tcl.
A Glue Language
Like Tcl, Jsi is meant to be a glue language.
This means that time/space critical functionality is implemented in C, which scripting glues together:
- Scripting used where appropriate because coding is faster, more compact and more resilient than C.
- Major functionality implements as extensions, designed for gluing together with script.
- Software integrity is achieved by hardening C-extensions.
- In addition, a Lite C-API supports C-only development.
Testing is one example where efficiency is less important (eg. Sqlite Testing) and glue code can be helpful.
Jsi implements most of Ecma-script 262, version 5.1, with the following differences:
- Semicolons are never auto-inserted.
- Array and object elements may not be empty, eg [1,,3]
- Array object typeof  returns "array", not "object".
- Use of return inside of a try/catch is an error, and will not execute finally.
- Error object unimplemented (catch argument is a string).
- Date object unimplemented (alternative is strftime/strptime).
- UTF is currently unsupported.
- Support for (Ecma-script 6) Array of iterator, eg: for (var X of Y) .
- Functions support parameter types and defaults.
Following are the primary goals of Jsi:
- Support embedded development using plain C (C99).
- Compiles as C++ using gnu g++ (ie. with no extern C).
- Have as few dependencies as possible..
- Pass sanitize, being free of value/object/memory leaks.
- Provide simple application integration .
- Have a C-only Lite version.
- Provide a Debugger.
- Support Web applications, particularly with database and websockets.
- Support standalone applications via self-mounting .zip.
- Package and extension support.
Note: C-integration is the main priority, not script execution speed. The C++ compile option is mostly for integrity checking.
Following is a partial list of things that are either incomplete or unimplemented:
- Creation of a complete test suite for code-coverage.
- Run applications directly from fossil.
- Improved and more accurate error/warning messages.
- A PostgreSql extension.
- UTF support.
- Non-external implementations of httpd and/or websocket.
- Extension for libmicrohttpd for use in post.
- Desktop applications are held hostage by their user interface, be it QT, GTK, IOS or .NET.
- Increasingly web browsers are becoming the GUI, usually over the Internet.
- Moderately complex applications often end up requiring some form of script support, eg. Lua.
- Time, energy and resources can be saved by using the same language on both ends.
- In fact, the same scripts can even be run in both the browser and the app.
- JSON provides seamless data interchange, thus avoiding data structure compatibility issues.