git @ Cat's Eye Technologies Fountain / faad83d
Write down some notes. Chris Pressey 2 years ago
1 changed file(s) with 21 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
8787
8888 * Require that variables be declared. (Unless maybe operating in some cavalier mode)
8989 * Check constraints on all branches of an alternation.
90 * Allow local variables to be declared.
91 * Allow `arb` binding to have a default value, as this is possibly the only thing that makes sense for local variables.
92
93 The last two items come from the following use case: say we want to parse any amounts
94 of whitespace between tokens, but when generating, always generate a fixed amount of
95 whitespace. We can't do this with a global variable (because then we always have to
96 have the _same_ amount of whitespace between any two tokens). We want a local
97 variable. Moreover we always want to unify it with 1 when generating.
98
99 So our "space" production looks something like:
100
101 Space ::= <. local n = 0 .> { " " <. n += 1 .> } <. arb n (1) .>
102
103 The default could also be an expression based on globals. Allowing the user to
104 specify what the spacing is every time the Space production is generated.
90105
91106 ### Documentation
92107
97112 ### To think about
98113
99114 * Will we want productions to have arguments and how would that work?
100 * Will we want productions to have local variables and how would that work?
101115 * Will we want variables of string type?
102116 * Will we want variables of "string produced by a certain production" type?
103117 * What other types might we want? Lists and maps and sets seem likely.
104118
105119 ### Aspirational
106120
121 * Allow (pseudo)random numbers to be used in generation.
122 Probably we can have a built-in function that takes a seed a produces
123 the next pseudorandom number in the sequence. And another function for
124 limiting that number to a desirable range (i.e. modulo).
125 The key here is that we must also be able to parse what we've
126 pseudo-randomly generated.
107127 * Write the "kennel story" generator in Fountain. Show that
108128 it can parse the same story it generated, in a reasonable
109129 time, even up to 50,000 words.