Wednesday, July 11, 2012

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

3 comments:

  1. '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.

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

    ReplyDelete
  3. 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.

    ReplyDelete

Real names (or handles), please. Anonymous comments are likely to be ignored.