Re:Dynamic type systems are not inherently more open
by woud420 on Monday January 20, 2020 @12:32PM
(#22100451)
You mean this C++ code?
std::vector<std::pair<std::string, int>> s;
s.push_back({"a", 1});
s.push_back({"b", 2});
s.push_back({"c", 3});
I mean let's compare apples to apples here.
Re:Dynamic type systems are not inherently more open
by shrimp_emoji on Tuesday January 21, 2020 @03:20PM
(#22111079)
Damn, I forgot about uniform initialization. D:
That IS better than Rust since it migrates the type from n container members to just the 1 container. It doesn't seem possible to replicate that in Rust[0].
My Rust evangelism IS hurt by this. But its HP bar is big[1].
0: https://news.ycombinator.com/item?id=10891892
1: https://www.reddit.com/r/rust/comments/bya8k6/programming_wi...
Look at this Rust code:
Both are statically typed, but one uses inference. It practically feels like Python everywhere except where type declarations matter most to me -- function signatures: In Python, those aren't very helpful. :c