News for hackers. Stuff that matters.
Re:Two Years of OCaml by rwmj on Tuesday May 02, 2023 @05:15AM (#35785062)
In virt-v2v we eventually enforced that every module file also has a corresponding interface file: https://github.com/libguestfs/virt-v2v/blob/master/check-mli...
Re:Two Years of OCaml by IshKebab on Tuesday May 02, 2023 @07:07AM (#35785767)
Probably if you need to do that it should just be enforced by the compiler. It's pretty clear to me (and the author of this post) that Rust got this right - small scale type inference is fine (in function bodies) but you really want explicit types for functions and up.

Without that, you lose out massively on readability and error message quality.

In Sail, I have IDE type inlays working but it barely helps with reachability because half the types are inferred as generic.

Re:Two Years of OCaml by rwmj on Tuesday May 02, 2023 @07:29AM (#35785956)
As a user of OCaml I have to disagree. Rust requires far too many type annotations and they are mostly unnecessary and clutter everything up (particularly with it's very heavy syntax). In OCaml my editor shows me types if I mouse over a variable, and if I need to document the code I can do that, but I don't need to.
Re:Two Years of OCaml by IshKebab on Wednesday May 03, 2023 @04:01AM (#35799419)
My point is it isn't very useful if half the types are 'a