User Tools

Site Tools


notes:tableshots

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:tableshots [2023/12/19 02:27] – [Infinite plasticity] discordnotes:tableshots [2024/02/17 00:46] (current) osnr
Line 1: Line 1:
 ====== Towards a folk computer ====== ====== Towards a folk computer ======
 +
 +//[[https://cristobal.space|Cristóbal Sciutto]], December, 2023//
  
 Folk Computer is a research & art project, led by Omar Rizwan and Andrés Cuervo, centered around designing  new physical computing interfaces. The aims are, among others: Folk Computer is a research & art project, led by Omar Rizwan and Andrés Cuervo, centered around designing  new physical computing interfaces. The aims are, among others:
Line 28: Line 30:
 and display their outputs. You can see my setup in the [[https://folk.computer/directory#folk-zeca-manhattan-ny-usa|Folk directory]]. Here's a first program: and display their outputs. You can see my setup in the [[https://folk.computer/directory#folk-zeca-manhattan-ny-usa|Folk directory]]. Here's a first program:
  
-{{ notes:hello_world.gif?600 }}+{{ notes:hello_folk_1.gif?600 }}
  
 The program is identified by its AprilTag, a variant of QR-code specialized for The program is identified by its AprilTag, a variant of QR-code specialized for
Line 37: Line 39:
  
 <code tcl> <code tcl>
-Wish $this is labelled "hello world!" +Wish $this is labelled "hello folk!"
-Wish $this is outlined green+
 </code> </code>
- 
  
 Programs are written in the Folk programming language, a domain-specific Programs are written in the Folk programming language, a domain-specific
Line 49: Line 49:
 ==== Fulfilling wishes ==== ==== Fulfilling wishes ====
  
-All clauses get stored in a reactive database. We can react to a ''Wish'' using +All statements get stored in a reactive database. We can react to a statement using 
-a ''When'' which matches the clause and runs code in response. The Folk OS +a ''When''. If the clauses match, then some code gets executed in response. For 
-comes with some default "virtual programs", always running despite not being +examplewe can write second program which affects the first.
-physically activated. One of these determines how to draw lines, another how to +
-draw text. Note that there's very little syntax and clause-matching supports +
-arbitrary in-fixed parameters. This leads to very readable code, even +
-approaching English. The choice of TCL, a string-based programming language, is +
-the central reason such a design is possible.+
  
 +{{ notes:hello_folk_2.gif?600 }}
  
 <code tcl> <code tcl>
-When /someone/ wishes /program/ is labelled /text/ +When /someone/ wishes /p/ is labelled "hello folk!" 
-  # Find the region which corresponds to the program. +    Wish $p is outlined green
-  # Draw the text at the centroid of the region.+
 } }
 </code> </code>
 +
 +Notice how, as soon as I drop the second program on the table, the first gets outlined
 +green. The variable ''p'' is bound to the identifier of the first program, and it gets
 +outlined. The same happens when a put a copy of the first program on the table. Another
 +''p'' is bound, which also gets outlined green.
 +Note that there's very little syntax and clause-matching supports
 +arbitrary in-fixed parameters. This leads to very readable code, even
 +approaching English. The choice of TCL, a string-based programming language, is
 +the central reason such a design is possible.
 +
 +Somewhere else in our system there is a program which [[https://git.folk.computer/folk/tree/virtual-programs/label.folk#n13|draws text]] on the table, and
 +another that [[https://git.folk.computer/folk/tree/virtual-programs/outline.folk#n12|draws colored lines]]. They are implemented just as our second program above, using the ''When'' primitive to execute some code.
  
 <code tcl> <code tcl>
Line 73: Line 80:
 </code> </code>
  
-The OS works something like a spreadsheet. On each frame, it sees all programs +But where are these programs, if not on the table? The system has some default "virtual programs", 
-that are currently running, figures out the dependency tree, and then executes +always running despite not being physically activated 
-the programs in sequence. This style of programming is far from traditional +On each frame of executionthe OS sees all statements that are live in the database, 
-imperative programming. Here we simply define behavior we'd like to see happen, +figures out dependency tree of ''When''s, and then executes the code. This style of 
-closer to a language like Prolog.+programming is far from traditional imperative programming. Here we simply define 
 +behavior we'd like to see happen, closer to a language like Prolog.
  
 ===== Interacting with peripherals ===== ===== Interacting with peripherals =====
Line 89: Line 97:
 webcams, RFID tag readers, or receipt printers.  webcams, RFID tag readers, or receipt printers. 
  
-Another reason Folk is implemented on top of TCL is for its excellent interoperability +Another reason Folk is implemented on top of TCL is for its excellent Unix  
-with C. This is the same reason why Redis and SQLite have adopted it. In +interoperability and ability to embed sublanguages such as inline. This is 
-particular, this lets us read from ''/dev/video0'' easily and use the Vulkan +the same reason why Redis and SQLite have adopted it. In 
-graphics API to draw to the buffer that is then displayed by the projector. For now, let's just stick to images to see what we can build. Since there's a camera pointed down at the +particular, this lets us read from ''/dev/video0'' to get pixels from the camera and use the Vulkan 
-table to detect AprilTags, we can ask the system for its image and display it:+graphics API to draw to buffer that is then displayed by the projector. For now, let's just stick to images to see what we can build. Since there's a camera pointed down at the 
 +table to detect AprilTags, we can ask the system for the image of the whole table and display it:
  
 {{ notes:camera_frame.gif?600 }} {{ notes:camera_frame.gif?600 }}
Line 152: Line 161:
 </code> </code>
  
-The two helper programs began as printed program, but eventually became a stable "virtual-program" that are always running in the background. The face that programs are always running, waiting to be matched, makes it much more natural to bootstrap off of previous code you've written. You slowly build your own personal language that lets you express the things you want to make.+The two helper programs began as printed programs, but eventually will become stable "virtual-programs" that run in the background. The fact that some programs are always running, waiting to be matched, makes it much more natural to bootstrap off of previous code you've written. You slowly build your own personal language that lets you express the things you want to make.
  
 ==== Inline device drivers ==== ==== Inline device drivers ====
Line 203: Line 212:
 <code tcl> <code tcl>
 When $this has region /r/ { When $this has region /r/ {
-    Claim $this' has region [region move $r down 350px]+    Claim $this' has region [region move $r down 110%]
 } }
 When $this' has camera slice /slice/ { When $this' has camera slice /slice/ {
-    Wish $this displays $slice+    Wish $this displays camera slice $slice
 } }
 </code> </code>
Line 290: Line 299:
  
 With inspiration from the tradition of [[https://kellianderson.com/blog/|"paper engineering"]], With inspiration from the tradition of [[https://kellianderson.com/blog/|"paper engineering"]],
-some further interface ideas emerge. A simple, and very clever, way to start is "paper button"+some further interface ideas emerge. A simple, and very clever, way to start is [[https://folk.computer/guides/button|paper button]]
-We physical mechanism to impede detection until a user action is made:+We use physical mechanism to impede detection until a user action is made:
  
 {{ notes:button.gif?600 }} {{ notes:button.gif?600 }}
Line 481: Line 490:
    
 proc regionFromBox {program x1 y1 x2 y2} { proc regionFromBox {program x1 y1 x2 y2} {
-  set vertices [list [list $x2 $y1] [list $x1 $y1] [list $x1 $y2] [list $x2 $y2]] +    set vertices [list [list $x2 $y1] [list $x1 $y1] [list $x1 $y2] [list $x2 $y2]] 
-  set edges [list [list 0 1] [list 1 2] [list 2 3] [list 3 0]] +    set edges [list [list 0 1] [list 1 2] [list 2 3] [list 3 0]] 
-  Claim $program has region [region create $vertices $edges]+    Claim $program has region [region create $vertices $edges]
 } }
 </code> </code>
Line 528: Line 537:
       set w [image width $im]       set w [image width $im]
       set c [list [+ $x [/ $w 2]] [+ $y [/ $h 2]]]       set c [list [+ $x [/ $w 2]] [+ $y [/ $h 2]]]
-      Wish to draw an image with center $c image $im radians 3.1415 scale 1\+      Wish to draw an image with center $c image $im radians 3.1415 scale 1
       set y [+ $y $h]       set y [+ $y $h]
     }     }
Line 543: Line 552:
 physical programs and paper interfaces, instead of mouse and screen. This folk physical programs and paper interfaces, instead of mouse and screen. This folk
 interface is just one of many supported by the Folk operating system, a means interface is just one of many supported by the Folk operating system, a means
-to coordinate peripherals (camera and projector) in a reactive manner.+to coordinate peripherals (including, but not limited to, camera and projector) 
 +in a reactive manner.
  
 {{ notes:paper.gif?600 }} {{ notes:paper.gif?600 }}
Line 555: Line 565:
 objects into the material world. objects into the material world.
  
-While Folk retains the playful aesthetic of paper collages from a child's art+While Folk currently retains playful aesthetic of paper collages from a child's art
 class, it should not be confused with mere post-modern pastiche. The primary class, it should not be confused with mere post-modern pastiche. The primary
 function of the system is //not// the sign. It avoids the temptation of function of the system is //not// the sign. It avoids the temptation of
Line 566: Line 576:
 plasticity of computation lightens the finitude of the material world. plasticity of computation lightens the finitude of the material world.
  
-//Cristóbal Sciutto, December, 2023// ====== 
  
notes/tableshots.1702952867.txt.gz · Last modified: by discord

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki