ADVENT #1 — paper tape

A graphic with the names of the media featured in this series
Day 1: paper tape

Happy Advent!

For the month of December, I'm going to write about ADVENT – the Alice Datatape Virtual Environment. For Thanksgiving, I mentioned a computing environment inspired by Alice's Restaurant. It was only half jest. I'm going to use it to build my holiday card this year.

The card is a circular Advent calendar just over five inches in diameter, set in a jacket with the dimensions of a 5.25" floppy disk. I make the pieces from cardstock, cut on a paper cutting machine. I need to turn the geometry of the floppy into an SVG to drive the machine. I do that with a slim logo-like dialect
of Scheme that I wrote for my implementation of the Alice's Restaurant Virtual Machine (ARVM).

Here's how it winds up – the machine cuts the black and scores the red:

And here's how it starts:


  ((lambda (arc_r) ((lambda (oval)
  ((lambda (
      side backside
      jacket_spindle_r
      overwrap
      index_offset index_r
      access_length access_width access_offset
      notch_offset notch_depth notch_height
  ) (sync
    (setpc "black")
    (pd)
    (fd backside)
    (rt 90)
    (fd backside)
    (lt 90)
    (fd (add overwrap (div (sub side backside) 2)))
    (rt 90)
    ((lambda (hyp)
      (sync
        (fd (sub side overwrap))
        (rt 45)
        (fd (mul hyp 2))
        (rt 45)
        (fd (sub side (mul overwrap 2)))
        (rt 45)
        (fd (mul hyp 2))
        (rt 45)
        (fd (sub side overwrap))
      )
    ) (sqrt (mul 2 (mul overwrap overwrap))))
    (rt 90)            
    (fd (add overwrap (div (sub side backside) 2)))
    (lt 90)

    (fd notch_offset)
    (rt 90)
    (fd (sub notch_depth (div (sub side backside) 2)))
    (lt 90)
    (fd notch_height)
    (lt 90)
    (fd (sub notch_depth (div (sub side backside) 2)))
    (rt 90)
    (fd (sub backside (add notch_offset notch_height)))

    (rt 90)

    (pu)
    (fd (div backside 2))
    (rt 90)
    (fd (sub backside (div side 2)))
    (lt 90)
    (pd)
    (circle jacket_spindle_r)
    (rt 90)
    (fd (div side 2))

    (fd (div side 2))
    (lt 90)
    (pd)
    (circle jacket_spindle_r)
    (rt 90)
    (pu)
    (fd (div side 2))

    (home)

    (pu)
    (fd (div backside 2))
    (rt 90)
    (fd (sub backside (div side 2)))
    (lt 90)
    (fd index_offset)
    (pd)
    (circle index_r)
    (pu)
    (rt 90)
    (fd (div side 2))

    (fd (div side 2))
    (lt 90)
    (pd)
    (circle index_r)
    (pu)

    (home)

    ((lambda (access_from_center) (sync
      (setpc "black")
      (fd (div backside 2))
      (rt 90)
      (fd (sub backside (div side 2)))
      (access_from_center)
      (pu)
      (fd (sub (div side 2) access_offset))
      (fd (div side 2))
      (rt 180)
      (pd)
      (access_from_center)
    )) (lambda () (sync
      (pu)
      (fd access_offset)
      (pd)
      (oval access_length access_width)
    )))

    (pu)
    (home)

    (rt 90)
    (fd backside)
    (rt 90)
    (fd (div (sub side backside) 2)) 
    (lt 90)
    (fd notch_offset)
    (lt 90)
    (pd)
    (fd notch_depth)
    (rt 90)
    (fd notch_height)
    (rt 90)
    (fd (mul notch_depth 2))
    (rt 90)
    (fd notch_height)
    (rt 90)
    (fd notch_depth)
    (rt 90)

    (pu)
    (home)

    (setpc "red")
    (rt 90)
    (fd backside)
    (lt 90)
    (pd)
    (fd backside)
    (fd (div (sub side backside) 2)) 
    (rt 90)
    (fd side)
    (rt 90)
    (fd (add backside (sub side backside)))
    (rt 90)
    (fd side)
    (rt 90)
    (fd (div (sub side backside) 2))
  )) 133 (sub 133 5) 15 10 30 3 35 15 20 100 6 6)
  ) (lambda (major_axis minor_axis) (sync
    (lt 90)
    (arc_r (div minor_axis 2) 90)
    (fd (sub major_axis minor_axis))
    (arc_r (div minor_axis 2) 180)
    (fd (sub major_axis minor_axis))
    (arc_r (div minor_axis 2) 90)
    (rt 90)
  )))) (lambda (r deg)
    (do deg (sync
      (fd (div (mul 2 (mul pi r)) 360))
      (rt 1)
    ))
  ))

The logo part in this example are the commands:
fd – forward
rt -- right turn
lt -- left turn
pu -- pen up
pd -- pen down
setpc -- set pen color
home -- return home.
circle – draw a circle with a radius from the current point

… that control the motion of a turtle in the same way that children have driven robot turtles around for decades. We define a couple of functions in terms of these:


arc_r – make a right-turning arc of radius and degrees from the current point
oval – make an oval of major axis and minor axis from the current point

The only thing unfamiliar to a Scheme programmer would be the (sync ... ) syntax. sync forces the subordinate expressions to execute sequentially. Alice Scheme parallelizes by default, so there's no particular reason:

(fd 10) (rt 120) (fd 10) (rt 120) (fd 10)

would produce a triangle unless you force an ordering, as:

(sync (fd 10) (rt 120) (fd 10) (rt 120) (fd 10))'.

As for the disk media itself? The disk has 25 sectors, each printed with a commercial removable data storage technology. Our day 1 entry is paper tape.

According to Wikipedia’s article on paper data storage, ”… the earliest use of paper to store instructions for a machine was the work of Basile Bouchon who, in 1725, used punched paper rolls to control textile looms. …”. I like that paper tape is a mixed medium — punched holes for the computer often accompanied by user annotation in pencil.

Subscribe to Paper Tiger

Sign up now to get access to the library of members-only issues.
Jamie Larson
Subscribe