Comment by rollulus

Comment by rollulus 9 days ago

47 replies

As the article also mentions: instead of checking if your program has a dependency on something that contains vulnerabilities, govulncheck checks if vulnerable code is actually reached. I find that so awesome. (And I know, someone is going to point out that hipster language foo does this too and better — it’s not the norm).

zelphirkalt 9 days ago

If the code cannot be reached, what is the point of having it as a dependency?

Does it know which part of a dependency has a vulnerability and check, if the execution reaches _that_ part? Then it would make sense.

  • FiloSottile 8 days ago

    > Does it know which part of a dependency has a vulnerability and check, if the execution reaches _that_ part?

    Yes, govulncheck does symbol-level reachability static analysis, and the vulndb is manually annotated with affected symbols for each vulnerability.

    (So glad to see a comment about this at the top, I have sometimes feared we made a mistake in designing a low-noise vulnerability scanner, because I've often seen complaints that "it doesn't work" because it doesn't show as many vulnerabilities as its more popular, less accurate alternatives.)

  • chucky_z 9 days ago

    My understanding is that the primary goal is to determine that if a program is pulling in a dependency, and only using a small part of it, to determine if that part is vulnerable or not. This allows a program owner to know if they need to do an emergency version bump in the face of a CVE or something like that. For some businesses doing emergency deployments is a massive deal.

lynx23 9 days ago

> hipster language

Funny, I always considered Go a hipster language for Google fanboys.

  • Cthulhu_ 9 days ago

    It kinda is if you're thinking about the manual-coffee-grinder-french-press hipster who eschews automatic coffee makers. Rob Pike doesn't believe in syntax highlighting and to date the Go website / interactive editor doesn't have any. "When I was a child, I used to speak like a child, think like a child, reason like a child; when I became a man, I did away with childish things."

    Anyway, that's fine, I like Go and I like grinding coffee manually on occasion.

    • lynx23 9 days ago

      Funny, I have a similar analogy when it comes to mice: Small children lacking verbal communication skills can only point at things, which is the equivalnet of using a"pointing device". When they grow up, they learn to speak meaningful sentences to express themselves. Which is equvalent to learning to use the command line...

    • timeon 8 days ago

      > french-press

      How is that hipster? Did you mean aero-press?

      • bccdee 8 days ago

        A lot of people see anything other than a Black & Decker drip coffee pot or a Keurig pod machine as "hipster coffee," somehow. But being perceived as hipsterish is the only thing that makes something hipsterish, so they can't really be wrong.

  • silverliver 9 days ago

    Perhaps, but all I really care about is having a complied, strongly-typed language with a fully-featured modern stdlib and good cross-compilation support that includes wasm. If that comes with an automatic admission to the Google Fanboy Club, then sign me up.

    What other well-established languages do we have that meet this criteria? I know .net is a strong contender but do we have other options?

    • vlovich123 9 days ago

      Rust & Java also come to mind (yes, Java can be AOT compiled). Erlang too if you want more fearless concurrency if you’re OK with JIT languages. There’s lots of alternatives to Go in its space but it does have mindshare and there’s nothing wrong with staying on the well trodden path even if it’s full of if err != nil instead of sane error chaining built into the language.

      • johnisgood 9 days ago

        I have nothing against "if err != nil", in fact, I like it.

        As for a replacement of Go, I would have to say Erlang or Elixir. I use Go code for non-serious distributed software, and Erlang and Elixir for more serious ones. That is not to say that Go cannot be used for serious stuff though.

      • pjmlp 9 days ago

        Regarding Java, since early 2000 to be more precisely, although it required paying for commercial JDKs like Excelsior JET.

        Nowadays besides the more well known GraalVM, there is OpenJ9 and its cousin Android since version 5.

        PTC and Aicas remain as two well known commercial Java vendors, with AOT toolchains, alongside bare metal and real time GC support, although their focus is embedded deployments.

      • fmbb 9 days ago

        Erlang is not strongly typed and cross compiling apps with native dependencies is not straightforward. Running it on WASM is not common (is it possible?). It does not have a comprehensive standard library like Go.

        It is compiled though.

        • vlovich123 9 days ago

          Erlang is most definitely strongly typed [1]. Perhaps you confused static & dynamic typing? Easy mistake to make. Similarly, from what I could find Erlang is typically run on BEAM [2] which is an interpreter virtual machine that executes BEAM byte code (with a JIT option).

          Since I’m not an expert on either language, here’s my take of how ChatGPT summarizes Erlang vs Go on various options.

          Go’s standard library is primitives driven for general purpose programming while Erlang’s is purpose driven for distributed programming. So it depends on what you mean by “comprehensive”. For example, out of the box Erlang provides an environment for writing correct, robust distributed programs. If comprehensive means having a bunch of knives & start juggling that’s a different use case.

          [1] https://learnyousomeerlang.com/types-or-lack-thereof#:~:text....

          [2] https://www.erlang.org/blog/beam-compiler-history/

      • neonsunset 9 days ago

        Erlang is interpreted. It is in the same class of performance as Python and Ruby. If you want a relatively high-level and performant alternative with great concurrency support your options are C#/F# (you are likely find the tooling pleasant) and perhaps JVM languages once they adopt structured concurrency (but you are likely to find the tooling less pleasant).

        Graal Native Image support is very niche and does not provide the same level of experience as .NET’s NativeAOT nor has tricks up its sleeve like static linking with native libraries.

      • mjevans 9 days ago

        Go / golang added https://pkg.go.dev/errors

        Which includes nested / stacked errors and helper functions for checking them.

        It doesn't implement error classes, but you can create a stacked chain of errors which achieves the same sort of 'Handle a classification of error' (anything which includes that class).

        Older libraries don't use these features, as far as I know. So it's sort of like the half-baked enumerate everything sort of generic functions that older stable versions (like on hacker rank) ship.

  • paulddraper 9 days ago

    You either die a hipster or live long enough to become mainstream.

    • Cthulhu_ 9 days ago

      Go is a retro nostalgia language, taking programming languages back to basics, removing syntax highlighting and advanced concepts like exceptions and function shorthands because that's what it was like in the 70's.

      • rob74 9 days ago

        Pray tell, what is it about Go that stops editors from using syntax highlighting when displaying Go code?

        Seriously, IMHO Go is less "retro nostalgia" and more trying to stick to proven concepts (e.g. there was no test driven development in the 70s, and Go has testing/documentation/examples built into the language) while leaving out things like exceptions and inheritance that, while widespread, have significant disadvantages.

      • euroderf 9 days ago

        I'll give up my Go when you pry this PDP-11 emulation from my cold, dead hand.