{"id":25585,"library":"firefly-compiler","title":"Firefly Compiler","description":"A compile-to-JavaScript language with colorless async/await and type classes. Current stable version is 0.6.19, with frequent releases (multiple self-hosting milestones). Self-hosting compiler written in JavaScript compiles itself in ~1.2 seconds. Differentiators: colorless async (no explicit async/await markers), type classes (similar to Haskell), and self-hosting transpiler approach. Targets Node.js >=18. Active development with contributions from multiple developers.","status":"active","version":"0.6.19","language":"javascript","source_language":"en","source_url":"https://github.com/Ahnfelt/firefly-boot","tags":["javascript"],"install":[{"cmd":"npm install firefly-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add firefly-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add firefly-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime environment required (Node.js >=18)","package":"node","optional":false}],"imports":[{"note":"Package is ESM-only. CommonJS require() will fail.","wrong":"const firefly = require('firefly-compiler')","symbol":"default import","correct":"import firefly from 'firefly-compiler'"},{"note":"Named export compile is available. Use default import if you want the whole compiler object.","wrong":"","symbol":"compile function","correct":"import { compile } from 'firefly-compiler'"},{"note":"TypeScript types are included. Use type import for compile-time only types.","wrong":"","symbol":"TypeScript types","correct":"import type { FireflyOptions } from 'firefly-compiler'"}],"quickstart":{"code":"import { compile } from 'firefly-compiler';\n\nconst source = `\nprint(\"Hello from Firefly!\")\n`;\n\nasync function main() {\n  const { code } = await compile(source, { target: 'es2022' });\n  eval(code);\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Compiles a simple Firefly snippet that prints a message, then executes the generated JavaScript."},"warnings":[{"fix":"Upgrade Node.js to version 18 or higher.","message":"Node.js >=18 required; older versions will fail with syntax errors due to ESM.","severity":"breaking","affected_versions":"<18.0.0"},{"fix":"Use import statements instead of require() in your project, or switch to dynamic import.","message":"Package is ESM-only; using require() will throw ERR_REQUIRE_ESM.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Check changelog for breaking syntax changes. Use --version flag to see compiler version.","message":"Compilation may fail if source contains unsupported features from newer Firefly versions.","severity":"gotcha","affected_versions":">=0.6.0"},{"fix":"Upgrade to latest version and use compile() from the package.","message":"Older versions (<0.5) used a different API; compile function may not exist.","severity":"deprecated","affected_versions":"<0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Replace require('firefly-compiler') with import firefly from 'firefly-compiler' or switch to dynamic import.","cause":"Package is ESM-only; CommonJS require() is not allowed.","error":"ERR_REQUIRE_ESM: require() of ES Module /path/to/firefly-compiler/index.js from /path/to/your/file.js not supported."},{"fix":"Update Node.js to >=18 or use a transpiler like Babel.","cause":"Node.js version <18 does not support ESM syntax without --experimental-modules flag.","error":"SyntaxError: Unexpected token 'export'"},{"fix":"Run npm install firefly-compiler (requires Node.js >=18).","cause":"Package not installed or not in node_modules.","error":"Error: Cannot find module 'firefly-compiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}