C# plans towards metaprogramming

  • Thread starter Thread starter Valery
  • Start date Start date
V

Valery

What is known about C# generics closing the gap with C++ templates in
the future? Template specialization is especially badly missed. What
new language features are coming in the next release of C#?
 
Which perceived gaps, in particular? What is it you need to do (and
can't)?

I'm not "in the know", but one thing that is regularly discussed is
allowing more dynamic access to members, which would be a step towards
the duck-typing of C++ templates - but I'm not sure if this is a step
forwards or backwards (in this context; obviously in *specific cases*
dynamic member access is good, but I wouldn't want to use it too
often).

Marc
 
What is known about C# generics closing the gap with C++ templates in
the future? Template specialization is especially badly missed. What
new language features are coming in the next release of C#?

Hi,

I do not know the answer of your question, but take a look at
http://blogs.msdn.com/ericlippert/default.aspx
you will find a good deal of exploration of future features of C#
 
I saw a recent article on codeproject.com with an managed code
implementation of C++ Templates for .NET. That might satisfy your curiosity
while you are waiting for the "next version" of C#.
Peter
 
Which perceived gaps, in particular? What is it you need to do (and
can't)?

I'm not "in the know", but one thing that is regularly discussed is
allowing more dynamic access to members, which would be a step towards
the duck-typing of C++ templates - but I'm not sure if this is a step
forwards or backwards (in this context; obviously in *specific cases*
dynamic member access is good, but I wouldn't want to use it too
often).

Marc

Some of the areas of interest: dimensional types (doubles in units of
a particular measure); types with arithmetical features for high-
performance calculations (I need evaluation of sophisticated generic
types with minimal overheads - specialised templates provide for this
well); policy-based programming - to mention a few.

Thanks
 
Tuple support is an interesting one, especially given that this is how
F# works... but I'm not sure it is especially hard to knock a few tuples
together as generic types (or indeed as an anonymous type if only the
caller need know)...

Re the arithmetic - yes; definitely a weakness. If it helps, I've spent
quite a bit of time looking at generic arithmetic; not *quite* as quick,
but still fast (and no additional coding):
http://www.yoda.arachsys.com/csharp/miscutil/usage/genericoperators.html
(download as part of "miscutil")

To be honest I'm not too familiar with policy-based, so I won't presume
to comment.

Marc
 
I saw a recent article on codeproject.com with an managed code
implementation of C++ Templates for .NET. That might satisfy your curiosity
while you are waiting for the "next version" of C#.





- Show quoted text -

Hm. Couldn't find anything there ...
 
I'm just after variance in return types - that's it. I'd recommend looking
at Jon Skeets blog also for additional requests to C#.
 
Back
Top