from Hacker News

Code Annotations for SourceHut

by kragniz on 7/8/19, 2:11 PM with 32 comments

  • by Scaevolus on 7/8/19, 7:44 PM

    These ideological decisions don't sound very pragmatic. There's a lot of open-source prior art in this space (OpenGrok, Kythe, SourceGraph) which provide support for most large languages and have annotation output formats that are broadly similar to this JSON file, and you could still support users having indexers for small languages running as part of CI.

    > There does not exist any widely available standalone C parsing library to provide C programs with access to an AST. There’s LLVM, but I have a deeply held belief that programming language compiler and introspection tooling should be implemented in the language itself. So, I set about to write a C parser from scratch.

    Even if you prefer to write your C indexer in C, you could use LLVM's C [1] or Python [2] APIs. Plus, you can handle C++ without having to implement your own C++ parser from scratch, which is a much larger undertaking than C99 plus a few GNU extensions.

    [1]: https://github.com/llvm-mirror/clang/blob/fb2a26cc2e40e007f1... [2]: https://github.com/llvm-mirror/clang/blob/master/bindings/py...

  • by iso-8859-1 on 7/8/19, 7:11 PM

    How does this compare to using LSIF files?

    https://code.visualstudio.com/blogs/2018/12/04/rich-navigati...

  • by carapace on 7/8/19, 6:34 PM

    Ooo!

    For Python dig up the old PySonar project (the author took it down for some reason but there are mirrors/archives where you can find versions. Oh hey, it looks like it has been resurrected: https://github.com/yinwang0/pysonar2) It might have been superseded by something else in the meantime, I dunno.

    It was the basis for Google's internal Python annotations thingy, and it fscking rocks.

  • by asdkhadsj on 7/8/19, 7:03 PM

    So excited to use this once my requirements are implemented (mostly just LFS, and to a lesser extent Merge(|Pull) Requests). Admittedly I don't need it, I just really appreciate the simplistic UI and straight forward pricing model.
  • by nerdponx on 7/8/19, 8:58 PM

    Wow, this is great!

    Conceivably someone could write an offline annotation viewer/editor as well? I would love for something like that to catch on.

    Imagine Emacs and Pycharm plugins for viewing and editing these annotations, for example.

  • by imagiko on 7/8/19, 7:09 PM

    Wondering if this is an alternative to some other lightweight git hosting services such as gitea/gogs. Good reason to consider switching?
  • by woodrowbarlow on 7/8/19, 7:52 PM

    if i get some time (unlikely, tbh), i'd love to take a crack at integrating your annotatec into sublime text 3 as a plugin.
  • by 0xDEFC0DE on 7/8/19, 6:39 PM

    I'm embarrassed I didn't know <details>/<summary>/<ul>/<li> worked like that without javascript
  • by svnpenn on 7/8/19, 5:56 PM

    are they offering HTTPS yet - i would like to move away from GitHub if possible
  • by crispyporkbites on 7/8/19, 5:01 PM

    Is SourceHut the new GitLab (which was the new GitHub)?

    This random HN commenter says yes!