{"id":25853,"library":"lambdajson-js","title":"LambdaJSON-js","description":"A compiler that translates LambdaJSON — a pure functional programming language represented in JSON — into executable JavaScript functions. Current stable version is 1.1.8. The library is designed for embedding functional logic defined entirely in JSON, with no external dependencies and a small footprint. Key differentiators: no runtime, compiles to plain JS; pure functional semantics; good for dynamic expression evaluation in JSON-based systems. Release cadence is irregular.","status":"active","version":"1.1.8","language":"javascript","source_language":"en","source_url":"https://github.com/benokit/json-programming-language","tags":["javascript","lambdajson","json","compiler","transpiler"],"install":[{"cmd":"npm install lambdajson-js","lang":"bash","label":"npm"},{"cmd":"yarn add lambdajson-js","lang":"bash","label":"yarn"},{"cmd":"pnpm add lambdajson-js","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM only; no CommonJS support.","wrong":"const compile = require('lambdajson-js')","symbol":"compile","correct":"import { compile } from 'lambdajson-js'"},{"note":"evalProgram is a named export, not default.","wrong":"import evalProgram from 'lambdajson-js'","symbol":"evalProgram","correct":"import { evalProgram } from 'lambdajson-js'"},{"note":"ESM-only; use named import.","wrong":"const VERSION = require('lambdajson-js').VERSION","symbol":"VERSION","correct":"import { VERSION } from 'lambdajson-js'"}],"quickstart":{"code":"import { compile } from 'lambdajson-js';\n\nconst program = {\n    $sum: ['#', 2]\n};\nconst f = compile(program);\n\nconsole.log(f(1)); // => 3","lang":"javascript","description":"Demonstrates compiling a LambdaJSON program that sums the input with 2 and executing it."},"warnings":[{"fix":"Ensure project is ESM (type: 'module' in package.json) or use dynamic import.","message":"LambdaJSON-js is ESM-only; requires Node >= 12.22 or modern browser.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Wrap compile in try/catch or validate program structure beforehand.","message":"The compile function throws if the LambdaJSON program contains undefined variables.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Create a new compiled function for each program.","message":"Functions compiled with compile are closures capturing the original program; avoid sharing compiled functions across different program versions.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use compile() to get a function, then call it.","message":"The old 'run' function (directly executes LambdaJSON) was removed in v1.1.0.","severity":"deprecated","affected_versions":"<1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to 'type': 'module' in package.json or use dynamic import().","cause":"Running in a CommonJS module (require not supported).","error":"SyntaxError: import { compile } from 'lambdajson-js';"},{"fix":"Use import { compile } from 'lambdajson-js' (named import).","cause":"Importing default instead of named export compile.","error":"TypeError: compile is not a function"},{"fix":"Ensure all variables used in the program are defined in the scope or passed as arguments.","cause":"Referencing undefined variable in LambdaJSON program.","error":"Error: ReferenceError: x is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}