Live data from Hacker News

NilAway: Practical nil panic detection for Go

uber.com

251–260 of 262 posts

Re: NilAway: Practical nil panic detection for Go

#251

Is there any movement in the language spec to address this in the future with Nil types or something?

Without intention to offend. It's Golang, the language that famously ignored over 30 years of progress in language development for the sake of simplicity. What answer do you expect?

Hey, can you please not do programming language flamewar (or any flamewar) on HN? We're trying for something else here: https://news.ycombinator.com/newsguidelines.html.

Partly this is out of memory of the good/bad old newsgroup days where this kind of thing somehow worked ok, until it didn't, but it definitely doesn't work on the sort of forum that HN is. We'd like a better outcome than scorched earth for this place.

Re: NilAway: Practical nil panic detection for Go

#252

Earlier quoted context omitted.

Given the choice between a (objectively) theoretically superior language like Haskell or Rust , and a language that prioritises developer ergonomics at the expense of PL research, I'll take the ergonomics thanks. We have a 1MM line c++ codebase at work, a rust third party dependency, and a go service that's about as big as the rust dependency. Building the Rust app takes almost as long as the c++ app. Meanwhile, our…

Other than compiling a bit faster, what ergonomics does Go give you that Rust doesn't?

> Other than compiling a bit faster,

It's not "a bit faster", it's "orders of magnitude faster". We use a third party rust service that compile occasionally, a clean build of about 500 lines of code plus external crates (serde included) is about 10 minutes. Our go service is closer to 5 seconds. An incremental build on the rust service is about 30s-1m, in go it's about 5 seconds. It's the difference between waiting for it to start, and going and doing something else while you compile, on every change or iteration.

> what ergonomics does Go give you that Rust doesn't

- Compilation times. See above.

- How do I make an async http request in rust and go? in go it's go http.Post(...)

In rust you need to decide which async framework you want to use as your application runtime, and deal with the issues that brings later down the line.

- In general, go's standard library is leaps and bounds ahead of rust's (this is an extension of the async/http point)

- For a very long time, the most popular crates required being on nightly compilers, which is a non-starter for lots of people. I understand this is better now, but this went on for _years_.

