Wednesday, July 11, 2012

When I see that a new language makes a difference between statements and expressions

3 comments:

Rob said...

'd point out that my sometimes-hobby horse, Call-By-Push-Value, definitely distinguishes between statements (code associated with negative types) and expressions (code associated with positive types). Certainly I think that CPBV has the potential to guide us to do this in a way that's more principled than what's frequently done in practice, but there are potentially answers to Neil Patrick Harris's emphatic question.

Manuel Simoni said...

Right. CBPV quickly came to mind before I pushed the "publish" button.

Anonymous said...

It is simple: Expressions should have no side effects, while statements are allowed to have them. This makes reasoning about code a lot easier, especially for programmers without formal education and the ones who care about formal semantics and verification. If a language has no side effects in expressions it makes the formal semantics of a language simpler and you can define a wp-calculus directly on the statement level.