C# plans towards metaprogramming

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#?
 
M

Marc Gravell

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
 
I

Ignacio Machin ( .NET/ C# MVP )

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#
 
P

Peter Bromberg [C# MVP]

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
 
V

Valery

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
 
M

Marc Gravell

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
 
V

Valery

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 ...
 
A

Anders Borum

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#.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top