Difference between revisions of "Plankalkül"

From WTFwiki
Jump to navigation Jump to search
(→‎Arrays: Make explaination less ambigious)
m (Restructure)
Line 1: Line 1:
== Project Plankalkül ==
+
== Spec ==
  
=== Spec ===
+
=== Variables ===
 
 
==== Variables ====
 
 
{| border="1"
 
{| border="1"
 
|V || parameters (r/o)
 
|V || parameters (r/o)
Line 12: Line 10:
 
|}
 
|}
  
==== 2D syntax 'sidebar' ====
+
=== 2D syntax 'sidebar' ===
  
 
In the 2D notation there is a vertical column on the right where the value of elements in that row is indicated:
 
In the 2D notation there is a vertical column on the right where the value of elements in that row is indicated:
Line 34: Line 32:
 
in the linear notation.
 
in the linear notation.
  
==== Primitives ====
+
=== Primitives ===
  
 
The only primitive type is boolean (or a bit). They are denoted by S0.
 
The only primitive type is boolean (or a bit). They are denoted by S0.
  
==== Arrays ====
+
=== Arrays ===
  
 
Arrays can be made up of any other data type. For example:
 
Arrays can be made up of any other data type. For example:
Line 58: Line 56:
 
means the 1st component of V0 (linear syntax is V0[1]).
 
means the 1st component of V0 (linear syntax is V0[1]).
  
==== Records ====
+
=== Records ===
  
 
Page 2 of Bauer alludes to 'records' of the form (A2, A3). We need more info here.
 
Page 2 of Bauer alludes to 'records' of the form (A2, A3). We need more info here.
  
=== Questions ===
+
== Questions ==
  
 
* Are S (and maybe A) variables or types or constants or what? We know S0 is the boolean bit, S1 is an array of boolean bits and apparently S2 is a constant of some type.
 
* Are S (and maybe A) variables or types or constants or what? We know S0 is the boolean bit, S1 is an array of boolean bits and apparently S2 is a constant of some type.
Line 76: Line 74:
 
but.. how is this function called?, how do you actually define stuff to occur in the function, is the 'FIN' end symbol used?
 
but.. how is this function called?, how do you actually define stuff to occur in the function, is the 'FIN' end symbol used?
  
=== Implementation ===
+
== Implementation ==
  
 
Is the 2d syntax representable in ascii in some obvious way?  What are the advantages of the 2d syntax?
 
Is the 2d syntax representable in ascii in some obvious way?  What are the advantages of the 2d syntax?

Revision as of 13:37, 24 November 2006

Spec

Variables

V parameters (r/o)
Z temporaries (r/w)
R results (w/o)

2D syntax 'sidebar'

In the 2D notation there is a vertical column on the right where the value of elements in that row is indicated:

 |Main Line
V|Variable Number
K|Component Number
S|Comment Line

So, as an example:

 |Z  ^ Z
V|4    2
K|2.3
S|0    0

(from page 8 in the Zuse PDF). This is (probably) equivalent to:

Z4[2.3] ^ Z2

in the linear notation.

Primitives

The only primitive type is boolean (or a bit). They are denoted by S0.

Arrays

Arrays can be made up of any other data type. For example:

8 X S0

is an array of 8 bits whereas:

n X 4 X S0

is an n-length array with each element being a 4-length array of bits.

Arrays can be subscripted:

 |V
V|0
K|1

means the 1st component of V0 (linear syntax is V0[1]).

Records

Page 2 of Bauer alludes to 'records' of the form (A2, A3). We need more info here.

Questions

  • Are S (and maybe A) variables or types or constants or what? We know S0 is the boolean bit, S1 is an array of boolean bits and apparently S2 is a constant of some type.
  • What is the difference between S and A?
  • How is a function declared? The Bauer PDF gives this syntax:
P17 |R(V) => (R, R)
   V|  0      0  1
   S|  α      α  0

but.. how is this function called?, how do you actually define stuff to occur in the function, is the 'FIN' end symbol used?

Implementation

Is the 2d syntax representable in ascii in some obvious way? What are the advantages of the 2d syntax?