Search code examples
ocamlabstract-syntax-treereason

What is Config.ast_impl_magic_number used for when generating ocaml AST


I'm looking through the reasonml code and I found Config.ast_intf_magic_number in the file that outputs the AST.

What is this number for and why is it needed?

Reference: https://github.com/facebook/reason/blob/master/src/refmt/reason_interface_printer.ml#L48


Solution

  • It is a binary file identifier that marks the file as a cmi for a specific OCaml version.