← All repos

LJSON

JSON extended with pure functions.

Browse cluster: Functional Programming & Type Theory
44commits
7contributors
1languages

Tech stack & purpose

LJSON is a JSON extension that enables serialization and deserialization of pure functions alongside standard JSON data types. Built in JavaScript, it allows developers to safely interchange code by restricting functions to pure operations without side effects, solving the security challenges that arise when applications need to accept user-defined code—such as in online games where players define character control scripts. The project provides core stringify and parse functions mirroring JSON's API, along with utility functions like `withLib` and `parseWithStdLib` that allow functions to access only explicitly provided primitive operations, ensuring that serialized code can only perform actions the developer permits. A PHP port is also available, and the project has a spiritual successor called Moon-lang that extends the concept with primitive operations.

Languages

JavaScript
100.0%

Contributors