Live data from Hacker News

Seven years of Go

blog.golang.org

271–280 of 318 posts

Re: Seven years of Go

#271
post #213

Earlier quoted context omitted.

Very few Go supporters would say that generics are unnecessary, especially not the development team. But they are not required at any price and so far no good solution for implementing them has been found. So they are delayed until that day. While I miss them certainly, I strongly prefer them being absent to a bad and complex/confusing implementation.

But the problems go further. The go type system is littered with exceptions. Why ? Because append, make, maps, channels in for loops, channels in while loops, ... all have their own specific entries in the type system. Go has generics ... but only for the core team. Go has polymorphism (there are polymorphic functions, all of which BEHAVE differently in the type system), there are return type polymorphic functions (f…

As I said, generics are missing, and the core team is working at them. But I really appreciate that they do not implement something like the Java generics.

If your code produces errors, you can of course add location information like stack traces, there is an API for that.

I have not benchmarked Go against Java explicitly, but I do benchmark against C and it compares very nicely in performance to C code, so for most tasks it should be as fast or faster than Java code. Go gives you more flexibility about memory layout (true value types), which keeps GC times down.

I am a programmer, with 20 years of Java on my belt and I quite love Go.

Re: Seven years of Go

#272

I've had a little exposure to Go and seen how rapid development in Go can be while still maintaining decent performance. Is anyone aware of scientific stack development in Go? Specifically, does HN think thee will be a Numpy or Scipy equivalent in Go or does this not make any sense?

> Is anyone aware of scientific stack development in Go?

there's Gonum: https://github.com/gonum

Re: Seven years of Go

#273
post #123

Earlier quoted context omitted.

It's not safer than Java. The selling point over Java is developer friendliness (simpler language, tooling, dependency management, deployment, etc).

I was asking the GP why he cited safety as a feature of Go. I agree with you; that's not a good argument.

We can look at how many security updates Java release for a particular version. I see around 35 releases for Java 8 vs 6-7 release for Go during same period.

Re: Seven years of Go

#274

Earlier quoted context omitted.

What about http://libmill.org ? There are also numerous other programming environments with similar constructs.

Not cross platform last I checked.

I guess no Windows support could be a dealbreaker, but it's definitely "cross-platform" in several senses.

Re: Seven years of Go

#275
post #221

Earlier quoted context omitted.

Doing ORMs and auth without knowing what you're doing imply a huge risk out of itself, which Go tries to avoid. If you have relational data the solution is not to use an ORM to half-abstract it away, it's to learn SQL. ORMs can be useful tools to avoid boilerplate, but they will show their ugly internals when SHTF, and those are always harder to understand than plain SQL. As for auth, it's very easy to add to any web…

> Doing ORMs and auth without knowing what you're doing imply a huge risk out of itself, which Go tries to avoid. And implementing it yourself the wrong way is also a huge risk.

Exactly the point I explained. You have to learn how it's done rather than try to look for a way out. The solution is not to have a magic tool that allows you to poorly work around the problem until it doesn't.

Re: Seven years of Go

#276
post #5

Is there a recommendable (and somewhat recent) book on how to get started with Go?

Not exactly a book but Go By Example[0] is an excellent when I start learning Go. The examples are clear and one example focuses on just one thing. I find myself going back there to refer to the example whenever I need.

[0]: https://gobyexample.com/

Re: Seven years of Go

#277

Earlier quoted context omitted.

As a Python user and fan I hear this complaint a lot. I understand but I can't really agree since things like typos and type fails pretty much never happen to me, at least in production. My secret? I use the REPL, heavily. (And not even in the grand Lisp fashion, because Python's REPL isn't very advanced, mostly I use it just off to the side and maybe or maybe not running an instance of the full program, or parts of…

> I understand but I can't really agree since things like typos and type fails pretty much never happen to me, at least in production. The typos / type fail comments are shorthand for the real complaint, which is that a long-maintained large dynamic language codebase requires continuous vigilance. I've worked in dynamic languages for most of my career (Python, JS, Clojure) and typos/type-fails are pretty rare but if…

I see nothing false in rewording your statement to "a long-maintained large codebase requires continuous vigilance". Typing doesn't seem to matter with this. At least to the extent that we believe typing doesn't have a meaningful impact on the expected size, lifetime, and complexity of a codebase to solve an arbitrary problem. (With better type systems around it is neat to see statically typed languages quite significantly narrow the gaps in expressiveness though, and in some cases beat out 'trivially dynamic' languages.)

I know I've wasted time tracking down simple issues a static type system would have caught (or just due diligence by the coder -- and some of these issues I've caused myself! Though I really can't remember any insidious to find but quick to fix typo or type fail I caused, but I'm willing to admit to a possible selective memory bias), I've also wasted time tracking down simple issues a type system wouldn't catch -- even ones like Rust's, Haskell's, and dare I say maybe even Shen's? I also spend/waste a lot of time, probably the most time in total, tracking down complex issues that got past the type system and existing tests and code reviews and personal or team diligence, and these days most often in either Java or JavaScript, neither of which are particularly great poster children for their respective type systems. (I don't want to get into the strong/weak axis.)

