3 ms·
> But you'll need to annotate every single value to get any matching out of it. Ok, if we're taking "1 is an int" as type inferencing then, yes, every statical
by Jtsummers 3y ago
> But you'll need to annotate every single value to get any matching out of it.
Ok, if we're taking "1 is an int" as type inferencing then, yes, every statically typed language, at least every mainstream one, has at least a small amount of type inference since we don't, in C for instance, have to annotate values. But C does not infer the types of its variables or functions, nor do you have to annotate them in every location where they are used. But that's not inference either, that's using the information determined by annotating the variables.
----------
My main point was that it's weird to say the entirety of gradual typing works by type inference. It works by permitting mixing statically typed and dynamically typed code together in one language. Whether the statically typed portion uses type inference or more "classical" type annotations is orthogonal to the way it works under the hood.