Earlier quoted context omitted.
> MRV, go does not have tuples. > MRVs mostly end up being worse tuples I think you noticed yourself that you’re getting too hung up on terminology. Multiple return values are a half-hearted, non-reified version of tuples.
No, MRVs can actually offer useful properties and features, that is what they do in Common Lisp. That Go does not do that has nothing to do with MRVs.
Lies we tell ourselves to keep using Golang (2022)
441–450 of 526 posts
Re: Lies we tell ourselves to keep using Golang (2022)
#442This article makes a lot of great points about the shortcomings of Go. I don’t think explicit error handling is one of them however. I’ve previously spoken about my loathing of exception handling because it adds a “magic” layer to things which is way too easy to mess up. From a technical standpoint that isn’t necessarily a good argument, but from a pragmatic standpoint and decades of experience… well I will take expl…
Re: Lies we tell ourselves to keep using Golang (2022)
#443Earlier quoted context omitted.
One of my dreams is for someone to create a Rust stdlib, full stop. I love Rust the language, but the current bazar of little bits of functionality scattered around in the form of a zoo of crates is such a mess compared to, say, Java's class library (I/O, data structures, std. algorthms for searching, sorting etc., arranged in a logically and hierarchially named way). I'm not against alternative implementations, but…
No! I mean, yes, but not an official one. The stdlib is where good ideas go to die. Waiting for "pub struct RDBMSInferfaceV17ThisTimeWeGotItRightForSure"
Sylvain Kerkour described the problems Rust faces by having a limited standard library:
"The time has come for Rust to graduate from a shadow employment program in Big Tech companies to a programming language empowering the masses of engineers (and not just "programmers") wanting to build efficient and robust sfotware.
What crypto library should we use? ring, RustCrypto, rust-crypto (don't use it!), boring, aws-lc-s or openssl?
Which HTTP framework? actix-web, axum, dropshot or hyper?
What about a time library? time, chrono or jiff (how I'm even supposed to find this one)?
You get it, if you are not constantly following the latest news, your code is already technical debt before it's even written. Fragmentation is exhausting.
I just looked at the dependencies of a medium-sized project I'm working on, and we have 5+ (!) different crpyto libraries: 2 different versions of ring, aws-lc-rs, boring, and various libraries from RustCrypto. All of this because our various dependencies have picked a different one for their own cryptographic usage. This is insane, first because it introduces a lot of supply chain attack entry points, but also because there is no way that we will audit all of them"
Source: https://kerkour.com/rust-stdx
My moderate-sized Rust web service project requires 587 third-party crates which seems ridiculous.
Fortunately, cargo makes it easy to manage the dependencies, but unfortunately I don't know how well supported or maintained the dependencies are. How well will they be maintained in five years from now? Will I need to find newer libraries and rewrite portions of my project to provide the same features that I have now? I don't know.
Re: Lies we tell ourselves to keep using Golang (2022)
#444Earlier quoted context omitted.
Having programmed for over 30 years, including nearly a decade of C#, I would say exceptions are one of the worst ideas in all of programming. They are just horrific gotos that any library can invoke against your code. They are pretty much never, ever handled correctly. And nearly always, after an exception is “handled”, the application is actually in an unknown state and cannot be reasoned about. Even junior enginee…
I agree about implicit exceptions, but I think that there is a sweet spot with explicit exceptions like Swift (and maybe Java): where you cannot not-handle one, it is part of a function's signature, and the syntax is still compact enough that it does not hurt readability.
Re: Lies we tell ourselves to keep using Golang (2022)
#445Earlier quoted context omitted.
Have you tried the approach that Zig has, or the approach that Rust has? They are easy to debug and do not use any crazy stuff, just simple syntax like `try x()` (Zig) or `x()?` (Rust)
Yes and that syntax sucks.
Re: Lies we tell ourselves to keep using Golang (2022)
#446Earlier quoted context omitted.
Commercial software is what pays my rent though. Why would I bother about open-source software other than personal interest?
You should bother because of the externalities that aren't captured by capitalism. Also OP never called anyone a poor programmer, he said the language was made FOR poor programmers. Rob Pike, one of the people who came up with golang (and unix) is quoted as saying: > They’re typically, fairly young, fresh out of school, probably learned Java, maybe learned C or C++, probably learned Python. They’re not capable of und…
Re: Lies we tell ourselves to keep using Golang (2022)
#447Earlier quoted context omitted.
I’m not sure I understand the packed structs complaint. I have used Go to read binary data and it’s quite easy. You just need to ensure that all of your struct fields have fixed sizes e.g. int32 or [4]int64 or whatever. Unless I’ve misunderstood what you mean?
Yes it works, but you can't state the endianness and you have no control to decide if the compiler will decide to insert padding. It's undefined. You HOPE it works.
Re: Lies we tell ourselves to keep using Golang (2022)
#448Earlier quoted context omitted.
I meant weird/useless in the sense of that it's used virtually nowhere in practice. There is a nice func Must(value, err) { if err { panic(err) } else { return value } that you can use in tests to get around the inane regular error handling. But that's about it, to my knowledge. Sad that there isn't more to it. If literally everything returns error as last return value, there could well be some syntax sugar there.
I see it used often, even in languages that don't formally support multiple return arguments – with some hacked up array/object single value return to try and emulate what would be better represented as multiple return arguments. Like I mentioned in another comment, Go does seem especially prone to attracting developers familiar with other languages who insist on trying to continue to program in those other languages…
If the language doesn't have tuples, then you have to "roll your own" and emulate them every single time, but it's not a functor so you can't do all the useful stuff.
Go didn't do the pragmatically right choice, because it's only right from a type perspective. But go doesn't care about types at all, they're just a side effect. Go only needed to return multiple values, so that you don't have to pass in one (or more) "out" pointer as argument, and check an errnum. So go is right but only from its narrow perspective: it's better than C.
Re: Lies we tell ourselves to keep using Golang (2022)
#449Earlier quoted context omitted.
A segfault is a security vulnerability :) I expect a modern programming language that has a runtime to not do that, correct.
> A segfault is a security vulnerability :) Fair enough. > I expect a modern programming language that has a runtime to not do that, correct. But how do you define "has a runtime"? Java clearly has one - the JVM. Go produces standalone code, though. Or do you say that it has a runtime because it has a garbage collector that is running while the program runs? The original Pascal didn't have a runtime (if you weren't u…
So if I put the jvm and my .jar file inside a single .zip file java no longer has a runtime?
And since C applications load .so files they do have a runtime?
Having a runtime is independent of the amount of files you need to read to run the program.
Re: Lies we tell ourselves to keep using Golang (2022)
#450Earlier quoted context omitted.
If it was created on purpose for poor programmers, it seems to have been created to enable poor programmers to write the poor code they wanted to write, instead of making it impossible for poor programmers to write any code. I guess that's the difference, if you want code, no matter the quality, you have one choice, if you want code that's correct, you have another.
Yeah I feel Go is simple in the way people say "C is simple" (without the footgun part) It was created for one purpose and it kinda works but it's clunky. Like there are no fancy front loaders or backhoes and there's a limit on how much out of that form you can get.