News for hackers. Stuff that matters.
Re:Native GUI library for Go by grey-area on Friday June 06, 2014 @07:27AM (#7857231)
Objective-C doesn't have generics either and is/was the blessed API language on your chosen OS. The horror!
Re:Native GUI library for Go by anon1385 on Friday June 06, 2014 @08:02AM (#7857352)
Obj-C is 31 years old. I don't think it's unreasonable to expect new languages/frameworks to have progressed in that time.
Re:Native GUI library for Go by Artemis2 on Friday June 06, 2014 @10:50AM (#7858180)
Isn't it normal to expect old languages to evolve too, especially when they are pushed forward by companies as huge as Apple? Look at C++ (the same age as Objective-C): C++11 was approved in 2011.
Re:Native GUI library for Go by comex on Friday June 06, 2014 @03:42PM (#7859940)
Swift, Apple's days-old intended replacement for Objective-C, does have generics.
Re:Native GUI library for Go by Artemis2 on Friday June 06, 2014 @07:25PM (#7860748)
Isn't it about time? I mean, they don't really have to make a brand new language to add generics.
Re:Native GUI library for Go by comex on Friday June 06, 2014 @07:40PM (#7860786)
As mentioned elsewhere, Objective-C is mostly dynamically typed, and you can just silently cast id to things, so it doesn't need generics as much as a language like Go, although they certainly could be useful. On the other hand, the dynamic typing makes it slow with generics or not, and if you want to put numbers in collections, you have to go through a very cumbersome boxing process - two of the many things only a new language could resolve.
Re:Native GUI library for Go by matthewmacleod on Friday June 06, 2014 @09:21AM (#7857674)
It's also not statically typed - that's one of the things that generics can really help with.
Re:Native GUI library for Go by rsynnott on Friday June 06, 2014 @10:44AM (#7858142)
Surprisingly, people have different expectations between a language from the 80s and a language less than a decade old.
Re:Native GUI library for Go by Alphasite_ on Friday June 06, 2014 @08:45AM (#7857520)
And Objective-C isn't really strongly typed either, so you can send anything any message.
Re:Native GUI library for Go by andlabs on Friday June 06, 2014 @10:59AM (#7858234)
FWIW this is specifically why Objective-C has been able to get by without generics for a while. You don't get solid type-checking like you do with generics in other languages (except C++), but that has never really been an issue because the above statement works even with [...] statements (sure, the compiler will warn you, but).

The only real issue is that the things you shove into Objective-C containers must themselves be Objective-C types, which means using NSNumber and NSValue everywhere for raw C types. The new Objective-C @literal and @(expression) syntax, however, should make such code cleaner in the future...

Re:Native GUI library for Go by pjmlp on Friday June 06, 2014 @09:36AM (#7857749)
Because it is dynamically typed, duh!