25 ms·
Between languages like Go, Rust, Swift, and others I feel pretty optimistic about these new players (and I very much prefer more language diversity). No surpri
by kris-s 6y ago
Between languages like Go, Rust, Swift, and others I feel pretty optimistic about these new players (and I very much prefer more language diversity).
No surprise to see generics being so strongly pined for again. Very curious about how Go getting generics will change its position in the landscape.
- swagonomixxx 6y agoIf Go ends up getting generics it will be a serious competitor to Java in the enterprise small-medium size application space, and perhaps make it viable for larger applications. So I think it will be a huge step up for Go. This is of course if they do it in such a way that does not increase language complexity by an order of magnitude (e.g C++ style templates). I think Java style generics is not as complex and something along those lines would be a huge win IMO.
- enitihas 6y agoJava is moving to complicated generics though, see project Valhalla, although not like C++ templates, but more about specialization for primitive types, which can be a huge performance win.
- swagonomixxx 6y agoInteresting, I haven't heard of Valhalla (I haven't really used Java since around 2014). From their landing page it seems like their priorities are value types (which Go already has - you need to specify pointer types explicitly) and support value types as generic type parameters, which Go has to do, because it has value types. I guess it will complicate things a bit, you're right. I'm pretty happy I don't have to use Java anymore though :)
- uluyol 6y agoMore complicated for the JVM to implement, sure, but if anything, won't this simplify the semantics? Users don't need to worry about boxing/unboxing values.
- enitihas 6y agoI am eagerly waiting for this to land, but it will complicate both JVM implementation and user programms, since now List<int> might be a separate class,
- hvs 6y agoI'm probably not representative, but when I last really tried to use Go on a project seriously the lack of generics and the way that errors were handled became a real blocker for me. Which is unfortunate, because I really wanted to like the language and did for the most part. But those two things made development feel like a real chore. Again, I don't expect my personal preferences to dictate language development. Clearly many do not feel the way I do, but I do find it telling that those were the top two complaints. The pain is real, at least to a subset of us.
- throwaway894345 6y agoI hear complaints like this sometimes but I don’t relate. I don’t know if my style of programming is simply less abstract than others or if I just learned how to write (typesafe) abstract code without depending heavily on genetics. Note that there are still times where I can’t get the abstraction I want in a typesafe way, but these cases have been rare for me.
- unsignedint 6y agoI feel it really boils down to the preferences and approach to the programming. My preference is C# and having no generics and exceptions irritates me quite a bit. (among with unused import/variable and styling being enforced.) One aspect may be tools, too. Generics works great when things like contextual code completion (e.g. Intellisense) is present. One might see a bit of gaps, where someone's coming from C# on Visual Studio, compared to someone doing the same on a simple text editor. For this, I wonder if there's some correlation to preferred development environment, too. (IDE vs. editor, for instance.)
- cy_hauser 6y ago> I feel it really boils down to the preferences and approach to the programming. That's it right there! With Go you have to get over this idea that _your_ preference has any place in Go code. Go was designed to be inflexible in style and immune to preference from the start. For those new to Go, if they can't get over that hump then it's really hard not to be frustrated with the language.
- haolez 6y agoWhat if "huge applications" is a bad pattern and Go is pushing forward in the right direction? :)
- uluyol 6y agoI don't even know what this means. Are you arguing for doing less or breaking up a task into components like with microservices? If the latter, all you've done is changed the scope of the application (now your application is made of multiple services not one), not it's size. If the first ... not all problems are small.
- qqssccfftt 6y agoAnd when Java gets Project Loom then Go will not have any real world advantages.
- vips7L 6y agoIf only the JVM could get it's memory usage down.
- pron 6y agoI think that >75% of people who complain about Java's memory usage don't provide a heap size and use the default, which is asking Java to go ahead and take up up to 25% of RAM whether it really needs to or not. You want to use less RAM? Tell Java to use less RAM.
- pjmlp 6y agoAnd even then, many are just doing bad stuff like using new in loops, iterators in hot loops, and most relevant not actually thinking about their data structures.
- pron 6y agoIterators and other allocations in hot loops are not universally harmful to performance and footprint. Very often they are scalar-replaced (allocated on the stack and reused)-- in fact, if they don't escape, they're almost certain to be. Escape analysis is also now significantly stronger and able to see through abstraction in JDK 14 thanks to increasing the default inlining depth from 9 to 15 (https://bugs.openjdk.java.net/browse/JDK-8234863 https://bugs.openjdk.java.net/browse/JDK-8234863).
- pjmlp 6y agoAgreed, but it depends very much on which JVM one is using, and not all of them offer the same capabilities as Hotspot. And then there is that other special flavour of coffee beans out there.
- twblalock 6y agoAs a Java developer I would need a few things to switch and maintain my current level of productivity: generics, a map/filter/reduce paradigm for working on collections, and more flexible error handling -- in that order. Oh, and let me leave "fmt" in the list of imports even when it's unused, because adding it every time I stick in a printf to debug something, and then needing to remove it later because of compiler errors, is incredibly frustrating.
- coryrc 6y agoIntegrate `goimports` into your editor.
- spyspy 6y agoIt's been an unpopular opinion but I've contended for a long time that if Go had map/filter/reduce from the onset like it has copy and append, most people screaming for generics would have been silenced.
- xzel 6y agoBut doesn't that require some level of generics? This is an honest question not rhetorical / a retort.
- majewsky 6y agoGo has several generic functions like append() or make() baked into the compiler (https://golang.org/pkg/builtin/ https://golang.org/pkg/builtin/). When people are asking for generics, they're asking for a language-level mechanism for defining additional generic functions beyond these provided by the compiler.
- xzel 6y agoI'm talking more along the line for Map/Filter/Reduce support and why those weren't included in Go originally.
- pjmlp 6y agoAn eco-system is much more than a language grammar. Until Go comes with an OS, a set of drivers comparable to JDBC for Oracle, SQL Server, DB2, Informix, CMS tooling like Magnolia/Liferay, profilers like VisualVM/JFR, graphical debuggers (delve just barely does it), code reloading, dynamically loading, an UI toolkit that at least matches Swing, and plenty of other stuff, I rather leave it to Docker/K8S tooling.
- apta 6y agogolang has got nothing on Java's (and the JVM's) performance, monitoring, profiling, GCs, etc. Not to mention all the new features Java is getting which are not even on golang's roadmap, such as records and pattern matching. This is not even touching on golang's bad design decisions that won't get fixed (e.g. structural typing of interfaces).
- vardump 6y ago> ...how Go getting generics will change its position in the landscape. I think it'll have minimal immediate effect. It'll quieten the vocal ones, but being a pragmatic bunch of people, most golang users just won't care much, at least at first. No doubt libraries will adopt it over time. Other golang projects will slowly follow.
- jeremyjh 6y agoI think this is right. Few people will say "oh Go has generics let me start using it now". But at the same time we shouldn't underestimate the benefit improved libraries could have on adoption in the long-run. I've heard several people say they just are not happy with any ORM in the Go ecosystem, for example and I think that situation would improve significantly with generics.
- c-cube 6y agoThat's hard to measure. If Go had sum types and generics I'd be more willing to give it a serious try , but in its current state I don't see myself writing complex algorithmic code in it. Maybe other people feel the same, especially among the crowd already used to static typing.
- erik_seaberg 6y agoI've been avoiding Go as much as possible as a poor use of engineering time, but I'll reconsider if they fix generics and error handling and comprehensions. Java 8 isn't outstanding (the JVM is!) but it's about where I put the bar for a tolerable language.
- throwaway894345 6y agoI disagree. I think there are tons of people who won’t touch Go because they can’t fathom programming without generics. I think lots of people will use the language and interact with lots of existing code and realize how far one can go with respect to type safety without ever touching generics. Unfortunately, I’m also afraid that this sea of newcomers will bring all of their paradigms to the Go ecosystem which is made possible by generics, and frankly the consistency that makes Go so productive will be lost. I like generics, but I’m afraid of the cost.
- jeremyjh 6y ago> No surprise to see generics being so strongly pined for again. Very curious about how Go getting generics will change its position in the landscape. Well, only 25% of respondents said there were any features blocking adoption; and of that group yes the majority want generics. Since this is a survey of Go developers, it is not surprising to find out that a very solid majority find the language usable as it is. I think this also limits what this particular survey can tell us about the uptick in adoption you might see if that feature ever lands.
- throw_m239339 6y ago> Very curious about how Go getting generics will change its position in the landscape Go cannot get generics because "conservative politics" in its community period. A lot of prominent gatekeepers are all about the status quo. There are a few things Go could do to make it easier to work with, ease "type equivalence", introduce some covariance into the mix. Maybe unions, maybe replace multiple return types with tuples and destructuring assignement. I don't believe a second Go will ever get generics and the courageous proposal done by Ian Lance Taylor, the hero of the language right now, won't really satisfy anybody because it's too complex yet doesn't do that much IMHO. This is purely a political question, not a technical one. We had that debate for almost 10 years now and I dread more petty drama.
- pjmlp 6y agoThere is some work being done here, https://go-review.googlesource.com/c/go/+/187317 https://go-review.googlesource.com/c/go/+/187317 But I agree with you, as seen by the commit messages they still aren't fully there, and at the end it might just happen as with the error proposal anyway.
- BurningCycles 6y ago>A lot of prominent gatekeepers are all about the status quo. Who are these ?
- IshKebab 6y agoYou could have said the same about modules. Generics are clearly on the roadmap even if they are taking their sweet time about it.