goblint / analyzer

Static analysis framework for C
https://goblint.in.tum.de
MIT License
172 stars 72 forks source link

High-level documentation #208

Open sim642 opened 3 years ago

sim642 commented 3 years ago

The conclusion is to use Read the Docs but documenting into docs directory of this repository in Markdown.

Ideas for tutorial-style documentation

I've been thinking about this for a while that Goblint has no high-level documentation that describes its overall structure and functioning. Some parts of the source code are commented (and few have OCaml documentation comments) but neither is useful for users and new developers, because you already have to know where to find something or which terms to grep for.

Possible platforms

  1. GitHub Wiki.
    • Pro: Accessible right here on GitHub with this repository.
    • Pro: Uses Markdown (among other possibilities).
    • Con: No good organization and structuring.
    • Con: Separate from git repository (has its own git repository under the hood though, but the GitHub website hardly exposes the git functionality of it).
    • Con: No search.
  2. GitHub repository Markdown files.
    • Pro: In the same repository, e.g. in a docs directory.
    • Pro: Rendered on GitHub website.
    • Con: Maybe not the nicest interface for browsing.
    • Con: Poor GitHub search.
  3. OCaml documentation (odoc).
    • Pro: Together with source code.
    • Con: Uses obscure OCaml documentation markup language. Probably difficult to integrate any figures etc.
    • Con: Meant to just document public API of a library (only works now because goblint-lib is separated as a Dune library, Dune executables simply cannot have documentation).
    • Con: Organization isn't super flexible? Our unqualified module access means it's just a long list of modules.
    • Con: Must be hosted, although GitHub Pages would work.
    • Con: No search (?).
  4. GitBook.
    • Pro: Uses Markdown.
    • Pro: Looks modern and easy to use.
    • Pro: Search.
    • Con: Vendor lock-in.
    • Con: Has its own proprietary (and ironically undocumented?) Markdown flavor. Lots of rich content features that aren't in any common Markdown.
    • Con: Heavily centered around its own editing environment, which includes version control and commenting off-GitHub, but can sync with it.
  5. Readthedocs.
  6. ...?
sim642 commented 3 years ago

I see @michael-schwarz has just started documenting something for the SAS21 artifact (https://github.com/goblint/analyzer/tree/sas21_artifact_description), but we should probably have a broader strategy for this.

ivanazuzic commented 3 years ago

I strongly support the idea of documenting Goblint. :) I definitely want to help with this. We should pick the strategy that looks modern, is creates documentation that is easy to look through (well structured) and at the same time not causing use too much overhead to write and maintain. GitBook seems to me like a good solution.

michael-schwarz commented 3 years ago

I see @michael-schwarz has just started documenting something for the SAS21 artifact

Yes, we need to provide with the artifact a description of how to reproduce our results (for Validated badge) and a description of the structure of the source code and how to extend it (for the Extensible badge).


Generally, the goal to provide comprehensive documentation of Goblint is very laudable, but I fear that goal is very ambitious and we will fall short of it and our documentation will become out-of-sync with the code very soon.

Maybe something more realistic to aim for is the following three things:

sim642 commented 3 years ago

Of course there's no point in writing massive documentation just for the sake of it when it's too much to keep up to date, but the tutorial-like use case is probably the reasonable thing I had in mind anyway. And it would be good to have a well-defined place where to keep the code structure description that we need for the artifact, so we're not practically throwing it away.

It's just that if there's no clear place for such documentation, it's absolutely sure that nobody will document such things. Such "Extending Goblint" section would also be a good place for all kinds of utility things, like a very short overview of how to use Pretty.printf and all the Printable.pretty functions instead of writing print_endline stuff from scratch. There's a learning curve to some of these things, but no clear place to document them in the code if you already don't know about Cil.Pretty and where to find its API documentation, for example.

michael-schwarz commented 3 years ago

One should also document:

sim642 commented 3 years ago

I added these ideas into the issue itself, to have a nice TODO list at the top. If any others come about, feel free to edit the issue to extend the list.

sim642 commented 3 years ago

I decided to set up Read the Docs now because it's actually quite unintrusive: all the documentation is based on the contents of the ./docs directory and can also be browsed on GitHub directly.

I also wrote up a bunch of the ideas collected in this issue.