{"id":24990,"library":"bembajs-core","title":"BembaJS Core","description":"The core compiler and runtime for the Bemba programming language, enabling React-based web development with Bemba syntax (a Zambian language). Current stable version is 1.4.27, with an active release cadence focused on React integration and tooling. Key differentiators: it is the first programming language based on an African language (Bemba), compiled to JavaScript with full React compatibility. It supports conditionals, loops, async/await, and state management with Bemba keywords. Notably, it requires React 18+ and ReactDOM as peer dependencies. Ships TypeScript definitions and supports ESM/CJS.","status":"active","version":"1.4.27","language":"javascript","source_language":"en","source_url":"https://github.com/YamikaniKL/bemba-compiler","tags":["javascript","bemba","compiler","parser","lexer","ast","typescript"],"install":[{"cmd":"npm install bembajs-core","lang":"bash","label":"npm"},{"cmd":"yarn add bembajs-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add bembajs-core","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency - required for rendering Bemba components","package":"react","optional":false},{"reason":"Peer dependency - required for DOM rendering","package":"react-dom","optional":false}],"imports":[{"note":"ESM-only since v1.4.0; CJS not supported in recent versions.","wrong":"const bembajs = require('bembajs-core')","symbol":"bembaJS","correct":"import { bembajs } from 'bembajs-core'"},{"note":"Named export, not default.","wrong":"import compileBemba from 'bembajs-core'","symbol":"compileBemba","correct":"import { compileBemba } from 'bembajs-core'"},{"note":"TypeScript type used for runtime config.","wrong":"","symbol":"BembaRuntime","correct":"import { BembaRuntime } from 'bembajs-core'"}],"quickstart":{"code":"import { compileBemba } from 'bembajs-core';\n\nconst bembaCode = `\n  ukusunga (@mut) count = 0;\n  ukulomba @mut count;\n  ukusapoti() {\n    @mut count += 1;\n  }\n`;\n\nconst compiled = compileBemba(bembaCode);\nconsole.log(compiled);\n// Output: React component with hooks","lang":"typescript","description":"Compiles Bemba language code into a React component with state management."},"warnings":[{"fix":"Replace with ukusunga and useEffect manually.","message":"ukusungaKabili is deprecated and will be removed in v2.0.","severity":"deprecated","affected_versions":">=1.1.0 <2.0.0"},{"fix":"Use import syntax or migrate to ESM.","message":"ESM-only since v1.4.0 - CJS require() will fail.","severity":"breaking","affected_versions":">=1.4.0"},{"fix":"Run: npm install react react-dom","message":"Peer dependencies react and react-dom must be installed separately.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update code to use ukusunga instead of ukusinga.","message":"State management keywords changed in v1.2.0 (ukusunga replaces ukusinga).","severity":"breaking","affected_versions":">=1.2.0"},{"fix":"Use the BembaJS Vite plugin or compile via CLI before bundling.","message":".bemba files require a Babel plugin or custom build step to compile.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure all statements end with semicolon and check keyword spelling.","cause":"Missing semicolon or incorrect Bemba keyword.","error":"SyntaxError: Unexpected token in Bemba code"},{"fix":"Run npm install bembajs-core and ensure tsconfig includes 'node_modules/@types'.","cause":"Package not installed or TypeScript types missing.","error":"Cannot find module 'bembajs-core' or its corresponding type declarations."},{"fix":"Switch to import syntax or set 'type': 'module' in package.json.","cause":"Using require() with an ESM-only package version.","error":"ReferenceError: require is not defined in ES module scope"},{"fix":"Run npm install react react-dom.","cause":"React is required but not listed in dependencies.","error":"Error: The 'react' peer dependency is not installed."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}