0

I have a project in OCaml that could be compiled in Ubuntu long time ago. Today, I want to pick up the project and try to compile it in macOS Mojave 10.14.2.

ocaml --version returns The OCaml toplevel, version 4.07.1, js_of_ocaml --version returns 3.3.0, npm --version returns 6.7.0, node --version returns v8.9.3.

makefile works fine and generates analyze. But ./analyze test.ev returns Unimplemented Javascript primitive caml_pure_js_expr!.

Does anyone know where may be the problem?

Edit 1:

As my analyze is big, I test a small example that could reproduce the error. I write cubes.ml as follows:

let () =
  let oneArgument (a: int) = a + 100 in
  Js_of_ocaml.Js.Unsafe.global##.jsOneArgument := Js_of_ocaml.Js.wrap_callback oneArgument;
  print_string "hello\n";
  exit 0

The following two commands generate well T:

ocamlfind ocamlc -g -package js_of_ocaml.ppx -linkpkg cubes.ml -o T
js_of_ocaml --debuginfo --sourcemap --pretty T -o cubes.js

node cubes.js returns well hello, however ./T returns Unimplemented Javascript primitive caml_pure_js_expr!

SoftTimur
  • 5,630
  • 38
  • 140
  • 292
  • 1
    It's impossible to answer your question, we have no idea about your tool chain, your build script, your code, and what this `analyze` script does. None of this is particularly standard. – Drup Jan 29 '19 at 09:55
  • I just posted a small example that reproduces the problem... – SoftTimur Jan 29 '19 at 10:01
  • 4
    `T` uses primitives to access javascript properties (as should be obvious by the code). You can't run it natively, you can only run the javascript code. – Drup Jan 29 '19 at 10:04

0 Answers0