Am Donnerstag, den 14.07.2016, 21:26 +0200 schrieb Sébastien Hinderer: > Hi Gerd, > > Gerd Stolpmann (2016/07/12 23:39 +0200): > > Hi, > > > > I've tried to reactivate the ocamlnat tool that comes with OCaml but > > isn't built (and even isn't buildable). This repo was tested against > > 4.02.3: > > > > https://gitlab.camlcity.org/gerd/ocamlnat > > > > Since recently I'm quite interested in this, and would like to make it > > fully working, including ocamlfind support. For my use case the > > disadvantages of the ocamlnat approach (i.e. that it requires toolchain > > support for dynlinking, and that the executable continuously grows) do > > not matter - I really want it for interactive work, and not for > > scripting. > > I just wanted to mention that ocamltest's "toplevel" builtin test runs a > test-file in both the byte-code and the native toplevel. > > For some tests the results are a bit different in the two toplevels, but > for most of them they are similar. In deed, the native toplevel seems to run fine. So far I made the following adjustments in my repo: - renamed the modules so that the same names as for the bytecode version are used (e.g. Opttoploop becomes just Toploop) - added the missing definitions so that the interfaces are identical to the bytecode version - now, findlib already worked when I loaded cmxs files instead of cma files - there was a bug that -linkall was not set when the cmxs files were on-the-fly generated - I also changed the error paths a little bit so that ocamlnat no longer crashes when a symbol isn't found. The error paths probably require more work. Now you can do: OCAMLFIND_CONF=/opt/opam-4.02/4.02.3/lib/findlib.conf ./ocamlnat OCaml version 4.02.3 - native toplevel # #use "/home/gerd/pub/lib-findlib/src/findlib/topfind";; - : unit = () Findlib has been successfully loaded. Additional directives: #require "package";; to load a package #list;; to list the available packages #camlp4o;; to load camlp4 (standard syntax) #camlp4r;; to load camlp4 (revised syntax) #predicates "p,q,...";; to set these predicates Topfind.reset();; to force that packages will be reloaded #thread;; to enable threads - : unit = () # #require "yojson";; /opt/opam-4.02/4.02.3/lib/easy-format: added to search path /opt/opam-4.02/4.02.3/lib/easy-format/easy_format.cmx: loaded /opt/opam-4.02/4.02.3/lib/biniou: added to search path /opt/opam-4.02/4.02.3/lib/biniou/biniou.cmxa: loaded /opt/opam-4.02/4.02.3/lib/yojson: added to search path /opt/opam-4.02/4.02.3/lib/yojson/yojson.cmx: loaded # Yojson.version;; - : string = "1.3.2" (Using the "ocamlnat" branch of findlib.) It is interesting that only very little work was needed to get there. I'll test that more out in the next days, and I think there will be a PR soon. Gerd -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------