473,800 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# plans towards metaprogramming

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#?
Jun 27 '08 #1
7 1415
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
Jun 27 '08 #2
On May 8, 9:17*am, Valery <vale...@gmail. comwrote:
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#
Jun 27 '08 #3
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
"Valery" <va*****@gmail. comwrote in message
news:94******** *************** ***********@p39 g2000prm.google groups.com...
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#?
Jun 27 '08 #4
On May 8, 11:30*pm, Marc Gravell <marc.grav...@g mail.comwrote:
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
Jun 27 '08 #5
On May 9, 10:18*am, "Peter Bromberg [C# MVP]"
<pbromb...@nosp ammaam.yahoo.co mwrote:
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"Valery" <vale...@gmail. comwrote in message

news:94******** *************** ***********@p39 g2000prm.google groups.com...
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#?- Hide quotedtext -

- Show quoted text -
Hm. Couldn't find anything there ...
Jun 27 '08 #6
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/...operators.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
Jun 27 '08 #7
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#.

--
With regards
Anders Borum / SphereWorks
Microsoft Certified Professional (.NET MCP)

Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2165
by: Dave | last post by:
Would people agree with the statement that to a large degree, using template metaprogramming techniques turns a C++ compiler into a C++ interpreter (but just for the metaprogrammed portions of the code)? It's not a perfect analogy, but it seems to be a reasonable statement...
9
1576
by: Rock Johnson | last post by:
I understand that template metaprogramming is a technique that allows for calcualations to occur at compile-time rather than run-time. Can someone explain what is the benefit of this, and when it is good to employ Template Metaprogramming?
3
1427
by: wakun | last post by:
Hi there, I am working a project in numerical computation in which iterative method is applied for solving equation. The problem is so big and slow. Few days ago, I found a paper on metaprogramming , it seems that such technique has good performance for some case. For ordinary case, my code for implementing iterative method like for (int i=1; i<N; i++) { x = f(x, x);
9
3425
by: PengYu.UT | last post by:
Hi, I have the code below this email. I want to replace the last 4 lines with a Metaprogramming loop to get something like the following (I don't know the syntax). Is it possible? for type in {left_tag, right_tag, down_tag, up_tag) { fun(type()); }
7
3557
by: Joe | last post by:
Hi, I found a concept named template metaprogramming that can be used in C+ + code at compile-time. I am a beginner at C++. But I am a programmer on the .NET platform. Do you know if template metaprogramming is supported in C# (.NET)? For reference I found it: http://en.wikipedia.org/wiki/Template_metaprogramming. Thanks to all.
5
3622
by: iapx86 | last post by:
My parser project calls for a computed goto (see code below). The C preprocessor delivers the desired result, but is ugly. Template metaprogramming delivers results I do not understand. Can anyone explain why loop unrolling doesn't play well with templates? Or better, can someone submit a code fragment to get desired results? Here are the command-lines I use to generate code: "g++ -DTEMPLATE=0 -o gotofun0 gotofun.cpp" works exactly as...
9
1639
by: andrew cooke | last post by:
Hi, Thanks for the help a couple of days ago. I completed what I was doing and wrote a summary which I've posted at http://acooke.org/cute/PythonMeta0.html (it's kind of long to post here). I hope it might be useful to someone else - it's complete code for a simple metaprogramming task that uses metaclasses and descriptors. I'd also appreciate further feedback if I've done anything stupid or if there's some interesting approach I've...
16
1623
by: Wilson | last post by:
Hi all, I have an interesting problem that I'm hoping can be solved with metaprogramming, but I don't know how far Python supports code generation (and I don't know if I'm taking the correct approach either... hence why I'm asking on this group): I'd like to write a program that writes/manipulates a statemachine. My idea was that I would define states in a .py file along with their transitions and other metadata. I could then write a...
12
3374
by: nooneinparticular314159 | last post by:
Hello. If I declare the following: template<int a, int b, int SomeArray> class DoSomething{ public: .. .. ..
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10275
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.