|Anonymous | Login | Signup for a new account||2014-11-26 15:05 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005561||OCaml||OCaml typing||public||2012-03-27 15:01||2013-12-05 15:39|
|Priority||low||Severity||feature||Reproducibility||have not tried|
|Target Version||Fixed in Version|
|Summary||0005561: Option to disable -principal mode|
|Description||It would be convenient to add a -noprincipal flag to the compiler. With OMake for instance, it would make it easy to add -principal to OCAMLFLAGS globally for the project, and then append -noprincipal to OCAMLFLAGS for some directories.|
|Tags||No tags attached.|
|So you would call `ocamlc -principal -noprincipal` or `ocamlc -noprincipal -principal`, and expect it to disable principality checks? That looks a little weird to me (I like to think that command-line arguments are declarative rather than imperative).|
|The last option would take precedence, as for warnings. I find it quite convenient to be able to define a "OCAMLFLAGS" globally, and adapt it locally for specific files or directories, by appending some extra options.|
What about an optional parameter after -principal?
* -principal ? current behavior
* -principal yes ? current behavior
* -principal no ? overrides any previous values for the argument.
That sounds like a valid use-case for a big codebase.
Regarding the interface, I rather prefer Alain's proposal.
The change would however raise the question of doing this for other options: -norectypes, -nostrict-sequence, -stdlib, -assert, -nounsafe... (But we already have -nolabels and -labels that (if I understand correctly) do are not inverse one of another.)
I'm not sure the case for warning makes for a good precedent (no pun intended), but if it's decided to add -noprincipal I really don't see why we shouldn't have -norectypes as well.
-rectypes is quite viral: if you compile a module with it, you need to compile all other modules that depend on it with -rectypes as well. So it's rather unlikely that -rectypes would be the default for a big project, with some "-norectypes" exceptions.
I also don't expect -unsafe to be the default for a big code base. It could be turned on for performance-critical and carefully verified code (but in my experience, it has a rather low impact, so I'm not even sure it is used at all).
A -nostrict-sequence would probably make sense.
|2012-03-27 15:01||frisch||New Issue|
|2012-03-27 16:53||gasche||Note Added: 0007197|
|2012-03-27 17:05||frisch||Note Added: 0007198|
|2012-03-29 10:53||protz||Note Added: 0007228|
|2012-03-29 10:53||protz||Status||new => acknowledged|
|2012-03-29 11:10||gasche||Note Added: 0007229|
|2012-03-29 11:18||frisch||Note Added: 0007231|
|2012-06-20 11:19||frisch||Category||OCaml general => OCaml typing|
|2013-12-05 15:39||doligez||Status||acknowledged => confirmed|
|Copyright © 2000 - 2011 MantisBT Group|