this repo has no description
1(* Simplest example *)
2open Js_of_ocaml
3module C = Js_top_worker_client_msg
4module Msg = Js_top_worker_message.Message
5
6let log s = Console.console##log (Js.string s)
7
8let log_output (o : C.output) =
9 log ("stdout: " ^ o.stdout);
10 log ("stderr: " ^ o.stderr);
11 log ("caml_ppf: " ^ o.caml_ppf)
12
13let _ =
14 let open Lwt.Infix in
15 let t = C.create ~timeout:100000 "_opam/worker.js" in
16 let config : Msg.init_config =
17 { findlib_requires = [ "stringext" ]; stdlib_dcs = None; findlib_index = None }
18 in
19 C.init t config >>= fun () ->
20 C.eval t ~env_id:"default" "Stringext.of_list ['a';'b';'c'];;" >>= fun o ->
21 log_output o;
22 Lwt.return ()