Hacker News new | past | comments | ask | show | jobs | submit login

I've been thinking about a similar tool in go that would use the call graph

it would show how many new/changed calls were made and also include basic info about new declarations

it would give a quick overview of changes and hidden side effects prior to commits thanks to go static analysis




This is a really nice idea. Have been thinking of something similar.

Building a call graph using a static analyzer is quite difficult for languages like Python where it can be difficult to resolve imports. Python programmers can even make imports inside if statements or override imports inside a function body.

Would this be a lot easier in go? The case that scares me a bit in Go is implicit imports (e.g. importing a driver for use with `database/sql`). But maybe all that is very clear when doing static analysis?

In go, do you think it would be a good approach to instrument the compiler to emit a call graph instead of using an AST traversal.

By the way, I'm planning to extend the Locust output spec to include more than just definitions (e.g. TODOs, call dependencies, imports, etc.). Also tried to make it easy to use custom metadata extractors as part of the Locust pipeline. (Took a couple of hours to add the Javascript extractor.)

Would love to collaborate with you on Go extraction, if you're interested?


Continued discussion here https://github.com/bugout-dev/locust/issues/39

Cheers




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: