On 21/03/14 06:21 PM, Barbara Lattanzi wrote:
>
> The link to java2k was startling and funny. It made me wonder if there is
> any use to creating a programming language made completely out of
> puns...for machines or dancers, and thus guaranteeing the "effects of
> misreading".
There's a technique in programming called "type punning" that
circumvents the rules of a given programming language in order to allow
it to perform a task:
http://en.wikipedia.org/wiki/Type_punning
There's a good discussion of puns and programming languages here:
http://mndrix.blogspot.de/2012/06/puns-in-programming-language-design.html
although it moves away from natural language puns almost before it starts.
There are programs called Quines that output another program:
http://en.wikipedia.org/wiki/Quine_%28computing%29
And there's a Quine that loops through fifty different languages to
output the original program:
https://github.com/mame/quine-relay
I think this kind of code comes close to puns, although again it's not
like a natural language pun.
Some programming languages or libraries do infer meaning from, for
example, the plurality of words. ActiveRecord in Ruby knows that a Dog
object will go in a Dogs table, for example. So a pun grammar could be
meaningful in a programming language in the way that you suggest.
Although I wouldn't want to program a nuclear power station using it. :-)
- Rob.
|