ReefVM/bin/reef
2025-10-05 21:17:54 -07:00

14 lines
374 B
Plaintext
Executable File

#!/usr/bin/env bun
import { toBytecode } from "../src/bytecode"
import { run } from "../src/index"
import { toJs } from "../src/value"
const file = Bun.argv[2]
if (!file || !await Bun.file(file).exists()) {
console.error("usage: reef <path/to/bytecode.reef>")
process.exit(1)
}
const value = await run(toBytecode(await Bun.file(file).text()))
console.log(toJs(value))