{"id":25777,"library":"jambda-calc","title":"jambda-calc","description":"jambda-calc (v0.6.1) is a TypeScript library that transpiles JavaScript/TypeScript functions into pure lambda calculus expressions and visualizes them as Tromp diagrams. It supports arithmetic, common operators, conditionals, nested functions, and basic array methods like .filter() and .map(). The library is in active development with a focus on educational and explorative use—ideal for understanding the theoretical underpinnings of computation. It provides a CLI tool and programmatic API, with TypeScript definitions included. Notable limitations include no support for string operations, recursion, async functions, imports, or advanced member functions. The project aims to handle entire JS projects in the future.","status":"active","version":"0.6.1","language":"javascript","source_language":"en","source_url":"https://github.com/maximus-powers/jambda-calc","tags":["javascript","lambda","lambda-calculus","typescript","transpiler","visualization","tromp-diagrams"],"install":[{"cmd":"npm install jambda-calc","lang":"bash","label":"npm"},{"cmd":"yarn add jambda-calc","lang":"bash","label":"yarn"},{"cmd":"pnpm add jambda-calc","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; use import syntax. TypeScript types are included.","wrong":"const transpile = require('jambda-calc').transpile;","symbol":"transpile","correct":"import { transpile } from 'jambda-calc';"},{"note":"The default export is not provided; use named imports.","wrong":"import { viz } from 'jambda-calc';","symbol":"visualize","correct":"import { visualize } from 'jambda-calc';"},{"note":"The library does not have a default export; use named import.","wrong":"import jambdaCalc from 'jambda-calc';","symbol":"jambdaCalc","correct":"import { jambdaCalc } from 'jambda-calc';"}],"quickstart":{"code":"import { transpile, visualize } from 'jambda-calc';\nimport * as fs from 'fs';\n\n// Transpile a simple arithmetic function\nconst jsCode = 'function add(a, b) { return a + b; }';\nconst lambdaExpr = transpile(jsCode);\nconsole.log('Lambda expression:', lambdaExpr);\n\n// Visualize the expression as Tromp diagram SVG\nconst svg = visualize(lambdaExpr, { format: 'svg' });\nfs.writeFileSync('add-tromp.svg', svg);\n","lang":"typescript","description":"Transpile a simple addition function to lambda calculus and visualize the result as a Tromp diagram SVG."},"warnings":[{"fix":"Ensure input code only uses supported features: arithmetic, boolean/numbers, conditionals, simple functions, .filter(), .map().","message":"Unsupported operations (string, recursion, async, imports) will throw an error or produce incorrect results.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"Use only numbers between -100 and 100; larger numbers will cause errors.","message":"Number literals only supported in range -100 to 100.","severity":"gotcha","affected_versions":">=0.6.0"},{"fix":"Use `pnpm jambda-calc` or `npx jambda-calc` from project directory.","message":"CLI must be run via pnpm or npx; global install does not expose command.","severity":"gotcha","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace Math.cos() with a manual computation or avoid such functions.","cause":"Member functions other than .filter() and .map() are not implemented.","error":"Error: Unsupported operation: Math.cos"},{"fix":"Reduce the number to within [-100, 100] or restructure the logic.","cause":"Only numbers from -100 to 100 are supported.","error":"Error: Number literal out of range: 150"},{"fix":"Run `pnpm install jambda-calc` (or npm/yarn) in the project directory. Verify node_modules and package.json.","cause":"Package not installed in the project or not on the path.","error":"Error: Cannot find module 'jambda-calc'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}