1,960 karma · joined August 14, 2015
>For their React-like goal though, Ocaml's lack of anonymous record types is the absolute worst.
The object system actually allows this to be fair & it does get a little bit of use in some Reason libraries targeting React developers
I get that SML has advantages over OCaml but I don't really get what you're trying to argue for. Clearly if you like SML you'd prefer OCaml to JavaScript...
[1] https://caml.inria.fr/pub/docs/manual-ocaml/language.html
1) places features diverged
2) modules
3) F#'s "light" syntax mode
None of these really seem like Reason at all. Do you have any specific places where they're similar?
The "conservative" measure is the only correct way to measure here. Using realized gains makes no sense because that's not the value the company paid out. That's like saying you invested your salary and the gains are part of your compensation package.
Complex inheritance chains come into this because it makes it hard to track down the code you're looking for. Like let's say we have Cat : Feline & Pet, Feline : Mammal, Mammal : Animal, Pet : Property, Animal : Alive. Now when I do cat.eat(x) it's impossible to predict where eat is defined. Knowing that it's a Cat didn't make it any easier to understand the implementation of eat.
var a = f(x) var b = g(y, a)
Isn't any different from:
g(y, f(x))
A lot of real world code I encounter doesn't bother with temporary values for everything and giving them explicit types, which is essentially the equivalent of just using inference here. Thus in this case inference isn't doing anything negative because the code would look like that regardless.
The hardest code bases I've worked with have been very explicit with type info and that's done nothing for me. The examples here feel very contrived; very little of the code in a 100k LoC project is gonna use types like Maps and ints, especially if it's OOP. Knowing that something is an AbstractIterator does very little to help me if I don't know WTF an AbstractIterator is. And complex inheritance chains absolutely destroy my ability to find the method I'm looking for on these types.
Coming from functional programming, it really doesn't feel so different looking up a function vs. looking up a class.
Regardless, every language has some degree of inference, otherwise every function call would be:
let result : int = (f : int -> int)(x : int + y : int, 2 : int)
If your code looks like this:
f(g(x, y), a(b(c)))
then inference isn't really doing much to hurt you. And what I've found is that for any large-scale project you see a lot of type of code.
As a kid my parents didn't care too much about what I ate. I regularly had sweets of any kind as a kid. I certainly have no addiction to sugar because of that. I probably drink soda less than once a month and have cake/ice cream/chocolate/candy at about the same frequency. Meanwhile, people I grew up with who were never allowed sugar seem much more addicted to it, eating sweets with every meal or as a snack. Earlier this week I heard someone at work talking about how their child has never eaten any kind of sweets before and personally this just sounds like a recipe for disaster.