Announcement

Collapse
No announcement yet.

GCC 9 Offering Up Better Error Messages, JSON Output Support

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • GCC 9 Offering Up Better Error Messages, JSON Output Support

    Phoronix: GCC 9 Offering Up Better Error Messages, JSON Output Support

    Besides new/improved CPU targets, C++20 additions, and a lot of other additions to the code-base for GCC 9, there is also continued work on usability improvements for developers to make their lives easier and helping out with more precise error/warning details...

    http://www.phoronix.com/scan.php?pag...Error-Messages

  • #2
    To be honest it would be pretty handy if every command line utility outputted as json.

    Then the Terminal can display those results however the user prefers or needs them.

    Comment


    • #3
      Originally posted by Britoid View Post
      To be honest it would be pretty handy if every command line utility outputted as json.

      Then the Terminal can display those results however the user prefers or needs them.
      So we're reinventing PowerShell?

      Comment


      • #4
        Originally posted by numacross View Post

        So we're reinventing PowerShell?
        Yes..

        Comment


        • #5
          Originally posted by Britoid View Post
          To be honest it would be pretty handy if every command line utility outputted as json.

          Then the Terminal can display those results however the user prefers or needs them.
          Not to mention how much easier it would be to write code if there was a standardized output model like that. Being able to source a variable over some weird ass grep/sed/cut one-liner would be nice.

          Just look at all the crap with /usr merges and systemd...we can't even agree on where to save or how to start stuff. We damn sure ain't gonna agree on a standardized output model that every frickin program would somehow be expected to follow, but damn would it be nice.

          Comment


          • #6
            Originally posted by Britoid View Post
            To be honest it would be pretty handy if every command line utility outputted as json.
            For the love of Bob. Command line is a scriptable user interface.

            If you need to get a real job done use a real scripting programming language like Lua or Python with the appropriate library.

            Comment


            • #7
              Originally posted by numacross View Post

              So we're reinventing PowerShell?
              but JSON is widely adopted, and it's still text, while I think most of us have no idea about what PowerShell is passing.
              Last edited by zxy_thf; 03-08-2019, 02:49 PM.

              Comment


              • #8
                While parsing structured data with `jq` is nice, grep/sed/awk is guaranteed to stay, as not everything is as simple as selecting a property. Quite often there's a need for minute manipulations. Either way there's a need for learning and practicing string manipulation tricks.

                The terminal interface is human first, machine second. Having custom formats, 2D tables, column alignment, joined strings, lack of escape characters all help with human readability, where as separating each item into individual properties would turn output one dimensional, hinder output density, cause more lines and noise.

                So the preferred method is to deliver both, machine readable and human readable, like `ls` for humans, `find` for machines. If you really want `find` to output JSON, here ya go: `find . | jq -Rn '[inputs]'`, I wonder why I don't like the output though. My guess is 1D newline delimited arrays (or simple lists) are easier to reason about, and write, and It's good enough for 90%. Thus I rather have two 90% implementations, than one 100% implementation.

                PS: I find JSON to be awkward format for humans to manipulate or read. Preferring Yaml, but that doesn't matter, as one can convert Yaml or even XML to JSON and manipulate that (see `yq, xq` https://github.com/kislyuk/yq)
                PPS: Be cultural, don't use new lines in filenames. Or control codes. Ya messed up boi. ; )

                Comment


                • #9
                  Why can't they expose some APIs like what clang does so others can implement a language server on top of it...

                  Comment


                  • #10
                    Still waiting for a gcc daemon to speedup builds. On large projects, a significant amount of build time is spent forking, loading/parsing the same files over and over etc. instead of compiling..

                    Comment

                    Working...
                    X