TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Understanding Programs Using Graphs

193 pointsby cautionalmost 5 years ago

12 comments

simonwalmost 5 years ago
One of the many neat uses of Observable is quickly prototyping these kinds of graphics - often by starting with a notebook someone has already created and iterating on it.<p>I have a notebook here which can visualize the table structure of any Datasette-hosted database: <a href="https:&#x2F;&#x2F;observablehq.com&#x2F;@simonw&#x2F;datasette-table-diagram" rel="nofollow">https:&#x2F;&#x2F;observablehq.com&#x2F;@simonw&#x2F;datasette-table-diagram</a><p>My first version used a force-directed graph for this, but then Thomas Ballinger from the Observable team showed me how to use a DOT diagram, which is a much better visualization for relational tables.
kipplyalmost 5 years ago
Seas of nodes are also used as IR in Java Hotspot and the V8 engine (<a href="https:&#x2F;&#x2F;doar-e.github.io&#x2F;blog&#x2F;2019&#x2F;01&#x2F;28&#x2F;introduction-to-turbofan&#x2F;" rel="nofollow">https:&#x2F;&#x2F;doar-e.github.io&#x2F;blog&#x2F;2019&#x2F;01&#x2F;28&#x2F;introduction-to-tur...</a>)
ncfaustialmost 5 years ago
I started learning Blueprints in Unreal Engine recently, I swear it has helped my problem solving ability in other general areas of programming. Watching the links light up as nodes are executed is pretty great for debugging.
评论 #23396400 未加载
zomglingsalmost 5 years ago
This was a nice article, and I thank you for providing those references at the end.<p>The article makes it seem as if TruffleRuby is a Shopify project, where this GitHub repo seems to differ on that point: <a href="https:&#x2F;&#x2F;github.com&#x2F;oracle&#x2F;truffleruby" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oracle&#x2F;truffleruby</a>. What&#x27;s the deal?<p>I&#x27;m also very curious about how much TruffleRuby helps you save in infrastructure costs. It looks like Shopify is starting to put together serious systems around optimization of Ruby code.
评论 #23394052 未加载
retoxalmost 5 years ago
Aren&#x27;t we coming full circle back round to UML? UML is very good at designing and documenting complex code and it&#x27;s interactions at many different levels, and having a common graphing notation helps ensure everyone is on the same page by looking at the same diagram.<p>The problem comes when the design and the code get out of step, but there are tools available to round-trip the code and model to keep everything in sync. Executable UML used to be a thing too, but I was never very convinced by it.
评论 #23400625 未加载
bllguoalmost 5 years ago
not _directly_ related, but one interesting thing my coworker has been working on is visualizing ML models using graphs, which has made them much more interpretable for business stakeholders. Being able to break the model down into steps, feed the graph individual observations to see how the model flow would work, etc. I was surprised how receptive non-technical people were to the concept
Wobertoalmost 5 years ago
I enjoyed the article, but am maybe too dense to understand the repercussions. My understanding of the summary is that a goal is to be able to develop these graphs and then convert them back to ruby so that developers who know ruby can see how the compiler is optimizing. My honest question is, why does this matter? If the developers then start writing code more in line with what a compiler would do, then it seems compilation would be faster - is it significant, and is this a reason why? What else could it be? Thanks for the article and any thoughts!
评论 #23398378 未加载
flexvisionalmost 5 years ago
What is a simple tool to produce ASTs from code? Can it work cross-language?
评论 #23398904 未加载
srikzalmost 5 years ago
The big value of the visual representation is if it is dynamic. That is, it gets updated while you are running the code and can use it during debugging. Otherwise, the novelty wears off quickly.<p>Static graphs are still useful to understand a new piece of code, see Source Trail[1] [1]: <a href="https:&#x2F;&#x2F;www.sourcetrail.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.sourcetrail.com&#x2F;</a>
Sevarisalmost 5 years ago
Interesting topic. I feel like the representation of the Ruby fib misses the mark though because of how many language implementation details are caught up in it. The lack of abstraction here takes away from the usefulness of using a graph for understanding control&#x2F;data flow in a program.
评论 #23403224 未加载
navanalmost 5 years ago
Interesting article and good question about whether we should program using graphs. In a different domain, languages like halide, tvm and tiramisu or in a way letting programmers create graphs for high performance.
评论 #23394721 未加载
thelazydogsbackalmost 5 years ago
The graphic is too fuzzy -- but I&#x27;m trying to figure out why the AST for fib in Ruby would be so complex...
评论 #23395716 未加载