{{language |exec=both |site=https://kabap.org |gc=no |parampass=value |safety=unsafe |strength=weak |compat=duck |express=implicit |checking=dynamic |untyped=yes |tags=kabap, kabaptokens |hopl=no |LCT=yes}}

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|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|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:

  • Cross-[[platform]] (Write Once, Run Anywhere)
  • Easy for users to learn the language
  • Possible for developers to implement in under 5 minutes
  • Secure sandboxed environment by default
  • Standard Extensions to provide additional functionality (File and Net)
  • Easy for developers to create their own extensions for specific use cases
  • Simple clean code which is well documented
  • Implementations are around only 1500 lines of code
  • Large cross-platform unit test suite to verify all implementations
  • Fully open source development

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

Useful Kabap links:

  • https://kabap.org
  • https://github.com/KabapLang