New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A command-line option to tell the compiler to behave (somehow) as a specific version #7184
Comments
Comment author: @lefessan If we go along this path (which I have think is good), a few remarks:
|
Comment author: @dbuenzli I'd be rather against this kind of proposal. They make it easier to split the ecosystem into packages and people using different languages while our goal should be to try to move the whole ecosystem so that we are all experiencing the same the language. It also makes debugging issues more difficult. Regarding rejecting linguistic features I think these kind of things are best left to a separate linter tool (which could be distributed with OCaml). |
Comment author: @lefessan @daniel: you could see it the other way around. Such an option will help anybody to use the library from somebody else, even if that particular library was not designed to work with the same version of the compiler. So, it will actually help people to use each other's work, by removing a barrier that is currently present (and it will make the opam-repository more stable and resilient to compiler policy changes). |
Comment author: @dbuenzli Well I don't see it the other way round. This introduces more build noise and complexity in the system. |
Comment author: @mshinwell I tend to agree with dbuenzli that this seems likely to introduce more complexity than it solves. Would anyone else like to weigh in? |
Comment author: @damiendoligez For alain's first goal, just use The second goal is more interesting, but I see this feature as complex and not well-specified. Which language and compiler features would be affected exactly? What about the standard library? And can you guarantee that code compiled with different versions will interoperate? |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
We have some experience about this in Dune since this is effectively what we do. In the case of Dune, this works really well. We can effectively go through breaking changes without pain and the latest However, this is manageable in the case of Dune because the surface API of Dune is small and we introduced this concept early on. Retrofitting this concept into OCaml would likely be a lot more work. |
This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc. |
Original bug ID: 7184
Reporter: @alainfrisch
Status: acknowledged (set by @mshinwell on 2016-12-08T15:06:44Z)
Resolution: open
Priority: normal
Severity: feature
Category: misc
Monitored by: @gasche @diml @hcarty
Bug description
I suggest to introduce a command-line option to tell the compilers to emulate (to some extent) the behavior of a specific older version of OCaml. E.g. "ocamlc -as-of 4.03 ...". This could include things such as:
Choices for various modes (safe-string, strict-formats, strict-sequence).
Default warning configuration (and the meaning of "a").
Rejecting new linguistic features (implemented e.g. within the AST invariant checker).
There would be two goals:
Give a quick way to check that the code base of a specific project does not start using features from a newer version of OCaml while the project is supposed to still support older versions. This would not be a bullet-proof check, of course, just a first quick check against using e.g. "match with exception" or GADT when targeting an older version.
Allow distributed source packages to "immunize" themselves against changes to default mode/warning configurations in future versions of OCaml, and thus allow OCaml to change those default configuration with more freedom. E.g. one could decide to turn safe-string on by default at some point, and packages which come with an explicit "as-of" flag would not be affected.
The text was updated successfully, but these errors were encountered: