Visual programming should start in the debugger
Visual programming leverages visual-spatial reasoning, proposing enhanced debuggers to visualize data structures over time. Efforts prioritize debugger improvements over text editors to create a new visual programming approach.
Read original articleVisual programming is a concept that aims to leverage visual-spatial reasoning in programming tools. The idea suggests starting with the debugger to visually express states of common data structures over time. The current focus on coding in visual programming tools is seen as limited for working programmers once syntax and APIs are mastered. The proposal is to enhance debuggers with visual representations of data structures and their changes over time. By visualizing states over time, programmers can better understand and express changes in their code. The article suggests that efforts in visualization should prioritize replacing or augmenting debuggers before text editors. The goal is to create a visual language for illustrating state changes that could eventually lead to a new approach to visual programming, different from traditional textual programming paradigms. The article also mentions the importance of making program states easily accessible for visualization in new compilers and the potential for visual programming to take cues from logic programming for more efficient coding.
Related
Programmers Should Never Trust Anyone, Not Even Themselves
Programmers are warned to stay cautious and skeptical in software development. Abstractions simplify but can fail, requiring verification and testing to mitigate risks and improve coding reliability and skills.
Exploring biphasic programming: a new approach in language design
Biphasic programming introduces new language design trends like Zig's "comptime" for compile-time execution, React Server Components for flexible rendering, and Winglang's phase-specific code for cloud applications.
Introduction to Program Synthesis
Program synthesis automates software creation by generating programs from requirements. It leverages Large Language Models (LLMs) like co-pilot and AlphaCode, alongside search-based techniques, for tasks like data manipulation and legacy application modernization.
Inline previous result in Emacs Lisp
Using Edebug in Emacs enhances debugging, fostering independence in customizing functionalities. The author shares experiences modifying Edebug to display results inline, improving debugging efficiency by reducing code-minibuffer switching.
We need visual programming. No, not like that
Visual programming environments struggle due to mismatched focus on syntax. Developers prefer visualizing state transitions and code aspects. Tools like Sourcetrail aid in understanding code complexity, suggesting more visualizations for improved software comprehension and optimization.
- There is significant research on program visualization, but major roadblocks like language variety and system characteristics hinder widespread adoption in popular IDEs.
- Modern IDEs lack automatic and integrated tools for visualizing program execution, making debugging cumbersome and reliant on manual breakpoints and print statements.
- Incentives and cost issues prevent extensive development of advanced debugging tools, with many tools remaining niche or short-lived.
- Visual programming should focus on visualizing data structures and program behavior over time, which is crucial for building a mental model of the program state.
- There are existing tools and efforts, such as Call Stacking and Whitebox, that aim to improve visual debugging, but they often face limitations and integration challenges.
I'm quite a bit into developing more tooling around that, and it's really hard - developers particularly want tools that completely integrate with existing IDE's. Debugger infrastructure is usually not built to be very exstensible or accessible. For my extension for Visual Studio https://d-0.dev/ I had to put serious effort into making sure it all still works correctly with VS breakpoints which is extremely difficult when the debugger expects all of the code to be in the same place all the time.
1. Incentives.
I’ve made my contributions to debuggers (Firebug mostly), and devs are not willing to pay for it (we had donations, but I’ve seen people create projects in the space) and so tool makers (browser makers in this case) eat the cost and see it as a cost center. Because of this, the debuggers are at the abstraction layer of the tool itself. The tools change and the cost of keeping the debugger in sync (usually well after the feature is out there) is already high enough.
I put hooks into Firebug to make it better for higher level debugging of frameworks. Later I made a paid extension [*]. It paid for a new computer, and spawned many framework specific extensions over time. I pushed Chrome's DevTools team to add some of the same hooks. Sadly, a decade later, many of those framework level extensions don't use what is available. Again, it is a cost center for the framework development, so just enough gets done, no more.
2. Tools are Siloed.
You may have OpenTelementry, etc., but that data is siloed off somewhere. The IDE doesn't have it. But the IDE has extensions, so maybe someone like Microsoft can bridge the gap and put up a sidebar that is a heatmap of the time that that code takes on the CPU.
3. Levels of Abstraction.
When you talk about state and data modeling, not only is it siloed, but the levels of abstraction are plentiful. It is somewhat possible, but I refer you back to 1--Incentives.
Maybe it's time to flip the game on its head. Bring reactive, lispmachines, responsive UIs.. I don't know.
Modern IDEs have lots of visual features, specially tailored to support production languages. Inspection panels, tooltips with variable values and function definitions...
Surely we could add more spatial visualization tools to them. But the step up from printf to a debugging inspector panel was on its own a great advance in building a mental model of the program state and making sense of its behaviour, which is what visual programming is all about.
For programmers interested in advanced visual tools tailored to software creation, see Bret Victor's essays on notations:
But, for some reason, none of these tools catch the attention of the most popular IDEs. I hypothesize that there are major roadblocks to implementing this in a generic and useful way.
The first one is the variety of languages, frameworks, and build tools. For example, analyzing a TypeScript+React code base is not the same as analyzing a TypeScript+Vue code base, even when both use TypeScript and the TSC API is very easy to use.
The second roadblock is that useful visualizations also depend on the characteristics of your system, and creating them is not easy.
Maybe things will change with the addition of AI to analyze code bases, but so far, all the tools I’ve seen are either very niche or very short-lived.
A major bottleneck for people learning programming is developing a mental model of what is in the memory during the runtime and what it looks like. The most successful introductions to programming start by making drawings or small games since it's more intuitive for beginners to iterate and have immediate feedback.
It captures everything for a given request - each method call, params/argument/return values, class name/method/line of execution.
You can visibly see which method called which, as each method call is nested relative to its parent callee, in a single consolidated timeline.
"We need visual programming. No, not like that." https://news.ycombinator.com/item?id=40937119
It only really works with C-with-Classes style C++. But, the fact that it works at all is pretty neat.
And good debugging support doesn't need to be some fancy "Minority Report" style 4D animated UI. Just give us good type rendering support, an easy ability to chain breakpoints and set conditional breakpoints, "watch variable" support. Some other things: "where did this value came from?", "watch for value use".
Go is an especially bad example. Its debugger doesn't even allow custom type rendering, so if you have something like a custom generic map container, you can't inspect it at the debug time.
But in the past 6 months I’ve started to use graphviz and other tools to quickly document code paths for others
Its mostly just a demo but I think something like this a standard tool would be really helpful. https://github.com/ando818/Svelte-Logger
Related
Programmers Should Never Trust Anyone, Not Even Themselves
Programmers are warned to stay cautious and skeptical in software development. Abstractions simplify but can fail, requiring verification and testing to mitigate risks and improve coding reliability and skills.
Exploring biphasic programming: a new approach in language design
Biphasic programming introduces new language design trends like Zig's "comptime" for compile-time execution, React Server Components for flexible rendering, and Winglang's phase-specific code for cloud applications.
Introduction to Program Synthesis
Program synthesis automates software creation by generating programs from requirements. It leverages Large Language Models (LLMs) like co-pilot and AlphaCode, alongside search-based techniques, for tasks like data manipulation and legacy application modernization.
Inline previous result in Emacs Lisp
Using Edebug in Emacs enhances debugging, fostering independence in customizing functionalities. The author shares experiences modifying Edebug to display results inline, improving debugging efficiency by reducing code-minibuffer switching.
We need visual programming. No, not like that
Visual programming environments struggle due to mismatched focus on syntax. Developers prefer visualizing state transitions and code aspects. Tools like Sourcetrail aid in understanding code complexity, suggesting more visualizations for improved software comprehension and optimization.