I am porting an OCaml project to ReasonML, but first to BuckleScript. I seeded the project directory with
bsb init .
and copied over the *.ml files. Compiling with
npm run build
gives me error:
[1/6] Building src/demo.cmj File "/d/ProgLang/reason/src/demo.ml", line 2, characters 7-17: Error: Unbound value Str.regexp [2/6] Building src/lex.cmj File "/d/ProgLang/reason/src/lex.ml", line 13, characters 26-44: Error: Unbound value Str.search_forward
My package.json has
"devDependencies": {
"bsb-native": "^4.0.7000"
}
and ./node_modules/bsb-native/vendor/ocaml/lib/ocaml contains files str.a str.cma str.cmi str.cmx str.cmxs str.mli, but no source like str.ml . Also, https://reasonml.github.io/api/Str.html documents the functions I need, but how can I link them in when targeting Javascript (node)?
I can live with both Javascript or native targets, but I want to upgrade from OCaml syntax to ReasonML. In case you need my demo.ml, here it is:
let qq=Str.regexp "/q/" and
() = Js.log "Hello, STR! BuckleScript"