Jsish
   HOME

TheInfoList



OR:

JavaScript Interpreter SHell (Jsish or Jsi for short) is a scripting language designed for use in
embedded system An embedded system is a computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is ''embedded'' as ...
s. It is a language used primarily by applications written in C or
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
using
GNU GNU () is an extensive collection of free software (383 packages as of January 2022), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operat ...
tool-chains.
MinGW MinGW ("Minimalist GNU for Windows"), formerly mingw32, is a free and open source software development environment to create Microsoft Windows applications. MinGW includes a port of the GNU Compiler Collection (GCC), GNU Binutils for Windows ( ...
provides
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
compatibility. Jsi code compiles as either
C99 C99 (previously known as C9X) is an informal name for ISO/IEC 9899:1999, a past version of the C programming language standard. It extends the previous version ( C90) with new features for the language and the standard library, and helps impl ...
or C++, with the C++ support being native instead of "extern C".


History

Jsi was created as an embedded application replacement for
Tcl TCL or Tcl or TCLs may refer to: Business * TCL Technology, a Chinese consumer electronics and appliance company **TCL Electronics, a subsidiary of TCL Technology * Texas Collegiate League, a collegiate baseball league * Trade Centre Limited ...
and JimTcl. Its main goal is to provide embedded scripting using a mostly standard syntax (
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
), as opposed to the idiosyncratic ones used in Tcl,
Lua Lua or LUA may refer to: Science and technology * Lua (programming language) * Latvia University of Agriculture * Last universal ancestor, in evolution Ethnicity and language * Lua people, of Laos * Lawa people, of Thailand sometimes referred t ...
, and
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
. A secondary goal is data compatibility with
Web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
s using
JSON JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
. Speed is not a major goal. Life for Jsi started as a fork of the quad-wheel interpreter. Eventually, most of the major internal features of Tcl were added. The current implementation is nearly 10 times the size of the original, and very little of the original code remains.


Features

Jsi comes with builtin support for
SQLite SQLite (, ) is a database engine written in the C programming language. It is not a standalone app; rather, it is a library that software developers embed in their apps. As such, it belongs to the family of embedded databases. It is the most ...
,
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single TCP connection. The WebSocket protocol was standardized by the IETF as in 2011. The current API specification allowing web applications ...
, and self-hosting ZIP file-systems. The jsish executable is unusual in that it integrates a self-mounting file system containing builtin utilities and applications. These include Debugger and Web-Server; the latter is used to provide web user-interfaces for Debugger and SQLite. Each of these applications can be accessed via jsish command-line arguments. Jsi is highly independent: * The configuration script for Jsi is itself written in Jsi. To achieve this, a minimal standalone jsish is first built to bootstrap configuration. * An amalgamated source file is provided to support trivial integration into existing applications. * The jsish binary can be built and statically linked against
musl musl is a C standard library intended for operating systems based on the Linux kernel, released under the MIT License. It was developed by Rich Felker with the goal to write a clean, efficient and standards-conformant libc implementation. Ov ...
to produce a standalone with no external dependencies. Scripts and extensions are unusually robust due to functions that support
duck Duck is the common name for numerous species of waterfowl in the family Anatidae. Ducks are generally smaller and shorter-necked than swans and geese, which are members of the same family. Divided among several subfamilies, they are a form t ...
typed-parameters. The implementation is mature and has a rich and resilient development environment that includes integrated logging, asserts and strict mode. As of version 2.4, released in December 2017, Jsi is considered to be feature-stable.


ECMAScript

Jsi implements version 5.1. of the
ECMAScript ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262 ECMAScript is commonly used for client-side scripting o ...
standard, with the following deviations: * No
automatic semicolon insertion In computer science, lexical analysis, lexing or tokenization is the process of converting a sequence of characters (such as in a computer program or web page) into a sequence of ''lexical tokens'' ( strings with an assigned and thus identified ...
. * Empty array/object elements are not supported. * It is an error to use return inside of a try/catch body. * The Error object is unimplemented: the argument to catch() is just a string. * The Date object is unimplemented: use strftime/ strptime. * The value of
typeof typeof, alternately also typeOf, and TypeOf, is an operator provided by several programming languages to determine the data type of a variable. This is useful when constructing programs that must accept multiple types of data without explicitly s ...
[]
is "array" instead of "object". * UTF is currently not supported. There is one major extension: function definitions can use types and defaults.


See also

* Comparison of programming languages *
List of ECMAScript engines An ECMAScript engine is a program that executes source code written in a version of the ECMAScript language standard, for example, JavaScript. Just-in-time compilation engines These are new generation ECMAScript engines for web browsers, all i ...


References


External links

* {{Use dmy dates, date=September 2017 Cross-platform free software Cross-platform software Dynamically typed programming languages Embedded systems Free compilers and interpreters Free computer libraries Free software programmed in C Prototype-based programming languages Scripting languages Software using the MIT license