archives

A Deeper Look At Metafunctions

In this Artima article, David Abrahams and Aleksey Gurtovoy take a deeper look at metafunctions, and introduce the Boost metaprogramming library.

The article is an extract from the authors' forthcoming C++ Template Metaprogramming.

The authors' example application of C++ metafunctions is compile-time dimensional analysis. Higher order metafunctions, partial metafunction application and lazy evaluation are also discussed.

Wouldn't an Amazon sponsored link to the book be a good idea here?

Musical programming and languages

Over on Slashdot I saw a thing about a guy hacking Perl in a live musical performance, and it got me wondering again if music and programming can be fused even more tightly, so that code itself is musical?

Being something of a geek for obfuscated languages, I wrote one of my own called SC5, which is based upon the simon-says dance commands from the video game "Space Channel 5". The idea is that the same program text can be executed as an algorithm or performed as a rhythmic piece (as in the game). Unfortunately I haven't yet written an interpreter that will perform SC5 code musically but theoretically, anyway, it's possible.

Anyone else interested in this sort of thing?

Linguistic Reuse

"An age old question asked of language design is whether or not library design is language design. Because interfaces are themselves little languages, and libraries implement interfaces, library design must be a form of linguistic extension, even if an extremely rudimentary one. In practice, library design is difficult, and the hard problems that library designers encounter - how to balance hiding and exposing functionality, how to preserve invariants, what types to create, export and make opaque, what static and dynamic scope operators to provide, and so forth - are really linguistic ones. So it is heartening to note that the design of unit/lang not only encompasses this form of language extension, but blurs the distinction between these two forms in a way traditional language extension mechanisms (such as macro systems, extensible grammars or operator overloading) do not."
p67 "Linguistic Reuse" DPhil thesis 2001 pdf Shriram Krishnamurthi