1. 13

It looks like that “new odoc model” mentionned in Appendix A has since been released, in v1.5.2.

  1.  

  2. 2

    The necessity for this nonsense is part of the reason I gave up OCaml for F#/C# and then, eventually, Rust. You could define and maintain this .mli file format, you could add include to the language and come up with this neat workaround… or you could just have some export annotations in the source and make the compiler use the information it has anyway without you having to tell it all over again. Having header files is a very 1980’s design decision.

    1. 2

      I find it a rather minor inconvenience compared to what the language offers.

      1. 1

        ML-style modules are not merely a name environment control and import/export mechanism, except in F#; presumably if you were writing software instead of dropping hot takes about them being “header files”–you can use ocamlc -i if that’s more at your grade level–you’d have said something like, “it’s unfortunate that OCaml doesn’t have a less verbose mechanism than signature files for controlling external visibility.” (And while F# is definitely an ML, modules à la OCaml or SML are missing by design–no functors, and only very basic functionality for signature files, a feature I’ve seen used by maybe literally two or three F# projects at most other than the compiler itself.)

        Rust, of course, also does not have ML-style modules, since they’re usually too busy trying to discover the vocabulary for whichever GHC problem they’ve rediscovered this month. I guess you’re saving a lot of time instead with hand-writing all those function signatures and typeclass (sorry, “trait”) constraints now, though?

        C# is a free space.

        PS. this is a joke, not a personal attack; simply pointing to the fact that what makes a programming language “good” tends to be a highly contentious matter (of course, everyone could just listen to me; then everything would be great. determining which programming language above I like, if any, is left as an exercise for the reader :))

        PPS. If you got this far, it’s worth considering: what could something like OCaml–which already has the (albeit heavyweight) tool that subsumes visibility annotations and imports–do to improve on what it has? I know the OCaml people have discussed adding a thing to let you stuff something in a module definition and have it be “hidden” without having to write a full signature, but I don’t have the link handy.