[PRL] values and expressions

Dave Herman dherman at ccs.neu.edu
Sun Oct 23 12:07:43 EDT 2005


> From the (operational) semanticist's perspective, if your values aren't
> also expressions, then you need to define a whole new set of type rules
> to handle pseudo-expressions---that is, expression ASTs that have values
> at the leaves rather than expressions.  Otherwise, subject reduction
> won't work; you won't even be able to state the theorem.

Sure, though in practice I don't know how much harder that has to be.

> From the perspective of desigining the language that the programmers
> will actually use, it's hard to say.  I'd personally be annoyed with a
> language in which values were not expressions, because it would feel
> like an artificial distinction for no real reason that would possibly
> get in the way of writing the kind of code that I like to write.  How
> serious a problem this would actually be, though, would depend heavily
> on circumstances.  In some applications, I might grumble about it, but
> be able to write the program anyway with only minimal additional effort.

I think in my case it's not a big deal. Lemme describe what I'm doing.

I'm looking at an embedded language of regular expressions, where 
expressions are things like "match this character" and union and 
concatenation. The values are matched characters or matched strings.

You could express matched values as a subset of expressions, but then in 
the reduction rules there's no way to distinguish a rule that says 
"please match this character" from a rule that says "I just matched this 
character." So I want to distinguish expressions and values to 
disambiguate the reduction rules.

Dave



More information about the PRL mailing list