User loginNavigation |
Designing a Type Notation for a Stack Based Functional LanguageI am designing a dialect of Joy called 'Big Cat'. Like Joy, Big Cat is a pure stack based functional language (or concatenative language, if you like the term). This means that every function takes a single stack as a parameter, and returns a new stack as a result. Most programs expect a certain stack configuration, so I am devising a syntax for expressing the desired type configuration. One of the changes is the introducction of a type notation for operations. Here is my current proposal: swap (T, U) => (U, T); dup (T) => (T, T); dupN (int, T) => (T*); pop (T) => (); popN (int, T*) => (); if (() => T, () => U, bool) => (U|T); I welcome feedback, and suggestions. Let me know if the syntax is not intuitive and you need clarification, thanks! By cdiggins at 2006-05-06 16:40 | LtU Forum | previous forum topic | next forum topic | other blogs | 9006 reads
|
Browse archives
Active forum topics |
Recent comments
22 weeks 6 days ago
22 weeks 6 days ago
22 weeks 6 days ago
45 weeks 17 hours ago
49 weeks 2 days ago
50 weeks 6 days ago
50 weeks 6 days ago
1 year 1 week ago
1 year 6 weeks ago
1 year 6 weeks ago