Live data from Hacker News

Who needs Graphviz when you can build it yourself?

spidermonkey.dev

111–114 of 114 posts

Re: Who needs Graphviz when you can build it yourself?

#111
post #67

Earlier quoted context omitted.

"clang -Xclang -ast-dump=json" will take you partway there.

The issue is to make sense of the incredibly detailed AST to answer various questions about the code base. For example, how to make an information flow graph that shows what functions read and write what variables in a set of C++ classes.

This sounds like it might be a good use case for one of the LLM coding tools.

A pure AST wouldn't even have that information - it'd have the syntax, but not the semantics.

Re: Who needs Graphviz when you can build it yourself?

#112

Earlier quoted context omitted.

The issue is to make sense of the incredibly detailed AST to answer various questions about the code base. For example, how to make an information flow graph that shows what functions read and write what variables in a set of C++ classes.

This sounds like it might be a good use case for one of the LLM coding tools. A pure AST wouldn't even have that information - it'd have the syntax, but not the semantics.

I had tried this with the previous versions of sonnet and gemini pro. Sonnet's context, back then, could not hold the full source I was working on. Reducing the context did allow it produce a graph. Both LLMs produced graphs with enough omissions and errors to make the result not useful. In the end, I wrote an interpreter based on libclang to provide the semantics I needed for my particular case. That was not trivial for me (I have decades of experience with s/w dev, working with graphs, etc - but not compiler development). And I used LLM's help to do the development. The new type of semantics would require hard-coding new AST interpreter and graph construction. Repeating that all today with the better LLMs and after more practice driving them might produce something with less effort / more flexibility.

In any case, this experience gave me a new appreciation for compiler developers!

Re: Who needs Graphviz when you can build it yourself?

#113
post #110
post #58

Earlier quoted context omitted.

I wrote my thesis on this! Application-specific system design can get you orders of magnitude performance improvement, as well as better scalability/fault tolerance properties. I focused on graph analytics, but it's reasonable to think it applies more broadly. Definitely true that application-specific design is often not worth the investment though. Chasing that 1000x improvement can easily cost you a year or two.

Can you please link to your thesis? This sounds very interesting.

Here it is:

https://scholar.google.com/citations?view_op=view_citation&h...

Re: Who needs Graphviz when you can build it yourself?

#114
post #71
post #3

This is a concept I'm working around with Microdiagram (microdiagram.com) prototype. i.e. having a general purpose diagram/graph layout is hellishly difficult, but most of the diagrams/charts follow much simpler rules, thus it's much easier to have N languages, each for 1 type of diagram, than 1 language for N types of diagrams.

While I fully support your efforts to make better tooling, UML is the poster child for this. I highly encourage people working in this space to revisit those lessons. Obviously if you find a new way to work around the limitations please run with it. But limited scope, and targeted simplifications is the only way I have found, over application by trying to describe everything almost always ends up being more harmful i…

Sorry for the late response but I just noticed your comment. I know UML and studied it for decades along with other diagramming solutions and this is something exactly opposite I aim for.

UML was made as a specification-through-visuals tool and I'm aiming at diagrams-as-communication tool. I.e. sure you can save them, but the use case I aim is that you hop on the video call, share screen and discuss specific concept with one of the diagram types.

Collaboration is a huge part of it, but since I've never seen my concept in realization I'm going to keep it hush-hush for a while :)

Post reply on HN