8 comments

  • jzelinskie 12 minutes ago
    For SpiceDB[0], we've found a lot of success using this framework to define our own analyzers; it's probably 10x easier now with LLMs. No need for tribal knowledge or more time wasted on code review if you can just turn it into a linter and move on.

    [0]: https://github.com/authzed/spicedb/tree/main/tools/analyzers

  • b7e7d855b448 1 hour ago
    You guys can keep complaining about how go is too verbose, but I love everything about go.

    I love the error handling, I love the forced formatting, i love all the linting it has including style guides. When you read other source code it's so easy to understand it and make sense of it. Thank you go team

    (Ok, maybe I am a bit sceptical with the latest generic additions, but overall it's a great language. I love it.)

    • wannabe44 33 minutes ago
      Oh yeah totally agree. I don't understand why someone would want to write `slices.Contains(s, needle)` when you can write this beautiful poem like a Shakespeare in VSCode:

          found := false
          for _, v := range s {
              if v == needle {
                  found = true
                  break
              }
          }
      
      Oh and I totally want to build a stack trace manually. It's like doing cardio to me.

          if err != nil {
             return fmt.Errorf("my function name but in spaces: %w", err);
          }
      
      This is very elegant by the way, so that we need errors.Is now, which has to dynamically check if the error implements Unwrap() error or Unwrap() []error. Because having any language facilities for error handling is harmful.
      • msie 9 minutes ago
        You forgot to put /s after your post.
      • logicchains 19 minutes ago
        Your handwritten one has a major performance bug:

            found := false
            for _, v := range s {
                if v == needle {
                    found = true
                    break
                }
            }
        
        Do you see it? It copies the v into a local variable, which could be tremendously wasteful if it's a large struct. You should instead be taking a pointer to s[i] and comparing the value there with `needle`.

        If you'd used `slices.Contains(s, needle)`, on the other hand, it could have such a performance bug in it and you'd never know.

    • jerf 56 minutes ago
      If generics were going to ruin the language, they would have by now. I think you can rest easy.
      • ncruces 33 minutes ago
        The greatest thing about generics is … that they're not used much if at all.

        Which is a great way to make sure they're not overused, which in my experience is better than underuse.

  • jamescun 4 hours ago
    This isn't new?

    You can see it's used by _a lot_ of linters already:

    https://pkg.go.dev/golang.org/x/tools/go/analysis?tab=import...

    • tgv 3 hours ago
      I visited that link three years ago. It isn't new. It's nifty, though.
    • stephbook 2 hours ago
      It was mentioned in the Ruff article comments and probably reposted.
  • ksec 53 minutes ago
    So what is context? This isn't new and why the submission ?
  • hoppp 4 hours ago
    I was just looking for this. Will give it a spin.
  • k9294 14 minutes ago
    [flagged]
  • someworkk 2 hours ago
    [flagged]
  • dfasifsaf 3 hours ago
    [flagged]