Make boot/ocamlc read directly byterun/primitives#324
Make boot/ocamlc read directly byterun/primitives#324bobot wants to merge 2 commits intoocaml:trunkfrom
boot/ocamlc read directly byterun/primitives#324Conversation
Adding primitives doesn't require to bootstrap anymore
|
I don't know enough of the compiler build machinery to understand if that is correct, but I warmly welcome the change. Indeed bootstrapping on primitive changes is a pain and makes some sorts of contributions much more delicate. (It also generates conflicts that makes handling out-of-tree branches painful, etc.) Thanks for this very productive work. |
|
@gerdstolpmann should look at this, as it's getting close to cross-compilation territory. Anyway, let's wait for 4.04, there's a lot going on now and I don't want to risk breaking the makefiles at this time. |
|
Basically, we have primitives that are hard-coded in the compiler (e.g. look at the beginnning of Translcore, it assumes caml_equal and others), and primitives that are used in the standard library. The -use-prims option is correct for the latter. My thinking is that there should also be a list of hard-coded primitives that is merged with the loaded list. But anyway, given that there are rarely new hard-coded primitives the new approach is better than the old one. I don't see any problems with cross-compilation. On the contrary, host and target compilers could now even deviate with respect to the primitives. |
|
Thanks! Merged (manually -- somehow Git got overly confused while trying to merge, apparently by Windows EOL in .nt files). |
boot/*are often responsible for merge conflict in github or rebase conflict during development, because they are binaries. People needs to modifiesboot/ocamlceach time the set of primitives in the default runtime is modified.This merge request proposes to use for
boot/ocamlcthe option-use-prims byterun/primitives. It allows to add new primitive and use it in the standard library without bootstrapping. Compilation with./ocamlc,./ocamloptare not modified.For example you can compile with the following patch without the errors:
I think that work also for removing some primitives but I don't know which exactly.
This could wait after 4.03 since it only simplifies compiler development.