Conversation

Maybe I'm getting mixed up between 'environments' and 'contexts' too - I was attempting to use the typechecking context to do my substitutions, but it's obvious now that it that would break down in more complex examples. In HOAS you get an environment for free.
2
AFAIU: context = name -> type, env = name -> value. And the diff between "normalization" and "evaluation" is more-or-less that normalization goes under binders and "fully evaluates" (to "*the* normal form"), mere 'evaluation' doesn't (necessarily).
1
1
(I'm also not -certain- HOAS couldn't work in Rust - do you _need_ to use Rc everywhere, can't you use &Fn during the normalization process? I might experiment a little...)
1
1
(incidentally, if you know how to make the ugly parts of that (e.g. (*foo).clone()) less ugly, i'd be curious) (haven't looked at yours in detail yet because bbiab:)
1
I just use Rcs for all the nodes. Might switch to an arena at some stage though. Feel free to check out Pikelet if you like - it does get a little icky at times, alas.
1
Thanks! The bit w.r.t. using `match` to avoid `**` is nice. W.r.t. some of the others I started writing it that way then thought better of it, or couldn't resist golfing :)
1
1
Show replies