Kabap

Kabap is a multi-platform ultra-lightweight solution for developers to expose safe & easy user scripting capabilities within their projects. Implement in <5 min

For source code please check out the project GitHub.
For code examples and language information check out the project on Rosetta Code.

The Kabap programming language is a multi-platform ultra-lightweight solution for developers to expose safe & easy user scripting capabilities within their projects. The aim of the project is provide a language which is easy for users to learn and is quick for developers to implement. Its target niche is the gap between when a solution is too complex to be represented in a graphical user interface and it is too dangerous to permit the direct execution of user-supplied code (through reflection or eval() or some other means).

Typical use cases are the user must supply a complex custom shipping calculation that is too hard to express as a UI but without permitting the user to edit PHP files; or the user needs to be able to visually control the elements of an app but that control is limited to only specific views so reflection cannot be used.

Kabap scripts (.kabap files) are interpreted during parsing in to a tokenised portable pseudo-bytebode executable format (.kat files). This format can also be saved and loaded directly to remove the expensive overhead of the parsing process. The tokenised format has 3 possible levels of optimisation for speed, from small optimisations like stripping comments and debug symbols, to large optimisations like full minification and removal of unused code.

Kabap implementations exist for Java (native JVM, Android and AWS Lambda), PHP and ECMAScript (JavaScript, Node.js). This deliberately targets common backend systems, apps, browsers and web servers. Because Kabap scripts are fully portable between platforms the same code can be run locally, on the server or in the cloud (or any combination thereof).

By default a Kabap instance is a fully sandboxed and secure minimal computing environment where the only things the user has access to are those the developer has chosen to expose to them. If further access is needed the language can be dynamically expanded with the inclusion of Kabap Extensions. Each platform has the default Standard Extensions available (File and Net, to provide local file access and remote network connectivity respectively). Platforms may also provide specific extensions (Kabap for Android provides a Toast extension for example).

The primary benefits of Kabap are:

Although Kabap is a relatively new language, it has been tested and proofed for the last year in a critical production environment.

Kabap logo contributed by Sara Sayer.