Thursday, July 8, 2010

A Blueprint for Combinator Libraries

As I stated before, the main point of the Hi language should be combinatorial thinking. Whether that is a viable approach, no-one knows. You'll need a pointy hat to program in it, I suppose, but the same holds true for Matlab, so I guess there's a market.

If you write stuff down you start answering your own questions, and the design of combinator libraries shouldn't be too hard. Below, six questions I just patched up which need to be answered if you want to design a library in that manner:

  1. What is the state being threaded?
  2. What are the basic combinators you need?
  3. What are the arguments needed by these combinators?
  4. What are the return values?
  5. How are combinators supposed to be combined?
  6. How can you make it perform?
For a parser library, the answers would be: 1. The collection of tokens unprocessed. 2. Parsing a word. 3. Text to be identified. 4. On success, an arbitrary (AST) value, or just failure. 5. Sequence and choice. 6. The collection of tokens could be an indexed piece of memory.

Not sure, I guess it sticks.

No comments:

Post a Comment