Re:Mozilla releases version 0.1 of the Rust programming lang...
by jbarham on Monday January 23, 2012 @08:34PM
(#3503050)
> their answer to generics requires run-time type checking for every operation
Not quite, the Go implementation has runtime optimizations so that the cost for using interfaces/generics is incurred once at first use: http://research.swtch.com/2009/12/go-data-structures-interfa...
Re:Mozilla releases version 0.1 of the Rust programming lang...
by ungerik on Tuesday January 24, 2012 @03:26AM
(#3503953)
> their answer to generics requires run-time type checking for every operation
Go has no built in answer to generics. Trying to rebuild generics with other language features won't make it better.
Re:Mozilla releases version 0.1 of the Rust programming lang...
by haberman on Wednesday January 25, 2012 @06:51PM
(#3512292)
I must have misinterpreted the intent of this from "Go for C++ Programmers":
> Because the conversion is dynamic, it may be used to implement generic programming similar to templates in C++. This is done by manipulating values of the minimal interface.
I thought they were saying this was their answer to generic programming, but it appears this is not the case. In any case, it was just an example of my general feeling that the type system is more dynamic than I prefer for systems languages.
Also, just as a gut-level reaction I didn't feel excited about any of the expressiveness that Go offers (compared with my reaction to Rust's pattern matching, which to me is a clear improvement over how you'd express an equivalent thing in C or C++).