4 ms·
> Type inference has left academy and proliferated into mainstream languages for so many years that I almost forgot that it's a worth mentioning feature. It’s
by sarchertech 1y ago
> Type inference has left academy and proliferated into mainstream languages for so many years that I almost forgot that it's a worth mentioning feature.
It’s not common in lower level languages without garbage collectors or languages focused on compilation speed.
- foobar1726 1y agoC++ added auto 14 years ago. Swift had it since day 1 back in 2014 if I remember right. What else is there?
- sarchertech 1y agoC, Ada, Fortran, Pascal.
- jolux 1y agoCompilation speed — OCaml, Go, D, C#, Java “Low-level” languages — Rust, C++, D
- sarchertech 1y agoI meant for focused on compilation speed to apply only to lower level languages. And when I say lower level I don’t really include D because it has a garbage collector (I know it’s optional but much of the standard library uses it I believe).
- jibal 1y agoThat a language has a garbage collector is completely orthogonal to whether it has type inference ... what the heck does it matter what "much of the standard library uses" to this issue? It's pure sophism. Even C now has type inference. The plain fact is that the claim is wrong.
- sarchertech 1y agoThe x axis is orthogonal to the y axis, so I can’t be interested in the area where x < 1 and y = 5? > what the heck does it matter what "much of the standard library uses" to this issue? It matters in that most people looking for a low level manually memory managed language won’t likely choose D, so for the purposes of “is this relatively novel among lower level, memory managed languages” D doesn’t fit my criteria. > Even C now has type inference. The plain fact is that the claim is wrong. Almost no one is using C23 yet.
- spacechild1 1y agoThe only popular language I can think of is C (prior to C23). If you want to include Fortran and Ada, that would be three, but these are all very old languages. All modern system languages have type deduction for variable declarations.
- jibal 1y agoThat's true if the only lower level languages one considers are C and assembler. Virtually every other language has moved way beyond that.