archives

switch statement design

Recently there were a few discussion on some MS blogs about the design of the "switch" statement. I'm curios what readers of LtU have to say about it.

See: Links to blog discussions about "switch".

Natural Programming Languages

A thought-provoking article in the ACM Queue (linked to by Slashdot, so it may be a bit slow).

  Natural Programming Languages and Environments

There some good ideas in there, especially with regards to debugging. However, I've always thought of "natural" programming languages as something that the "average" user would want to use for everyday tasks in some system. I think it's hard to avoid getting into the nitty-gritty details when building large systems that you want to be time and/or space efficient in terms of runtime resources (not necessarily development time).

It was interesting to note that rule-based and event-based structure was deemed to be the most common way people naturally expressed the way to solve a problem. Yet, logic-based languages (that use rules) seem to be the hardest for a lot programmers/students to pick up on. (That's been my experience, anyway.)

For some more discussion that is considerably older (showing that the topic is certainly not new...), you can check out something Dijkstra and Sammet had to say (with slightly differing opinions).

  On the foolishness of "natural language processing" (Dijkstra)

  The use of English as a programming language (Sammet, requires ACM membership to view)

Multi-Return Function Call

Olin Shivers and David Fisher. Multi-return Function Call. In Proceedings of ICFP '04.
It is possible to extend the basic notion of "function call" to allow functions to have multiple return points. This turns out to be a surprisingly useful mechanism. [...] We conclude that multiple-return function call is not only a useful and expressive mechanism, both at the source-code and intermediate-representation level, but is also quite inexpensive to implement.

Especially interesting are the cases where a tail call can actually shrink the stack.