There is one reason to clone example programs: they're nice for comparing languages. As long as they're short enough to read quickly, they're a nice way to show how a language differs from others. As long as it's not too different, anyway - if the examples aren't expressed in much the same way, they won't map onto each other easily, and the reader will learn nothing except that the language is really weird.
I've used the Shootout programs as comparative examples occasionally, since they're available in so many languages that there's usually one close enough to compare to. I also use them to test the expressiveness of my languages. They're simple and easy, yet well-defined, so I can't reinterpret the problem to match whatever's easy in my language. Unfortunately I haven't found a solution to the inverse problem: I am tempted to revise minor details of my language to fit the problem. Done generically, this is good, but done for a specific problem, it destroys the value of the test, and does nothing to improve the language.
It does produce some impressive expressiveness results, though. When you even minutely customize the language to the problem, it's not hard to make it shorter and clearer than Perl and Haskell, for a wide range of problems. Now if I could just figure out how to do that in general...
No comments:
Post a Comment
It's OK to comment on old posts.