Registry / firefly-compiler

firefly-compiler

JSON →
library0.6.19jsnpmunverified

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.

Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Package is ESM-only. CommonJS require() will fail.

import firefly from 'firefly-compiler'

Named export compile is available. Use default import if you want the whole compiler object.

import { compile } from 'firefly-compiler'

TypeScript types are included. Use type import for compile-time only types.

import type { FireflyOptions } from 'firefly-compiler'

Compiles a simple Firefly snippet that prints a message, then executes the generated JavaScript.

import { compile } from 'firefly-compiler'; const source = ` print("Hello from Firefly!") `; async function main() { const { code } = await compile(source, { target: 'es2022' }); eval(code); } main().catch(console.error);
firefly --version
Debug
Known footguns
breakingNode.js >=18 required; older versions will fail with syntax errors due to ESM.
gotchaPackage is ESM-only; using require() will throw ERR_REQUIRE_ESM.
gotchaCompilation may fail if source contains unsupported features from newer Firefly versions.
deprecatedOlder versions (<0.5) used a different API; compile function may not exist.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
7 hits · last 30 days
ahrefsbot
3
claudebot
3
bingbot
1
Resources