| Anonymous | Login | Signup for a new account | 2013-06-19 14:46 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0005561 | OCaml | OCaml typing | public | 2012-03-27 15:01 | 2012-06-20 11:19 | ||||||
| Reporter | frisch | ||||||||||
| Assigned To | |||||||||||
| Priority | low | Severity | feature | Reproducibility | have not tried | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| 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. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0007197) gasche (developer) 2012-03-27 16:53 |
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). |
|
(0007198) frisch (developer) 2012-03-27 17:05 |
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. |
|
(0007228) protz (manager) 2012-03-29 10:53 |
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. |
|
(0007229) gasche (developer) 2012-03-29 11:10 |
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. |
|
(0007231) frisch (developer) 2012-03-29 11:18 |
-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. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 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 |
| Copyright © 2000 - 2011 MantisBT Group |