Issues from NPEs or divide-by-zeros or undefined function calls, or stuff that goes through the type system's mechanisms to escape the type guarantees like reflection, casts to Object, void * , unsafe, serializing class names instead of values, etc., are annoying, a sudden power outage is also annoying. Some of that can be caught and prevented by more powerful languages, but still the time to fix those is nothing compared to more complex issues resulting in all sorts of incorrect behavior. There are so many more causes than type mismatches. It seems in your career the trivial bugs from typos are rare for you too. I'm not convinced the possibility of slight inconvenience those rare issues can create is worth the certain tradeoff in losing expressive power (especially if I can't use the most expressive static languages for whatever non-tech reasons) and possibly more, nor am I convinced a static approach is even the best one when you have languages like Lisp which support types well enough to error out when you call COMPILE on a bad form but still have huge flexibility.

I wonder if all this sounds like I'm a diehard C++ fan and don't need no stinking safe memory management tools because I never get segfaults or security problems. If it does I don't think it should, but it's really hard to explain why my perceived utility of static type systems is low without just appealing to preference, firsthand, or wise authority's experiences. The argument has been going on for decades by smarter people than me on both sides. In the end maybe it's just preference as arbitrary as a favorite color but rationalized to kingdom come. I at least don't draw my preference line so narrowly at static vs dynamic, there are plenty of static languages I'd use over JavaScript, and plenty of dynamic languages I'd use over C++.

I will ask about your experience though: how does it square with people like the author of Clojure? Is he just a god-tier outlier? I don't think one could argue he hasn't done his homework, or doesn't have enough real-world experience. It reminds me of a quip graphic I saw once, it was something like a venn diagram showing an empty intersection of "dynamic typing enthusiasts" and "people who have read Pierce's Types/Advanced Types books".

Re: Seven years of Go

#278
post #273
post #123

Earlier quoted context omitted.

I was asking the GP why he cited safety as a feature of Go. I agree with you; that's not a good argument.

We can look at how many security updates Java release for a particular version. I see around 35 releases for Java 8 vs 6-7 release for Go during same period.

That's not what people mean when they refer to the "safety" of a language.

https://en.wikipedia.org/wiki/Memory_safety

https://en.wikipedia.org/wiki/Type_safety

http://tobyho.com/2008/03/30/how-safe-is-your-programming/

The fact that people consider "security releases" for compilers/runtimes to be normal and acceptable is actually extremely alarming to me, but it's different from language safety.

Re: Seven years of Go

#279
post #168

Earlier quoted context omitted.

> If you're such a poor programmer, No need for personal attacks. > then just find a different language. What a warm an welcoming community the Go community is /s C++ doesn't have reflection, because it doesn't need it. But somehow Go needs it ? Reflection is a cop-out, especially in a language that has a simplistic type system. And don't get me started on struct tags. If you cant see the obvious issue with all these…

What a warm an welcoming community the Go community is /s I have to say, I've had the "warm an welcoming /s" from the Go community myself. I'll give you a hint: You can also get the same from Smalltalk if you complain that a method can't have more than 256 temporary variables, and that this means Smalltalk isn't a real language. (How that demonstrates cluelessness is left as an exercise.) Annoying Dunning-Kruger crap…

So, Go with a more expressive type system is a worse Go?

Re: Seven years of Go

#280
post #208

Earlier quoted context omitted.

Can you create adhoc types from nothing with RTTI ? because in Go you can, at runtime. Is it what a statically typed language which community claims generics are unnecessary should prioritize as a feature ? runtime magics ? really ?

So your argument goes no deeper than, "(Say stuff that might sound bad on the surface) Really?" Can you be more substantive than appeals to prejudice? (For a change)

What is your argument?
Post reply on HN