Difference between revisions of "Annotated lambda diagram"

From apm
Jump to: navigation, search
(Mockup Demos: factored out the whole section to new page Annotated lambda diagram mockups)
(factored out grapro notes section to Annotated lambda diagram mockups)
Line 74: Line 74:
  
 
'''See main page: [[Annotated lambda diagram mockups]]'''
 
'''See main page: [[Annotated lambda diagram mockups]]'''
 
= Notes on conventional/classical "graphical programming" code projections =
 
 
Conventional graphical programming typically follows the scheme of '''data-wires and function-boxes'''. <br>
 
Thee are approaches that reverse that '''function-wires and data-boxes''' but that seems just bad in a different way.
 
 
Note: Assuming a function B (represented as a box) has an input that accept a function as an input (that is the function is a so called "higher order function") <br>
 
then the wire transmitting some other input function to that input is still a "data wire"! <br>
 
In contrast a function wire is a wire that represent a data-transformation itself. <br>
 
<small>(Most graphical programming tools do not even allow for using data wires as channels for transmission of functions.)</small>
 
 
----
 
 
Annotated lambda diagrams (only a "semi graphical" code projection) <br>
 
have inherently integrated the capability of overloading the meaning of the graphical lines that connect to other lines. <br>
 
E.g. monoids, applicative functors, monads, ... <br>
 
What may seem like boxes are just annotations of the lines. <br>
 
That is removing the boxes the code still works. <br>
 
That is not the case for classical graphical programming. <br>
 
 
This can be done in classical box and wire representation too.  <br>
 
But it is not inherent. That is not something what one would implement in an naive approach.  <br>
 
And thus it is has rarely (never?) been done.  <br>
 
One concrete case of a programming language attempting that is the (multi representational) language called enso (formerly luna).
 
 
What is truly unique to ALDs -- the semi graphical code projection of ALDs is that  <br>
 
Abstractions and applications remain separate in the graphical representations. <br>
 
{{todo|think about why this might be the killer advantage over box and wire representation}}
 
  
 
= Related =
 
= Related =
  
 +
* [[Annotated lambda diagram mockups]]
 
* [[Software]]
 
* [[Software]]
  

Revision as of 18:15, 12 July 2021

Conversion of Cartesian coordinates to polar coordinates in the representation of annotated lambda diagrams.
For details see: ALDs – example Cartesian to polar.
Quicksort algorithm as a single function in the representation of annotated lambda diagrams.
For details see: ALDs – example quicksort.

Annotated lambda diagrams (ALDs) are a "code projection" that aims at being highly enjoyably usable for telling computers what to do (aka coding/programming/automating/...)

Annotated lambda diagrams where inspired by plain unannotated lambda diagrams (PLDs)
These are presented by John Tromp on his homepage here: https://tromp.github.io/cl/diagrams.html These plain lambda diagrams are are in turn based on lambda calculus. A formalism with only three types of terms that can represent any kind of computation in a very minimalistic way.

The annotated lambda diagrams presented here add annotations and some minimal some "syngraphic sugar" to plain lambda diagrams.
The idea is to make lambda diagrams it into a really enjoyable programming interface that minimizes discontinuous visual jumps and minimizes the necessity of expending mental resources on navigating codebases. A "bicycle for the mind".

For an introduction maybe first read:

Unfortunately as of yet (2021-07) this is all still "vaporware" and only static non-interactive mockups.
The author may never come around to actually implement this programming interface as envisioned.
This is a mammoth project, and this wiki already eats up a big chunk of time.
But at least with these mockups I hope to get the idea out there.

We really really need software that is not broken in a future world where matter essentially becomes software.

The basic idea in brief bullet points

  • annotate plain lambda diagrams with: variable names, types, current values, kinds (aka types of types), ... (not all shown per default of course)
  • Make them into a structured editor where you can type normally pretty much as you would in "plain textfile code editing"
    – (See: Fructure Specifically in this video with Andrew Blinn shortly after 6:03 [1] where he says "My preferred alternative is to simply type normally")
  • Add progressive exposure without compromises!!! This is not negotaible.
  • Make program fragments drag and drop interactive (like puzzle pieces)
    Give reasonable visual cues for efficiency (rather than fancy): identicons, arity mismatch visualization, ...
  • Give ALDs typed holes of input holes, output holes, and bridge holes. Don't forget the bridge holes!
    Such that program fragments are extendable: upstream, downstream, and ...
    can also be tied up in one or more still open concurrent paths (wiki-TODO: make a sketch)
  • (Eventually make data flow around holes as far as this is possible. See: Hazel)
  • Add type directed context sensitive suggestions for extending onto the present holes
  • Give ALDs a zooming user interface (ZUI) capability – that allows for (arbitrarily deep) in place evaluation preview
  • Add inverse tabs – allowing to navigate the codebase-graph upwards along different upstream paths that where formerly traced downstream along some dependency tree
    (Some dependency tree is only a subset of the codebase graph. This needs more awareness.)
  • Use an ultra finegrainedly content addressed programming language as a base!!!
    That in order to mop up with fragility of references, dependency hell and fix quite a number of other things too.
    (ony such language in construction as of 2021 seems to be the unison language)

Eventually add higher level data visualization:

  • that follow code structure (see: Tangible values – by Conal Elliott) – but with added progressive exposure.
  • that give an immediate connection by bidirectional data-flow (see: Drawing Dynamic Visualizations – by Bret Victor) (See: enso language)

Totally trearing down the GUI vs commandline rift!

The idea is as follows:
If all progressive exposure is closed then the UI is completely indistinguishable from a conventuinal GUI.
Except one little "+" or something as the starting point for progressive exposure.
A progressive exposure step opens up the ALD that corresponds to the visual element.
From there the "end-user" (now elevated to "deveuser") can trace the codebase to non-displayed or even non-visual code elements.
Trace via the the nicely visually traceable lines in the ALD.

Exposing enough GUI elements and hiding the visualization one eventually ends up with Just ALDs or
some other code projection like conventional purely textual ones.

Add to that: Bookmarking of "interface visualizations" and
organizing "code" documentation and data storage in a desktop wiki like system that
is implemented in that whole programming system in a bootstrapped way.

The basic benefits

Combines the best of the two worlds of textual and graphical code:

  • Almost as traceable as graphical code (since there are traceable "program circuit" lines)
    – these lines are quite different to "conventional" graphical programming though
  • Almost as scaleable as textual code (since the structure closely follows textual code) – a little less dense

Does NOT combine the worst of the two worlds:

  • unscalability of graphical wire-monster-krakens and
  • hard tracability of excessively indirected textual codebases)

  • Seeing the whole code multiverse at a glance and and the live running state as a literal "red thread" within.
  • Browsing the codebase in all dimensions without detours and disruptive jumps
    Human mental RAM is limited, it shouldn't be used for pointless navigation hurdles.

Mockup Demos

Note: If actually implemented all this should be dynamic and interactive

See main page: Annotated lambda diagram mockups

Related

External links

A basic write-up of some ideas with links to twitter posts.
(wiki-TODO: this needs to be published more properly (that is: more resilliently))


Zooming user interface:
For many user interfaces this idea seems rather impractical.
It is likely extremely useful for the case of ALD's though.

Table of contents