3 ms·
It's not modern at all. Type system notation has been using x : T to say "x has type T" for at least 50 years. It's the standard in academia, and has existed in
by cvoss 4y ago
It's not modern at all. Type system notation has been using x : T to say "x has type T" for at least 50 years. It's the standard in academia, and has existed in real-world programming languages since 1971. [0]
[0] https://cstheory.stackexchange.com/questions/43971/why-colon-to-denote-that-a-value-belongs-to-a-type https://cstheory.stackexchange.com/questions/43971/why-colon...
- forrestthewoods 4y agoIt is an old idea and also a modern trend. Trends come and go. It is currently trendy. 90s fashion is also trendy right now. Which is great because a few years ago it was 80. The cycle continues!
- the_af 4y ago"Currently trendy" how? Scala and Kotlin, to name just a few established programming languages, use the ": type" suffix style. They are neither "recent" nor from the original Algol era.
- int_19h 4y agoIt depends on how you define "current", I suppose, but personally I'd consider Kotlin to be fairly recent.
- the_af 4y agoWell, Kotlin is from 2011 and Scala from 2004! 11 and 18 years ago, respectively. I'd say neither is recent by any reasonable sense of the word that would imply their syntax or conventions are "a current trend".
- int_19h 4y ago11 years is not all that much for a PL, especially if you count from the date it was first announced, rather than from the first stable release (which for Kotlin was in 2016). For example, Rust started in 2006, and Rust 1.0 was in 2014, so it's actually older the Kotlin - but I think it still qualifies as "new", and many still consider it not fully battle-tested. For another example, Python goes all the way back to 1991, with v1.0 in 1994. But it didn't really start to trend until early 00s.
- the_af 4y ago> "11 years is not all that much for a PL" Sure, if we redefine "recent" or "current" we can twist words to reach whatever conclusion. In reality, this ": type" syntax is neither new nor recent, nor is it "a current trend". Kotlin is also not recent. A decade is a lot. You conveniently left Scala out, I suppose because it didn't fit your argument. > "For another example, Python goes all the way back to 1991" Well, since we are discussing Python, the syntax for its type hints looks like what exactly? And it was discussed as far back as 2014. Is that "recent"?
- int_19h 4y agoIf you look at the thread, I'm not the same person who originally made the claim. Nevertheless, it is definitely the case that the "name: type" syntax is noticeably more trendy now than it was, say, 15 years ago. Sure, there were plenty of languages that had it already back then, including Scala (and ML, and Delphi, and ...). But how many of them were mainstream? Whereas now, this syntax is embraced by Python and TypeScript. And not even OP claimed that the syntax itself is new or recent; I mean, everybody who knows about Pascal knows how old it really is! They literally said "it's an old idea" that is "currently trendy".