Thesis on metaprogramming in D

Steve Horne stephenwantshornenospam100 at aol.com
Tue Nov 28 22:22:17 PST 2006


On Tue, 28 Nov 2006 13:59:20 +0100, Don Clugston <dac at nospam.com.au>
wrote:

>Andrey Khropov wrote:
>> Steve Horne wrote:
>> 
>>> My view of the ideal handling of metaprogramming is that it should
>>> have access to all the features that are available at runtime. The
>>> only languages that I know that genuinely achieve that are the
>>> Lisp-alikes such as Scheme.
>>>
>>> My ideal is being able to define 'quoted' blocks that are parsed and
>>> translated to ASTs, with those ASTs being processed by other code to
>>> derive new ASTs which are then submitted for the final back-end
>>> optimisation and code generation.
>> 
>> Nemerle does exactly that way!

Cool!

>When I looked at the Nemerle website, I didn't see much that couldn't be 
>done easily with D templates. It would be interesting to find something 
>it can do, that D can't.

That doesn't worry me much, to be honest. I don't want another Scheme
(or at least my perception of Scheme) where you start each journey not
by getting into your car, but by re-inventing the wheel.

The point in my view is to be able to opt of the standard toolkit when
in those special cases where it doesn't quite fit, without having to
opt out of the language completely.

And so I imagine most generic programming tasks in Nemerle would use
the .NET 2 generics. These aren't as flexible as C++ templates, let
alone D ones, but they have the advantage that they are closure based
and not prone to bloat. Nevertheless, there are useful things that you
can't easily do with them. It sounds like Nemerle lets you work around
that limitation when you need to.

Being a .NET thing, it's presumably more of an apps-level language
than systems-level, but maybe it has some transferrable ideas?

-- 
Remove 'wants' and 'nospam' from e-mail.



More information about the Digitalmars-d mailing list