Blog 2019/2/24
<- previous | index | next ->
It is 2019 and the dominant programming workflow is still hand-editing text files! Let's start working towards a better future.
- Start small: a JSON or EDN visualizer
- Then add basic editing operations to it
- At no time is the programmer directly editing the raw text representation of the structure -- all edits are operations on the AST.
Let's look at an EDN fragment (a snippet of Clojure code):
Text is merely one possible way to represent this structure. Many alternate representations are possible, for example:
- symbols in white boxes
- lists as blue boxes
- vectors as green boxes
(made in google docs draw.io):
Let's try to write a program which can make something similar.
Attached is a rough pyqt5 script which renders a list of words in colored boxes:
That's my progress so far.
- Render a group of words in a containing box (representing a list or vector)
- Interactivity (a "selected" box based on keyboard input)
- Editing individual nodes
Initially I wanted to do this with using an OpenGL back-end, to get hardware acceleration, and things like zooming / panning for free. I started working with Dear ImGUI, but soon found that uses a lot of power (poor battery life for laptops). So I stepped away from "immediate mode" GUI and tried a "retained mode" GUI, via pyqt.