19. Rob Pike - What We Got Right, What We Got Wrong | GopherConAU 2023

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 140

  • @gopherconau
    @gopherconau  7 หลายเดือนก่อน +26

    Folks, we love that you comment, but as a reminder, please keep your comments civil, and always aim to add to the discussion. If you have nothing to add to the discussion, please refrain from commenting. Otherwise it takes a lot of effort to moderate the comments.

  • @esra_erimez
    @esra_erimez 8 หลายเดือนก่อน +95

    After my firm moved a not so trivial sized code base from C++ to Go, I can say that in my very humble opinion Go got a whole more right than wrong. the team that created Go (including, but not limited to, Rob Pike and Ken Thompson) are the giants that we stand on the shoulders of. When designing the language, it appears to me that they made design decisions based on first principles. Taking influences from C and Modula-2 was (again, in my very humble opinion) as opposed to object oriented languages created a language that didn't have the baggage that comes along with it.

  • @StefanoTorresi
    @StefanoTorresi 7 หลายเดือนก่อน +11

    So I went on Wikipedia to refresh my knowledge of all the amazing things this man did for the software industry, and I realized he looks two decades younger than he actually is. Way to efffin go, Rob!

  • @nexovec
    @nexovec 8 หลายเดือนก่อน +16

    33:26 Rob Pike describes telemetry of google chrome.

    • @programmer1356
      @programmer1356 7 หลายเดือนก่อน +6

      take a look at mobile phone keyboards - shock horror

  • @g227x01
    @g227x01 8 หลายเดือนก่อน +17

    For me, the major bloopers are allowing naked returns and weak enums. Had my share of bugs mostly due to those two things.

  • @ajstarks
    @ajstarks 7 หลายเดือนก่อน +4

    Nice to see a shout out on the gofmt slide

  • @voidvector
    @voidvector 8 หลายเดือนก่อน +81

    Lack of generics early on has created a lot of undesirable legacy code in the Go projects I encountered:
    * Excessive `reflect` package with `any`
    * Using text template to generate Go code
    * Using AST to generate Go code
    All of these should be rewritten with generics, but there are 50,000 lines of them.

    • @nas337
      @nas337 8 หลายเดือนก่อน +19

      If it works, it works.
      Generics in my opinion was one step forward to all feature bloat we see in other programming languages. I wish the Go team won’t introduce to many features in syntax like Rust team did. So the language hasn’t had at least 3 ways to do one thing.

    • @voidvector
      @voidvector 8 หลายเดือนก่อน +25

      @@nas337 I just described 3-4 ways of doing the same thing though.
      Witty engineers are going to abuse the lack of features by using outside tools (e.g. codegen, preprocessor), just as they do in misusing language features if the language has a bloat of features.

    • @RicardoSilvaTripcall
      @RicardoSilvaTripcall 8 หลายเดือนก่อน +3

      Why rewrite something that would work exactly the same as before? Just for the sake of it?

    • @voidvector
      @voidvector 8 หลายเดือนก่อน +11

      ​@@RicardoSilvaTripcall There are a bunch of reasons
      * codegen is not available for linter / code search / bug analysis tools / test coverage analysis
      * codegen is difficult to understand and difficult for devs to update going forward.
      Rewrite would have to be weighted against other priorities, of course. So except for mission critical code, would likely not be done at most shops.

    • @sealoftime
      @sealoftime 8 หลายเดือนก่อน +2

      @@voidvector in what way is codegen not available for source code analysis?

  • @Zamicol
    @Zamicol 8 หลายเดือนก่อน +13

    Great talk. Thank you Rob.

  • @MisterDevel
    @MisterDevel 5 หลายเดือนก่อน

    Love listening to Rob.

  • @ismaelgrahms
    @ismaelgrahms 8 หลายเดือนก่อน +10

    Great talk, 14 years of progress

  • @onsearchfocus
    @onsearchfocus 8 หลายเดือนก่อน +15

    Nice to see Rob being honest but I expected this talk to be about the Go type system. It's less than optimal. It misses Enums built-in.

  • @oleksandrgaiovskyi
    @oleksandrgaiovskyi 8 หลายเดือนก่อน +21

    In the concurrency example at 13:20 if timeout happens, goroutines that didn't complete will be stuck, as writing to the channel will be blocked forever.

    • @YuriyNasretdinov
      @YuriyNasretdinov 8 หลายเดือนก่อน +5

      Yeah good point, should've been a channel of capacity 3. I think this example is flawed in more ways than one, e.g. it doesn't use contexts, so the other queries aren't cancelled after a timeout, etc.

  • @RonJohn63
    @RonJohn63 8 หลายเดือนก่อน +3

    When seeing "Gopher" and and greybeard like "Rob Pike" in the title, I thought of the old Minnesota link-hierarchy server.

  • @robervaldo4633
    @robervaldo4633 4 หลายเดือนก่อน +2

    after the citation of ousterhout I wen to look at the threads paper, and to me it seems ousterhout is still right, and pike got ousterhout's message wrong (just look at the conclusion slide), pike's own admission of "doing concurrency like things sometimes without even realizing it" is a problem and in agreement with ousterhout
    (but then, of course, he later goes on to talk exactly about the problems ousterhout stated ...)

  • @Alberto_Cavalcante
    @Alberto_Cavalcante 8 หลายเดือนก่อน +8

    I'm glad he mentioned "Go 2" is no longer going to exist.

    • @Mglunafh
      @Mglunafh 8 หลายเดือนก่อน +9

      Go 2 considered harmful

    • @EbonySeraphim
      @EbonySeraphim 8 หลายเดือนก่อน +7

      If they admit Go2 is an eventuality or even a remote possibility, Go dies. No one will want to build knowing theirs a time bound on the future of their platform, unless they agree to a huge future migration effort.

    • @Alex-lu4po
      @Alex-lu4po 6 หลายเดือนก่อน

      @@EbonySeraphimYou mean like every other language?

    • @EbonySeraphim
      @EbonySeraphim 6 หลายเดือนก่อน

      @@Alex-lu4po yes, just like every other language that isn’t being discussed now.

    • @Alex-lu4po
      @Alex-lu4po 6 หลายเดือนก่อน

      @@EbonySeraphim but where should they migrate to then?

  • @madlep
    @madlep 8 หลายเดือนก่อน +46

    Would be interested to hear more about introducing sum type (ie Rust style enum, or Haskell style data declarations). Especially around error handling using Option/Result sum types to handle nil/error values, along with some syntax to “bubble up” errors out of a function like Rust ? operator.
    I die a little bit every time I see any non trivial go code, and > 50% of the line count is `if err != nil { return err }`
    “But you should be explicitly handling errors!” Is the usual go community apology. Sure, if you actually handle them. If you’re just returning them for calling code to do something with them (probably just check for nil and return them again), that’s not “handling” them.
    And having nil at all is just a massive footgun that could have been eliminated. Then go doubles down on nil by having typed nils, so there are a bunch of edge cases where nil != nil.
    It’s like they heard nil was a billion dollar mistake, and said “You know what? Let’s aim for a TRILLION dollars!”

    • @alurma
      @alurma 8 หลายเดือนก่อน +1

      The interaction with interfaces is tricky. There is an open issue on sum types.

    • @doBobro
      @doBobro 8 หลายเดือนก่อน +2

      BTW rust/haskell Option is awful from composing and keep interfaces stable perspective. Most code keeps defensive stance and makes function arguments and results Optional to keep compatibility in case of requirement changes. You can't add or remove optionality later without code breaking especially for libraries. Zig at least allows to keep stability on T -> Optional argument refactoring.

    • @tinusgraglin2079
      @tinusgraglin2079 8 หลายเดือนก่อน +1

      @@doBobro I don't know any Zig, so if the argument T turns to Optional and receives "Nothing", will the function return error? Or simply panics? Maybe somehow Zig will pick a default value?

    • @tinusgraglin2079
      @tinusgraglin2079 8 หลายเดือนก่อน

      @@doBobro Oh, you are saying that all the call sites of the function don't have to change, so it's kind of like "Type *" (i.e. pointers) in C, but the function receiving an "Type *" has to deal with it probably being NULL?

    • @tinusgraglin2079
      @tinusgraglin2079 8 หลายเดือนก่อน +1

      @@doBobro But what about u64 -> Optional? Before, the caller just passes any u64, so the raw value of an Optional will be just that u64, than how can we distinguish Nothing and Something(value)? Will the Zig compiler automatically transform all u64 at the call sites into e.g. (true, u64_val)?

  • @tmaffia
    @tmaffia 6 หลายเดือนก่อน

    Great Talk

  • @johnnm3207
    @johnnm3207 8 หลายเดือนก่อน +6

    if you initialize a memory arena aren't you supposed to clean it up yourself instead of GC?

    • @ismaelgrahms
      @ismaelgrahms 8 หลายเดือนก่อน +5

      In Go the GC cleans it for you. What you do is say I’m not using the arena anymore. But the GC will do the cleanup

  • @EL-gz3sh
    @EL-gz3sh 8 หลายเดือนก่อน +8

    Is there any plan to fix what they got wrong?

  • @kuhluhOG
    @kuhluhOG 8 หลายเดือนก่อน +13

    8:50 While Go is great, I would argue that there another language which is even better at it: Zig
    But then again, it's considerably younger.

    • @YuriyNasretdinov
      @YuriyNasretdinov 8 หลายเดือนก่อน +4

      Yeah the way Zig implements cross compilation is super neat. However Go's cross-compilation also works well unless you use cgo.

    • @kuhluhOG
      @kuhluhOG 8 หลายเดือนก่อน +1

      @@YuriyNasretdinov except for your non-GO dependencies
      Zig can crosscompile well even C and C++ stuff for you (you can just use it as a C/C++ compiler dropin)
      because of that one company has a contract with the Zig foundation to keep this well maintained for their Go dependencies

    • @alurma
      @alurma 8 หลายเดือนก่อน +1

      Funny comment!

  • @BohdanTrotsenko
    @BohdanTrotsenko 2 หลายเดือนก่อน

    I wish there was another (functional) language using go runtime.

  • @rmhartman
    @rmhartman 6 หลายเดือนก่อน

    the overly strong dependence on git has been the bane of my existence

  • @metaltyphoon
    @metaltyphoon 8 หลายเดือนก่อน +12

    Seriously. Passed and amazing opportunity for o ask some “trivial” questions

    • @RootsterAnon
      @RootsterAnon 8 หลายเดือนก่อน +8

      I am shocked, what kind of audience was that? Bunch of students apparently with no exp. They can't even form a question for this man. Arenas was a good question, i would ask that since I think they are cool, but as he mentions, very dangerous if not done correctly.

  • @koalakakes
    @koalakakes 7 หลายเดือนก่อน +2

    Honestly some of the go docs are still awful. Not as bad as a lot of the package documentation for a lot of packages like the AWS SDK for Go but that's not the Go teams fault

  • @nickandrievsky5705
    @nickandrievsky5705 8 หลายเดือนก่อน

    Thank you!

  • @nodidog
    @nodidog 7 หลายเดือนก่อน

    I want the wallpaper from the beginning!

  • @tombyrer1808
    @tombyrer1808 7 หลายเดือนก่อน +2

    ** Strobe light warning **
    (editor: some of us need this warning)

  • @chrimony
    @chrimony 8 หลายเดือนก่อน +13

    Go's biggest sin is being only moderately better than Java. It's no wonder C++ still plays a big role at Google, because Java already took over where C++ would have otherwise been used. The remaining cases where C++ is still used would not be written in Go for the same reasons it wouldn't be written in Java.
    I do have to say that Go is quite a pleasant language to use when it comes to working with binary formats. Just the right amount of succinctness and type checking.

    • @vladlazar94
      @vladlazar94 8 หลายเดือนก่อน +8

      At the present moment (early 2024) Java is arguably in a better shape than Go. With the introduction of virtual threads in OpenJDK 21, there’s one less reason to adopt Go.

    • @vladlazar94
      @vladlazar94 8 หลายเดือนก่อน +4

      I’m saying this as someone who’s allergic to Java and who’s been rooting for Go for a long time. It might be a lost cause by this point unfortunately.

    • @danvilela
      @danvilela 8 หลายเดือนก่อน +7

      Java uses too much ram. Go is better. People hate java. People love go. Wtf are you talking about?

    • @chrimony
      @chrimony 8 หลายเดือนก่อน +7

      @@danvilela Go has a garbage collector -- which means it uses extra RAM just like Java does. Go introduced "goroutines", a threaded implementation of co-routines, but didn't solve the underlying problem of concurrency bugs. The only real benefit to Java users would have been the type system, but even there they didn't have generics until over 10 years later.
      As such, despite the initial excitement around Go, interest has petered out. It was never going to replace C++ because of garbage collection, and it didn't do enough to replace Java. It's a quirky language with a moderate following, and that's all it will ever be.

    • @ooijaz6063
      @ooijaz6063 8 หลายเดือนก่อน +6

      ​@@chrimony
      [speaking from web dev point of view]
      In real world scenarios java memory usage is much higher than go.
      In go you can really easy optimize memory usage, by using object pooling, which is not possible in java due to lack of out parameters (in libs / frameworks / std api).
      In java most of the frameworks doesn't care about object allocation, and you end up with massive memory usage.
      While I agree that java and go are simillar in the use cases, and java is more performant, in many ways, than go, the fact is that go ecosystem focuses on the performance, while java ecosystem focuses on the developer productivity (which leads to the configuration driven development) and often doesn't care about optimization, which leads to bloated software from the beginning.
      Java ecosystem lead to the generation of the developers, which doesn't understand anything about web dev, they just know how to configure framework of the choice.

  • @techaido
    @techaido 7 หลายเดือนก่อน

    if err != nil go 🎊

  • @haliszekeriyaozkok4851
    @haliszekeriyaozkok4851 8 หลายเดือนก่อน +4

    26:54 Indeed, go's module system is it's one of the worst sides of it. It's way more better how node.js and rust handles that, when i struggle to understand go's module system i've experienced very big frustration.

  • @kahnfatman
    @kahnfatman 3 หลายเดือนก่อน +3

    Baking telemetry into a programming language is a TOTAL NO GO. I would ditch the entire ecosystem and fallback onto ASM if all languages did that. Even those who assert that it is an opt-in should be scrutinized. Apparently they got paid by Ggl and speak on behalf of Ggl's interests.
    STOP SPYING
    STOP GLORYING BACKDOORS.

  • @Edwin-nl3qu
    @Edwin-nl3qu 8 หลายเดือนก่อน +13

    The thing is, "we are boring on purpose" gets really old after a decade. Now it looks more like an excuse for intellectual masturbation or just laziness..
    I really don't think it has much to do with backwards compatibility either, a lot of cool things can be done while still maintaining backwards compatibility.
    Theres been so much innovation in the languages world over the past decade. I'll even agree that most are bad ideas or not compatible with go but there are a few good ideas there and even some that a compatible with go.. if not copying, they should at least inspire some action or innovation..

    • @AJewFR0
      @AJewFR0 7 หลายเดือนก่อน +1

      What innovations?

    • @jabuci
      @jabuci 7 หลายเดือนก่อน +1

      @@AJewFR0 Just look at Swift. But to mention just one: optional parameters.

    • @ttng_
      @ttng_ 7 หลายเดือนก่อน

      ​@@jabuciI find swift to be incredibly hard to read, with too many features. Anyways, optional parameters can be implemented with pointers and a bit of godocs on top of the function to make sure people know what the params serves.

  • @jimxu1963
    @jimxu1963 8 หลายเดือนก่อน +1

    I LOVE GO!

  • @clementdato6328
    @clementdato6328 8 หลายเดือนก่อน +5

    The existence of a design choice is the result of a lack of specification for the problem.

  • @foljs5858
    @foljs5858 8 หลายเดือนก่อน +8

    I don't think that the person mainly responsible for most of what Go got wrong is in position to objectively say what it got right and wrong

    • @blain20_
      @blain20_ 7 หลายเดือนก่อน +6

      Silly take.

    • @foljs5858
      @foljs5858 7 หลายเดือนก่อน +5

      @@blain20_ Silly, but true

    • @blain20_
      @blain20_ 7 หลายเดือนก่อน +1

      @@foljs5858 Nah. The designer of the language knows best what he should've and could've done.

    • @Whateverworksism
      @Whateverworksism 7 หลายเดือนก่อน +7

      You should look "retrospection" up in a dictionary.. This is a very healthy exercise and what you say is absolutely true, which is why one needs to be aware of it when making such an analysis. I find it quite incredible, that your only contribution to a 40+ min video, is your take without any nuance. Also, I mean you are incredible as in not-credible.

  • @marcusaurelius6607
    @marcusaurelius6607 8 หลายเดือนก่อน +26

    audience is so dead and clueless. god, there are so many questions, why making and working with dynamic libraries is so broken (still, 7? 8? years and counting), why not let people use the syntax that stdlib is using (for example creating a custom map type mymap[type]type that implements an rb-tree inside), what was the reasoning behind not allowing operator overloading and so on and so forth

    • @natea.2926
      @natea.2926 8 หลายเดือนก่อน +15

      Maybe you can clarify your question about dynamic libraries, I'm not sure what you mean.
      As far as the map syntax, you can use myMap[type, type] since 1.18, which most people would consider just as good (I actually think they should allow map[keyType, valueType] with the built-in map implementation, but that's another discussion.)
      I personally have never seen operator overloading used in a way that was clearer than named methods. Now to understand what >> does, for example, I need to figure out what types its operands are, then find the correct overload definition, when a well-named method just lets me read the LOC without digging into all of that. For a language whose design was largely driven by the principal of readability over tenseness, operator overloads seem to me like an illogical addition.

    • @JamesHenstridge
      @JamesHenstridge 8 หลายเดือนก่อน +6

      maps and slices are not stdlib features: they're part of the language itself. He mentions this during the talk as a bit of a wart, and something that might have been done differently if generics had been part of the original language design.
      If it does ever happen, it'll probably be in the form of mapping some of that special language syntax to something a regular Go type can implement, and moving those container types to the stdlib.

    • @gopherconau
      @gopherconau  8 หลายเดือนก่อน +33

      We highly welcome you to come to the next GopherConAU. We also provide travel assistance to speakers, so if you would so incline, you could put in a talk when the CFP opens. CFPs have a 4% acceptance rate so it's pretty high.

    • @codenamelambda
      @codenamelambda 8 หลายเดือนก่อน

      ​​@@natea.2926For things like linear algebra as an example, operator overloading makes things MUCH more readable IMHO. Especially if you're in a higher level language anyway. I think the problem is when operator overloading doesn't come with guarantees (for the most part) as seen in ie C++ or Python. But in Haskell, if you see a

    • @pikzel
      @pikzel 8 หลายเดือนก่อน +24

      @@gopherconau That snarky comment is so representful of the go community.

  • @johnmigcruz2323
    @johnmigcruz2323 7 หลายเดือนก่อน +3

    I just don't like the language named Go.
    It's not even unique.
    Go? Why is it called Go?
    Is it because it's fast?
    So unusual.
    What a name! 😅

    • @beefchicken
      @beefchicken 3 หลายเดือนก่อน +3

      And languages named after snakes, rocks, random letters, corrosion and punctuation are better named?

  • @PRIMARYATIAS
    @PRIMARYATIAS 7 หลายเดือนก่อน

    Odin > Go 🔥🔥🔥

    • @gopherconau
      @gopherconau  7 หลายเดือนก่อน +6

      This adds nothing to the discussion.

    • @jabuci
      @jabuci 7 หลายเดือนก่อน +2

      @@gopherconau That's an arrow. From Odin to Go.

  • @manit77
    @manit77 8 หลายเดือนก่อน

    Please add try catch

    • @BarakaAndrew
      @BarakaAndrew 7 หลายเดือนก่อน +10

      Hell no

  • @jasonstewart_ky
    @jasonstewart_ky 8 หลายเดือนก่อน +73

    No disrespect to Go or Rob Pike, but try running the race condition checker on many popular Go projects. Ousterhout is still right.

    • @jasonstewart_ky
      @jasonstewart_ky 8 หลายเดือนก่อน +12

      @@linearz names withheld to protect the guilty

    • @Y-JA
      @Y-JA 8 หลายเดือนก่อน +10

      Could you elaborate on that? Why is that? Do you think that golang is more race-condition prone than other languages and why? Also, would that be a problem in all languages that implement stackful coroutines with green threads or is it specific to go?

    • @jasonstewart_ky
      @jasonstewart_ky 8 หลายเดือนก่อน +17

      @@Y-JA Ousterhout wrote that threads are--not always, but *usually*--a bad idea. Rob thinks he has refuted John's paper in some way with goroutines and channels. From what I have seen in popular projects, goroutines, channels, green threads, etc have only served to strengthen John's argument, not weaken it.
      This is not specific to Go, but any "easy concurrency" language where people dash off threads without thinking carefully.

    • @madlep
      @madlep 8 หลายเดือนก่อน +33

      If Go had avoided accessing shared state from a different go routine, and forced all coordination via channels it would have gone a long way towards concurrent safety. As it is, you can do whatever thread-unsafe access to any data at anytime from anywhere, and you’re back in the same mess of having to hope mutexes and things are being used correctly (spoiler - they’re not being used correctly)

    • @krumbergify
      @krumbergify 8 หลายเดือนก่อน +1

      @@jasonstewart_kyYes, you can cause data races in Go, but the race detector is fast and easy to use in both unit tests and in e2e application tests. I do find races in my own code once in a while, but they are rare.