[Epigram-discuss] This Week's Patches in Epigram

Hi folks, Another week, other reviews: * "Evidences: stole -|| from proofstate, ..." "Evidences: added f-o closures ..." "Evidences: new operator language, ...", Conor First off, if you have never met the "deBruijnifying mangler", it has moved to "Evidences/Mangler" and it's worth visiting him. For performance reasons, we would like to be able to move from values to terms without effort. However, because of our use of functional scopes, turning values to terms require an expensive call to |bquote| (Evidences/Rules). Hence, there is an ongoing effort to get a first-order representation of values (see [http://www.e-pig.org/epilogue/?p=657]). In the first patch, Conor abolishes the distinction between Scopes for values and for terms (Evidences/Tm). We use to have syntactic scopes for terms (|:.|, first-order, where the bounded term contains De Bruijn indices) and functional scopes for values (|HF|, using Haskell's function space). Now, we can have both |:.| and |HF| in values. In the next move, he added first-order closures, |H|, that carries an environment of n variables and a term awaiting (n+1) variables for being closed. This representation works for both values and terms. However, small nitpick: you can not type-check a term containing these |H| closures. The values in the environment do not carry their type, so you have to expand (|bquote|, again) them before type-checking. The embedding from values to terms is reified by the |Yuk| constructor. (This name won't stay for long, I can tell you.). As explained, terms under a |Yuk| can be manipulated but not type-checked without a |bquote|. This is not enforced by Haskell type-checker, so be careful. I think some modifications are still underway, but we got no news for a while now. * "Evidences: new operator language, ...", Conor Long ago, we switched from first-order to higher-order representation of scopes to ease the implementation of operators. Switching back from higher-order to first-order, this called for a new solution. In this patch, Conor has defined a DSEL to describe the run-time behavior of operators (Evidences/Rules). With this language, he has redefined some operators of Enumerations and Descriptions. * "Error handling: refactor ErrorTok ...", Adam The error handling machinery triggers when all hope is gone. For example, if type-checking fails, we have a term in our hand but we don't know its type, if it has any. The distiller looks at us and says: "No type? You don't get in". Moreover, there are many bits which are overly generic (such as |canTy| for instance): more often than not, when reporting an error, all we have is a "polymorphic stuff" we know nothing about. Hence this best-effort machinery. However, Adam has successfully collapsed many flavor of errors into fewer cases. Hence leading to a simpler machinery and less complicated client code. * "Distillation: document and answer a few questions", Adam Documentation of the Distillation/* received a careful review. Check it out! * "Features/Enum.lhs Fixed strictness bun in canTy rules", Peter Peter, in his war for laziness, has squashed a strictness bug, this time in |canTy|. In Epigram, pairs are *lazy*: they are only computed when projected. Therefore, in the implementation, we cannot use Haskell's pattern-matching on pair constructors |PAIR|: we must project out the component we are interested in, with |x $$ Fst| or |x $$ Snd|. As such, this looks easy. But you will notice that in this patch, we weren't pattern-matching on a |PAIR| but on |CONSE|, ie. the constructor of EnumU. Yes, but remember: EnumU is levitating, so |CONSE| is nothing but a code. A code made of pairs... * "Checkpoint: NameResolution documentation import" "Checkpoint: more NameResolution tidying ..." "NameResolution: more documentation ..." "NameResolution: start refactoring resolve; ..." "Epitome: an important backslash", Adam and Peter Disturbed by my moaning of last week, Peter had lost sleep. So, he wrote us an email explaining why NameResolution is such a "rat nest", quoting him. Adam ported the mail to the Epitome, extending the documentation here and there, and adding the example test cases. From there, Adam started a refactoring effort of the rat nest. I cannot spell out the details but if you watch the patch, you can see Adam making his way through the rats. Do like me, join the cheerleaders for Adam: Gimme an A! Gimme a D! Gimme an A! Gimme an M! Whoooooo! * "test/Syntax.pig: Document Epigram syntax ..." "Update Syntax.pig test log" "Syntax.pig: remove redundant refl2", Pierre For those of us not equipped with a Hieroglyph-to-Latin translator, I've written test/Syntax.pig to document Epigram syntax. Feel free to suggest improvements. * "linked Pierre's Syntax.pig from the docs.html page.", James I'm pretty sure I did not talked about our website last time. We have a new one! It's up there [http://www.e-pig.org/]! Cheers, -- Pierre