What does HackerNews think of Sourcetrail?

Sourcetrail - free and open-source interactive source explorer

Language: C++

#13 in C
#4 in C++
#8 in Java
#38 in Python
I think it might make large scale code visualization in a similar way to how SourceTrail does it more feasible: https://github.com/CoatiSoftware/Sourcetrail
Sourcetrail actually tried to do that for a select few languages https://github.com/CoatiSoftware/Sourcetrail

Sadly, they retired the entire project a while back.

see: https://github.com/CoatiSoftware/Sourcetrail , even tho the project is marked archived, it's pretty solid, i personally still use a 2019 release.

i also have a self hosted instance of this : https://elixir.bootlin.com/linux/latest/source

what you asked, comes across with code auditing as well, i wasn't surprised to know security researchers use sourcetrail as well.

hope your favourite language is supported.

> So, is it a good idea to try documenting the code design through some sort of visualization?

Yes, if it helps you understand how it works and how the pieces fit together.

No, if the previous is not all that useful for you (different types of learners), or you need to spend significant amounts of time doing it manually, especially given that code could change.

If you can, look into any tool that might allow you to get visualizations in an automated manner.

For example, JetBrains IDEs have a few different graph visualizations for dependencies and inheritance etc.: https://www.jetbrains.com/help/idea/2022.1/tests-in-ide.html...

There also used to be SourceTrail, though sadly the project is now retired: https://github.com/CoatiSoftware/Sourcetrail

For databases, you can also use external tools like DbVis: https://www.dbvis.com/features/

There are also a few tools here and there for visualizing networks or how container deployments look, but those are pretty situational/specific for each platform/setup.

Sourcetrail (Google) had been my primary go-to for large multi-MLOC C-code and C++ project like Mozilla Firefox recently for me. I can now insert instrumentation testpoints deep inside Firefox JavaScript JIT engine within two days from zero-knowledge, quicker there on.

- Sourcetrail (GUI/Linux/Windows, closed-net-capable, archived) - https://github.com/CoatiSoftware/Sourcetrail

- SourceInsight (repo/web-server/closed-net) https://www.sourceinsight.com/

- OpenGrok (web server plug-in/Java/closed-net) https://oracle.github.io/opengrok/

- CLion (GUI-based IDE) - By IntelliJ/JetBrains - https://www.jetbrains.com/clion/

- SourceGraph (Web-based) https://about.sourcegraph.com (thanks, gravypod)

- Codesee.io (GitHub/web-based) - https://www.codesee.io/privacy-and-security

For free as in beer, I prefer OpenGrok so I can get more than JetBrains

The now retired SourceTrail is still a pretty good tool, it supports C++, Java and Python https://github.com/CoatiSoftware/Sourcetrail
https://github.com/CoatiSoftware/Sourcetrail

Helped me improve my understanding of last codebase and their design

Link won't load for me but seems like it's talking about https://github.com/CoatiSoftware/Sourcetrail.
I'm with you on this one. I'd actually suggest https://github.com/CoatiSoftware/Sourcetrail could be extended to do this, though I haven't found the time yet for my own codebases. For example https://github.com/CoatiSoftware/SourcetrailPythonIndexer and under the hood the file format is SQLite: https://github.com/CoatiSoftware/SourcetrailDB
Sourcetrail is one such app. It recently went open source. I’ve been trying on spare time to contribute to it, it currently supports C++, Java and Python.

I’m looking at ways to improve the analysis to get more detail from apps, but it’s tricky. As far as I know, nobody’s made an ontology of computer science or source code patterns yet.

Creating the graph is easy compared to how much you might want to do to interpret it. Then we’ve data flow graphs to consider, and UI component graphs, dependency graphs, supported platform annotations, and ideally, telemetry from code execution in tests and production, and each can supplement or annotate control flow graphs and source code.

It’s a problem we’ll solve as a community but it’ll take a number of years before it’s general purpose enough that step one is load a program and step two is read and modify it... with everything you need neatly linked and annotated...

https://www.sourcetrail.com/

https://github.com/CoatiSoftware/Sourcetrail

https://www.patreon.com/sourcetrail/posts

For more on my thoughts of “understanding code automatically,” see https://github.com/CoatiSoftware/Sourcetrail/issues/750#issu... as an example.

My preference would be just as books, programmers and IDEs build mental models from source code, that eventually we could generically go from a collection of source files to identifying languages, build commands, and app starting points to multiple layers of graphs: control flow, data flow, cross-project references, and eventually — help programmers like an IDE would, but smarter, more like documentation written by a human with annotated examples from test cases and live code, etc.

The site seems to be having intermittent connection issues due to the HN hug-of-death. In the meantime here's their Github repo:

https://github.com/CoatiSoftware/Sourcetrail