- Cross compilation just works in go (until you get to cgo, but that's such a PITA and the FFI is so slow that most libraries end up being in go anyway), in rust you're cross compiling with LLVM, with all the headaches that brings with it.

- Go is much more readable. Reading rust is like having to run a decompressor on the code - everything is _so_ terse, it's like we're sending programs over SMS.

- Go's tooling is "better" than rust's. gofmt vs rustfmt, go build vs cargo build, go test vs cargo test

For anything other than soft real time or performance _critical_ workloads, I'd pick go over rust. I think today I'd still pick C++ over rust for perf critical work, but I don't think that will be the case in 18-24 months honestly.

Re: NilAway: Practical nil panic detection for Go

#253
post #226

I tried it but got too many false positives to be useful.

Does a false positive mean: - You're confident that a flagged value is actually non-Nil? - A value was Nil but you prefer it that way?

https://news.ycombinator.com/item?id=38327236

Re: NilAway: Practical nil panic detection for Go

#254

Earlier quoted context omitted.

> In twenty years the industry will look back on golang as an avoidable mistake And here is my opinion: I think in 20 years, Go will still be a mainstream language. As will C and Python. As will Javascript, god help us all. And while all these languages will still be very much workhorses of the industry, we will have the next-next-next iteration of "Languages that incorporate all that we have learned about programmin…

> I think in 20 years, Go will still be a mainstream language. As will C and Python. As will Javascript, god help us all. And yet the mainstream consensus is that C and JavaScript are terrible languages with deep design flaws. These weren’t as obvious pr avoidable at the time, but they’re realities we live with because they’re entrenched. My assertion is that in twenty years, we’ll still be stuck with go but the hone…

> And yet the mainstream consensus is that C and JavaScript are terrible languages with deep design flaws.

Oh, they all have flaws. But whether these make them "terrible" is a matter of opinion. Because they are certainly all very much usable, useful and up to the tasks they were designed for, or they would have vanished a long time ago.

> and its proponents will finally be able to honestly accept and discuss its design flaws

We are already doing that.

But that doesn't mean we have to share anyones opinion on what is or isn't a terrible language, or their opinions about what languages we should use.

And yes, that is all these are: opinions. The only factually terrible languages are the ones noone uses, and not even all languages that vanished into obscurity are there because people thought them to be "terrible".

Go does a lot of things very well, is very convenient to use, solves a lot of very real problems, and has a lot to offer that is important and useful to us. That's why we use it. Opinions about which languages are supposedly "terrible" and which are not, is not enough to change that.

An new language has to demonstrate to us that its demands on our time are worth it. It doesn't matter if it implements the newest findings about how PLs should be designed according to someones opinion, it doesn't matter if its the bees knees and the shiniest new thing, it doesn't matter if it follows paradigm A and includes feature B...the only thing that matters is: "Are the advantages this new thing confers so important to us, that we have a net benefit from investing the time and effort to switch?"

If the answer to that question is "No", then coders won't switch, because they have no reason to do so. And to be very clear about something: The only person who can answer if that switch is worth for any given programmer, is that programmer.

Re: NilAway: Practical nil panic detection for Go

#255
post #249

Earlier quoted context omitted.

> I think that's a bad analogy because I actually use ABS and TC. I don't really use an enum heavy style of programming. The point the others are making is you are using a less safe type of programming equivalent to driving without ABS and TC. From your point of view, "TC and ABS is useful so I use it unlike enums". From their point of view though, you are the person not using ABS and TC insisting that they offer not…

To continue the analogy, since I don't use enums, I'm also the person who isn't driving the car. Can you explain how owning a car without ABS and not driving it is less safe? Edit: Wait, or am I not using breaks? I think the analogy changed slightly during this whole process.

> Can you explain how owning a car without ABS and not driving it is less safe?

I don't know that it is, I'm speaking based on the implication in this thread that no-enum and no-ABS people are overconfident to a fault.

I do believe that those who claim they don't need enums, static typing, etc are probably overconfident and have a strong desire or need to feel more control.

I'm not sure though, at least for GC'd languages, how enums sacrifice control.

Re: NilAway: Practical nil panic detection for Go

#256
post #244

Earlier quoted context omitted.

> We're suggesting that people should just use Rust (or Haskell, or F#, or any other robust functional programming language) instead. And how well did that work out for Haskell? https://gist.github.com/graninas/22ab535d2913311e47a742c70f1... Just because one person thinks Functional Programming is the right way to do it, doesn't mean another person has to agree. The same goes for every paradigm, and language feature…

> And how well did that work out for Haskell? You know this post is speculative fiction, right? It's actually about what could kill Haskell , not what could kill Rust?

> It's actually about what could kill Haskell, not what could kill Rust?

Here is the articles title: "What killed Haskell, could kill Rust, too"

So no, it's not about what could kill Haskell. In 2022, ~0.3% of all code pushed to github was Haskell. To put that number into perspective: vimscript was ~0.25%

Re: NilAway: Practical nil panic detection for Go

#257
post #244

Earlier quoted context omitted.

> And how well did that work out for Haskell? You know this post is speculative fiction, right? It's actually about what could kill Haskell , not what could kill Rust?

> It's actually about what could kill Haskell, not what could kill Rust? Here is the articles title: "What killed Haskell, could kill Rust, too" So no, it's not about what could kill Haskell. In 2022, ~0.3% of all code pushed to github was Haskell. To put that number into perspective: vimscript was ~0.25%

Yes, I can read the title thanks. The article is about Haskell. The first sentence makes it clear it's speculative fiction presented as if from the year 2030. The article draws a hypothetical analogy between what could happen to Rust in 2030 and what is contemporaneously happening to Haskell.

Re: NilAway: Practical nil panic detection for Go

#258
post #257

Earlier quoted context omitted.

> It's actually about what could kill Haskell, not what could kill Rust? Here is the articles title: "What killed Haskell, could kill Rust, too" So no, it's not about what could kill Haskell. In 2022, ~0.3% of all code pushed to github was Haskell. To put that number into perspective: vimscript was ~0.25%

Yes, I can read the title thanks. The article is about Haskell. The first sentence makes it clear it's speculative fiction presented as if from the year 2030. The article draws a hypothetical analogy between what could happen to Rust in 2030 and what is contemporaneously happening to Haskell.

Yes, I read the article, thanks.

Yes, it is a speculative fiction, with a good reason, because the analogies are pretty clear.

Re: NilAway: Practical nil panic detection for Go

#259
post #257

Earlier quoted context omitted.

Yes, I can read the title thanks. The article is about Haskell. The first sentence makes it clear it's speculative fiction presented as if from the year 2030. The article draws a hypothetical analogy between what could happen to Rust in 2030 and what is contemporaneously happening to Haskell.

Yes, I read the article, thanks. Yes, it is a speculative fiction, with a good reason, because the analogies are pretty clear.

And to return to the topic at hand, despite that article pointing to some weakness in the Haskell community, Haskell is thriving, so "We're suggesting that people should just use Rust (or Haskell, or F#, or any other robust functional programming language) instead" seems like reasonable advice to me.

Re: NilAway: Practical nil panic detection for Go

#260
post #259

Earlier quoted context omitted.

Yes, I read the article, thanks. Yes, it is a speculative fiction, with a good reason, because the analogies are pretty clear.

And to return to the topic at hand, despite that article pointing to some weakness in the Haskell community, Haskell is thriving, so "We're suggesting that people should just use Rust (or Haskell, or F#, or any other robust functional programming language) instead" seems like reasonable advice to me.

> Haskell is thriving

https://news.ycombinator.com/item?id=38360177

So, according to what metric is Haskell "thriving"?

Post reply on HN