Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Coffee corner » Pick overloaded by Rvalue?
Re: Pick overloaded by Rvalue? [message #19234 is a reply to message #19233] Sat, 22 November 2008 10:49 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

VC from VS2010 already supports rvaluses, lambdas, auto, and static_assert. But I agree that c++ is too bloated and it is going to be more bloated. This is not good. I would like iso guys to remove headers instead of adding half of those new features. Right now I use c# in my job. I must admit it's a very good language. Even without all those cool features like linq or auto genrating conctructors I found the code written in it a way easier to read (I'm comparing to typical c++ code). And the compilation times are very good. You know I'm tired watching these magic signs like *, &, ->, :: (including combinations) all the time. Switching between header and source simply drives me crazy Wink Now additionaly we have &&... Writing inelisense for c++ is a horror (ask Mirek Wink )
On the other hand I find Upp library marvelous and realy simple to use. What a pity we don't have a better language under it. D is interesting but it follows GC path. GTK fellows wrote VALA maybe we could do something similar like UL (Ultimate language).

PS: You wrote the longest post in history of this forum I guess Wink.
Re: Pick overloaded by Rvalue? [message #19236 is a reply to message #19234] Sat, 22 November 2008 13:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
unodgs wrote on Sat, 22 November 2008 04:49


Writing inelisense for c++ is a horror (ask Mirek Wink )



It is funny challenge for sure Wink

unodgs wrote on Sat, 22 November 2008 04:49


we could do something similar like UL (Ultimate language).



I believe, in a sense, we already did...

You are not going to meet many of those complex constructs in U++ production code.

Anyway, maybe I am just too self-satisfied, but personally I see nothing particulary interesting or helpful in next C++ standard - except maybe clarifications of MT issues, but that is more about what code is "correct by standard", not a game changer in existing practices.

I can imagine a lot of evolutionary improvements and some inevitable cleanups, but overal, for me, U++ succeeded. This is THE environment I wanted to work in Smile

Mirek
Re: Pick overloaded by Rvalue? [message #19237 is a reply to message #19236] Sat, 22 November 2008 13:22 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, I guess I should have made it a little bit more clear:

For now, I am going to ignore the next C++ standard.

Mirek
Re: Pick overloaded by Rvalue? [message #19238 is a reply to message #19237] Sat, 22 November 2008 14:54 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Quote:

I am going to ignore the next C++ standard

I think variadic templates can improve our callbacks, althoug I don't use more than 3/4 parameters Smile
Re: Pick overloaded by Rvalue? [message #19265 is a reply to message #19233] Sun, 23 November 2008 20:53 Go to previous messageGo to next message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
But I would like them to not give attention to anything else except .NET. I'm hoping even for a Windows version which has a .NET with fewer limitations and without WinAPI. 


You are saying you want Microsoft to improve and concentrate on the .NET library?
.NET really gets to me, mainly because it is not cross platform. Porting a .NET application to another platform requires either Mono or an entire rewrite of that code.

To summarize the C++ issue...
The problem with C++: Bloat and complexity.
The benefit of C++: High level abstractions that compile to machine code, full object oriented language.
The problem with Java/C#/etc.: They require an interpreter and thus will always be slower/require more memory than C++ equivalents.
The benefit of Java/C#/etc.: Less complex, less number of exceptions, simpler learning curve, object oriented language, better tool support (Ie. easier to parse).

So what we need is something that compiles to machine code without the complexity of C++. What is there now? What is coming up that merges the benefits of both C++ and interpreted languages?
Re: Pick overloaded by Rvalue? [message #19280 is a reply to message #19265] Mon, 24 November 2008 01:18 Go to previous messageGo to next message
cbpporter is currently offline  cbpporter
Messages: 1401
Registered: September 2007
Ultimate Contributor
captainc wrote on Sun, 23 November 2008 21:53


The problem with Java/C#/etc.: They require an interpreter and thus will always be slower/require more memory than C++ equivalents.


No, not an interpretor. Just in time compiler. I am a hobbyist compiler technology nerd, and I think that at least .NET just in time compiler can generate code comparable with native compiler. It is theoretically the same optimizer that works on the internal tree, but this time the tree is expressed in CIL. The performance difference comes from start up JIT time, start-up huge library dynamic loading and of course GC and abundance of references and deeper indirection level than in C++ code. If we were to use GC in C++ and program in a style that uses the same number of references and level of indirection, I think C++ would be as slow as C#. But I think that C# is close to the borderline where it is not considered slow. The problem is that it is still to slow to to write a Linux kernel in it and it also lacks some features to become a system programing language. And there is no way I can use it with a clear conscience on a 450Mhz machine, where my optimized C++ code blazes by and uses 1/5 of the memory consumption as the equivalent C# app.
Re: Pick overloaded by Rvalue? [message #19281 is a reply to message #19280] Mon, 24 November 2008 06:55 Go to previous messageGo to next message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
I think if C# will have a JIT compiler which will generate(once on a platform) CIL code mixed with native code for parts of code which run often and need performance it will be the choice for applications (non-system) instead of C++. Just think, only first run of the program on that platform will be slow then it should run from a cache and have the performance almost equal with native programs.


cdabbd745f1234c2751ee1f932d1dd75
Re: Pick overloaded by Rvalue? [message #19282 is a reply to message #19281] Mon, 24 November 2008 08:32 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bytefield wrote on Mon, 24 November 2008 00:55

I think if C# will have a JIT compiler which will generate(once on a platform) CIL code mixed with native code for parts of code which run often and need performance it will be the choice for applications (non-system) instead of C++. Just think, only first run of the program on that platform will be slow then it should run from a cache and have the performance almost equal with native programs.



cppporter is right about indirection levels.

E.g. you cannot implement anything close in performance to Vector<String> in C# (ok, String is fundemantal in C#, but imagine you would want to implement yours - you would IMO fail).

BTW, GC makes it faster than if would things be implemented using smart pointers. Smart pointers are generally considered slower than GC. OTOH, GC will eat more memory, at least 30% more if you want any reasonable level of performance.

Mirek
Re: Pick overloaded by Rvalue? [message #19283 is a reply to message #19088] Mon, 24 November 2008 09:05 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
I think as long as you stay "KISS" with your SW, C++ will be always superior in terms of performance.
If you let your code grow in complexity, it may be that "higher" language like Java/C# would help cut some complexity out, and protect you from some bloat, so the performance of C# vs C++ would be similar then. But that's not C++ failure or C# win, that's solely failure of code design.

Quote:

So what we need is something that compiles to machine code without the complexity of C++. What is there now? What is coming up that merges the benefits of both C++ and interpreted languages?


The only thing forcing to use all the complexity of C++ are the underlying libs. If you use simple enough libs, or well encapsulated and well working, so you don't have to dig into them, then just your source decides the level of C++ complexity you have to manage. I mean, you can write very simple (and dumb) source in C++. But it may get quite larger/bloated, than the same functionality written with more complex C++.

Then at some point you have to adopt some source from someone else... and there you go, a) it's easier to write code, than read, b) he will certainly use some C++ features, with which you are not familiar enough and don't feel comfortably using it.

Also I think big part of that "C# is less complex" is strong platform API which helps you more times than C++ stdlib. Surely it's the language definition too, but when I write some simple GUI app with U++, it looks insanely simple. Thank to underlying U++ lib which hides lot of complexity.

[Updated on: Mon, 24 November 2008 09:09]

Report message to a moderator

Re: Pick overloaded by Rvalue? [message #19285 is a reply to message #19283] Mon, 24 November 2008 10:47 Go to previous messageGo to next message
bytefield is currently offline  bytefield
Messages: 210
Registered: December 2007
Experienced Member
So, is better for Upp and for us to stay away from C++ new standard.

luzr wrote

Unfortunately, the main disadvantage of rvalue references is that they do not compose:

struct Foo {
Vector<int> x, y;
};

- such construct would lack auto-generated pick constructor.

I think that is solved by using rvalue references + "move" constructor, that if every object implement move constructor(thought not auto-generated).

Anyway, why take so much to implement C++0x? I see g++ advancing pretty fast while implement new standard, e.g. now it support rvalue references in 4.3.2 (with -std=c++0x) and initializer lists in g++ from svn. However, is better implmentig it slowly, it means i will have 3 years from now to learn new standard and i think 3 years are enough.


cdabbd745f1234c2751ee1f932d1dd75
Re: Pick overloaded by Rvalue? [message #19286 is a reply to message #19285] Mon, 24 November 2008 11:59 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
bytefield wrote on Mon, 24 November 2008 04:47

So, is better for Upp and for us to stay away from C++ new standard.

luzr wrote

Unfortunately, the main disadvantage of rvalue references is that they do not compose:

struct Foo {
Vector<int> x, y;
};

- such construct would lack auto-generated pick constructor.

I think that is solved by using rvalue references + "move" constructor, that if every object implement move constructor(thought not auto-generated).



Last time I have checked, compiler never generates implicit move constructor.

Moreover:

struct Foo {
   Vector<int> x;
   int y;
};


Here U++ has natural pick copy of Foo - created by mixing 'deep' and 'pick' constructors of various members.

Well, AFAIK, authors of r-value references considered such feature "too complex and error-prone". Go figure Smile

(It is however possible that the stance has changed since then - in that case, my stance w.r.t. next C++ would completely changed Smile

Mirek

[Updated on: Mon, 24 November 2008 12:03]

Report message to a moderator

Re: Pick overloaded by Rvalue? [message #19296 is a reply to message #19283] Mon, 24 November 2008 19:25 Go to previous message
captainc is currently offline  captainc
Messages: 278
Registered: December 2006
Location: New Jersey, USA
Experienced Member
Yeah, I meant JIT Compiler, but for some reason I wrote interpreter.

Quote:

Surely it's the language definition too, but when I write some simple GUI app with U++, it looks insanely simple. Thank to underlying U++ lib which hides lot of complexity.

Exactly why U++ is so good... Much cleaner and simple code with good libraries.

I wonder if it would be easy to integrate U++ into existing C++ projects or development environments.
Previous Topic: Looking for someone to convert a ulimate++ project to Microsoft Visual C++ project
Next Topic: Fantastic work!!
Goto Forum:
  


Current Time: Thu Mar 28 15:54:17 CET 2024

Total time taken to generate the page: 0.02053 seconds