ReefVM/bin/reef
2025-10-10 10:07:21 -07:00

14 lines
384 B
Plaintext
Executable File

#!/usr/bin/env bun
import { toBytecode } from "../src/bytecode"
import { run } from "../src/index"
import { fromValue } 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(fromValue(value))