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'' ...
s. It is a language used primarily by applications written in C or C++ using
GNU GNU () is an extensive collection of free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any ...
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 ...
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 imp ...
or C++, with the C++ support being native instead of "extern C".


History

Jsi was created as an embedded application replacement for Tcl 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. 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 s ...
. 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 mo ...
,
WebSocket WebSocket is a computer communications protocol, providing full-duplex communication channels over a single Transmission Control Protocol, TCP connection. The WebSocket protocol was standardized by the Internet Engineering Task Force, IETF as in ...
, 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 fo ...
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 scriptin ...
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 The C date and time functions are a group of functions in the standard library of the C programming language implementing date and time manipulation operations. They provide support for time acquisition, conversion between date formats, and for ...
/
strptime The C date and time functions are a group of functions in the standard library of the C programming language implementing date and time manipulation operations. They provide support for time Time is the continued sequence of existence and ...
. * 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 sp ...
[]
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


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