C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
The D programming language Posted by Gregry2 on 26 Jun 2006 at 5:45 PM
have you guys ever heard of D? Someone made it to be the successor to C++. It actually seems cool, mixing high level aspects with low level.

the site
http://www.digitalmars.com/d/

a short descrition
http://en.wikipedia.org/wiki/D_programming_language

the question is what do you guys think?
{2}rIng
Report
Re: The D programming language Posted by Lundin on 27 Jun 2006 at 12:31 AM
: have you guys ever heard of D? Someone made it to be the successor to C++. It actually seems cool, mixing high level aspects with low level.
:
: the site
: http://www.digitalmars.com/d/
:
: a short descrition
: http://en.wikipedia.org/wiki/D_programming_language
:
: the question is what do you guys think?
: {2}rIng
:


The only things that appeal to me are that I think you can make whole sections of code "volatile" or thread safe by just writing a keyword + {} around it.

But it has garbage collection... so everyone just laughs at the language as they do at Java and C#. Nice try, though.
Report
Re: The D programming language Posted by tsagld on 27 Jun 2006 at 3:27 AM
: : have you guys ever heard of D? Someone made it to be the successor to C++. It actually seems cool, mixing high level aspects with low level.
: :
: : the site
: : http://www.digitalmars.com/d/
: :
: : a short descrition
: : http://en.wikipedia.org/wiki/D_programming_language
: :
: : the question is what do you guys think?
: : {2}rIng
: :
:
:
: The only things that appeal to me are that I think you can make whole sections of code "volatile" or thread safe by just writing a keyword + {} around it.
:
: But it has garbage collection... so everyone just laughs at the language as they do at Java and C#. Nice try, though.

I am an experienced C++ and C# coder and certainly do not laugh at C#. It is nice to write your own clean-up stuff, but if you don't have to, it's nicer.
It is also nice to write your own printf function, but if you don't have to...see what I mean?




Greets,
Eric Goldstein
http://www.gvh-maatwerk.nl


Report
Re: The D programming language Posted by Lundin on 27 Jun 2006 at 4:15 AM
: : : have you guys ever heard of D? Someone made it to be the successor to C++. It actually seems cool, mixing high level aspects with low level.
: : :
: : : the site
: : : http://www.digitalmars.com/d/
: : :
: : : a short descrition
: : : http://en.wikipedia.org/wiki/D_programming_language
: : :
: : : the question is what do you guys think?
: : : {2}rIng
: : :
: :
: :
: : The only things that appeal to me are that I think you can make whole sections of code "volatile" or thread safe by just writing a keyword + {} around it.
: :
: : But it has garbage collection... so everyone just laughs at the language as they do at Java and C#. Nice try, though.
:
: I am an experienced C++ and C# coder and certainly do not laugh at C#. It is nice to write your own clean-up stuff, but if you don't have to, it's nicer.
: It is also nice to write your own printf function, but if you don't have to...see what I mean?

Those languages are very nice for desktop apps, but nothing else.
The point is: why create a general purpose programming language that you can only use for one thing?

(I certainly didn't laugh when I had to deliver 20MB runtime junk together with my program written in .NET, but that's another story... )

Seriously, I know what you mean, but to me it seems like they invented garbage collection only to satisfy all the sloppy programmers who can't find their own bugs / memory leaks. Imo it is better to find the leaks instead of hiding them behind the garbage collector...

Report
Re: The D programming language Posted by tsagld on 27 Jun 2006 at 7:14 AM
: Those languages are very nice for desktop apps, but nothing else.
: The point is: why create a general purpose programming language that you can only use for one thing?
That's absolute crap. I wrote dozens of batch-oriented stuff in C#. It runs slower, but you develop faster.
If speed is the main issue, use C++ or asm. But that's it.
Web-applications are also extremely easy to create.


: (I certainly didn't laugh when I had to deliver 20MB runtime junk together with my program written in .NET, but that's another story... )
The runtime will be part of the OS soon, as MSVCRT.DLL became part of the OS after Win95.
Did you deliver MSVCRT.DLL, about 400 Kb, with your C/C++ apps before Win98? Taking the growth of the harddisc-capacity into account, 20Mb is as much as the 400 Kb.


: Seriously, I know what you mean, but to me it seems like they invented garbage collection only to satisfy all the sloppy programmers who can't find their own bugs / memory leaks. Imo it is better to find the leaks instead of hiding them behind the garbage collector...
:


Well, your right about the reason garbage-collection was invented. But since it became so common that apps contained memory leaks, garbage collection is the better option imo.
It may be better to find your own leaks in a sense of 'knowing your code'. But it is not an issue to even think about in .NET. I see that as an advantage. Besides that, the .NET garabage collector is generally more efficient than doing it yourself in C++. It runs in its own thread, destroying objects in idle time. Great.
Admitted, I want to clean up myself every now and then too. But when I do, I realize that this is so because of my C++ background. No other reason.


Greets,
Eric Goldstein
http://www.gvh-maatwerk.nl


Report
Re: The D programming language Posted by bilderbikkel on 27 Jun 2006 at 1:15 AM
In my humble vision, I don't see an improvement in elegance nor functionality, except a little bit in the function arguments of main, but I'd have preferred main to have arguments const std::vector<std::string>& args. In my humble opinion, I don't see the problem of using C++ with the many excellent libraries out there (STL, Boost, VCL).

A successor is not always better (e.g. Pokemon 2).

See ya,
bilderbikkel

Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 5:03 AM
I guess, but it matters what ur doing.

Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())

Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.

Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
{2}rIng
Report
Re: The D programming language Posted by Lundin on 27 Jun 2006 at 5:21 AM
: I guess, but it matters what ur doing.
:
: Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
:
: Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
:
: Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: {2}rIng
:

Oh, that is more like it, then

The sad truth is that a programming language won't be successful unless you have a company like MS or Sun promoting it. It doesn't matter if the language is good or not.
Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 5:26 AM
:
: Oh, that is more like it, then
:
: The sad truth is that a programming language won't be successful unless you have a company like MS or Sun promoting it. It doesn't matter if the language is good or not.
:

I hate this world X(
{2}rIng


Report
Re: The D programming language Posted by bilderbikkel on 27 Jun 2006 at 5:40 AM
: Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())

: Thats what makes D special (not as a replacement).
Why does garbage collection make D so special? At first C# has garbage collection as well (and many many more languages). At second, in C++ you have excellent possibilities to manage the memory yourself, using smart pointers (e.g. std::auto_ptr, boost::scoped_ptr and boost::shared_ptr (www.codepedia.com/1/CppAutoPtr, www.codepedia.com/1/CppScopedPtr and www.codepedia.com/1/CppSharedPtr respectively).

So, what's left that makes D so special?

See ya,
bilderbikkel

Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 6:02 AM
Its not the garbage collection that makes it special, its the fact u have a choice. I also said how its features can keep one from using real pointers ( I forgot which, and its hidden in the specs, so it'll take a whilke to find.), but it includes pointers anyway. A waste? No, for it serves its purpose, to be practical. Sometimes there is a need for low level stuff, so its still there. Its like having the new and old together, I think.

Another low level thing it has, considering its high level garbage collector, is inline asm. Of course, Java and C# can't have inline asm because there are atop platforms. Big constrast, huh? Thats what seems special, the fact it has high level features, but at the same time, has low level features that it still can be a systems programming language.

Read the wikipedia thing on it, its shorter and to the point.
{2}rIng
Report
Re: The D programming language Posted by Lundin on 27 Jun 2006 at 6:46 AM
: Its not the garbage collection that makes it special, its the fact u have a choice. I also said how its features can keep one from using real pointers ( I forgot which, and its hidden in the specs, so it'll take a whilke to find.), but it includes pointers anyway. A waste? No, for it serves its purpose, to be practical. Sometimes there is a need for low level stuff, so its still there. Its like having the new and old together, I think.
:
: Another low level thing it has, considering its high level garbage collector, is inline asm. Of course, Java and C# can't have inline asm because there are atop platforms. Big constrast, huh? Thats what seems special, the fact it has high level features, but at the same time, has low level features that it still can be a systems programming language.
:
: Read the wikipedia thing on it, its shorter and to the point.
: {2}rIng
:


ANSI C doesn't have inline asm either, while C++ supports it in the standard.

Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 7:16 AM
:
: ANSI C doesn't have inline asm either, while C++ supports it in the standard.
:
:

R u serious!?!?!?!? I think my love of C dropped a notch...

But inline asm is very much compiler indepedent, the syntax, right? Or was it not made standard at the time because asm varies from machine to machine?
{2}rIng
Report
Re: The D programming language Posted by Lundin on 27 Jun 2006 at 7:35 AM
: :
: : ANSI C doesn't have inline asm either, while C++ supports it in the standard.
: :
: :
:
: R u serious!?!?!?!? I think my love of C dropped a notch...
:
: But inline asm is very much compiler indepedent, the syntax, right? Or was it not made standard at the time because asm varies from machine to machine?
: {2}rIng
:


Every C compiler has got inline asm, but there is no standard.
The syntax can be:

asm (NOP);
asm ("NOP");
asm { NOP };
asm { "NOP" };
asm NOP;
asm "NOP";
_asm
__asm

...and so on. The instructions themselves are of course depending on the assembler/CPU rather than the C compiler.

In C++ I believe it is only valid to write

asm ("NOP");

Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 7:38 AM
another reason to hate this world X(
{2}rIng
Report
Re: The D programming language Posted by stober on 27 Jun 2006 at 7:39 AM
:
: But inline asm is very much compiler indepedent, the syntax, right? Or was it not made standard at the time because asm varies from machine to machine?
: {2}rIng
:


inline is very much compiler dependent -- each compiler implements it in different ways even for the same target system. asm is very much NON-PORTABLE, so if you plan to compile a program with different compilers and/or for different target platforms, then do not use it at all. besides, most good optimizing compilers today produce very efficient assembly code, so rolling your own assembly is not very worthwhile today.

Report
Re: The D programming language Posted by IDK on 27 Jun 2006 at 7:57 AM
: :
: : But inline asm is very much compiler indepedent, the syntax, right? Or was it not made standard at the time because asm varies from machine to machine?
: : {2}rIng
: :
:
:
: inline is very much compiler dependent -- each compiler implements it in different ways even for the same target system. asm is very much NON-PORTABLE, so if you plan to compile a program with different compilers and/or for different target platforms, then do not use it at all. besides, most good optimizing compilers today produce very efficient assembly code, so rolling your own assembly is not very worthwhile today.
:
:
Sometimes it's easier to just use some inline asm isntead of downloading some big library that only takes up space.
Like the CPUID instruction.

Does all compilers support intel syntax and the other (can't remember the name) syntax?
Report
Re: The D programming language Posted by stober on 27 Jun 2006 at 10:05 AM
This message was edited by stober at 2006-6-27 10:19:4

:
: Does all compilers support intel syntax and the other (can't remember the name) syntax?
:


No. Intel is only supported in Intel computers. Many compilers compile for RISK, ARM, and hundreds of other CPUs and they look nothing like 80x88 assembly.

attempting to avoid linking with some libraries is a poor excuse for using assembly. linkers only bring into your program those portions of the library that are needed to resolve all references. If function foo() is in the library, is in its own object file, and not referenced anywhere then the linker will just ignore it.

Some linkers go even further than that -- they will toss out code that is not referenced anywhere in the program even though it may be compiled in an object file with other functions that are used, even unused code in your own program


for CPUID instruction you don't need assembly at all, M$ compilers have a function _cpuid().
http://msdn2.microsoft.com/en-us/library/hskdteyh.aspx


Report
Re: The D programming language Posted by IDK on 27 Jun 2006 at 2:32 PM
: This message was edited by stober at 2006-6-27 10:19:4

: :
: : Does all compilers support intel syntax and the other (can't remember the name) syntax?
: :
:
:
: No. Intel is only supported in Intel computers. Many compilers compile for RISK, ARM, and hundreds of other CPUs and they look nothing like 80x88 assembly.

You got me all wrong, is it possible to use intel SYNTAX was my Q, nothing else.

The intel syntax is like this:
mov ax, bx
wich will move bx into ax
while the other syntax is like this:
mov %bx, %ax
wich will do the same as the one above.

The other syntax is a pain for me, becouse everything is reversed.

:
: for CPUID instruction you don't need assembly at all, M$ compilers have a function _cpuid().
: http://msdn2.microsoft.com/en-us/library/hskdteyh.aspx
:

I use gcc, and I could't find it.
Report
Re: The D programming language Posted by shaolin007 on 27 Jun 2006 at 12:57 PM
: I guess, but it matters what ur doing.
:
: Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
:
: Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
:
: Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: {2}rIng
:

Don't look at it as it's better than this or that. Learn one language backwards and forwards because if you know one really well then the others will be just the same old stuff in a different syntax.

Why would you want to program without pointers? Seems strange to me.


Report
Re: The D programming language Posted by IDK on 27 Jun 2006 at 2:35 PM
: : I guess, but it matters what ur doing.
: :
: : Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
: :
: : Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
: :
: : Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: : {2}rIng
: :
:
: Don't look at it as it's better than this or that. Learn one language backwards and forwards because if you know one really well then the others will be just the same old stuff in a different syntax.
:
: Why would you want to program without pointers? Seems strange to me.
:

:
:
Without pointers it's impossible to access the wrong memmory (aka segmentation fault in unix) (if the arrays are controlled too).
Report
Re: The D programming language Posted by shaolin007 on 27 Jun 2006 at 4:10 PM
: : : I guess, but it matters what ur doing.
: : :
: : : Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
: : :
: : : Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
: : :
: : : Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: : : {2}rIng
: : :
: :
: : Don't look at it as it's better than this or that. Learn one language backwards and forwards because if you know one really well then the others will be just the same old stuff in a different syntax.
: :
: : Why would you want to program without pointers? Seems strange to me.
: :

: :
: :
: Without pointers it's impossible to access the wrong memmory (aka segmentation fault in unix) (if the arrays are controlled too).
:


Hmmm, I didn't realize pointers were that hard to keep track of.


Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 4:40 PM
: : : : I guess, but it matters what ur doing.
: : : :
: : : : Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
: : : :
: : : : Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
: : : :
: : : : Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: : : : {2}rIng
: : : :
: : :
: : : Don't look at it as it's better than this or that. Learn one language backwards and forwards because if you know one really well then the others will be just the same old stuff in a different syntax.
: : :
: : : Why would you want to program without pointers? Seems strange to me.
: : :


EXACTLY! read the second paragraph...again. Its possible not to use pointers for those who want to program without fear of segmentation faults as NIklas said, but pointers are still included. Why? THe second paragraph tells why.
{2}rIng

Report
Re: The D programming language Posted by shaolin007 on 27 Jun 2006 at 4:50 PM
: : : : : I guess, but it matters what ur doing.
: : : : :
: : : : : Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
: : : : :
: : : : : Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
: : : : :
: : : : : Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: : : : : {2}rIng
: : : : :
: : : :
: : : : Don't look at it as it's better than this or that. Learn one language backwards and forwards because if you know one really well then the others will be just the same old stuff in a different syntax.
: : : :
: : : : Why would you want to program without pointers? Seems strange to me.
: : : :

:
: EXACTLY! read the second paragraph...again. Its possible not to use pointers for those who want to program without fear of segmentation faults as NIklas said, but pointers are still included. Why? THe second paragraph tells why.
: {2}rIng
:

:


I understood the 2nd paragraph fine. My point is, why would you want to program without pointers and IDK responded. I'm sorry, is there a problem with you understanding that?


Report
Re: The D programming language Posted by Gregry2 on 27 Jun 2006 at 5:10 PM
: : : : : : I guess, but it matters what ur doing.
: : : : : :
: : : : : : Lundin dude, you probably didn't read the wikipedia description. You actually have the option of turning off the garbage collection for either parts of the program or the entire program. I think it said you could also put explicitly instantiate/remove objects with the C functions (malloc()/realloc())
: : : : : :
: : : : : : Thats what makes D special (not as a replacement). I actually read this in the specs a while ago. It said it was a practical language. It gives high level features, but leaves the low level because sometimes its needed. Like it said how its features can make programming in it possible without pointers, but pointers weren't left out, he kept it because there are exceptions.
: : : : : :
: : : : : : Not as a replacement though. I still like C/C++. I think I'll look at D a little longer just to see what is like.
: : : : : : {2}rIng
: : : : : :
: : : : :
: : : : : Don't look at it as it's better than this or that. Learn one language backwards and forwards because if you know one really well then the others will be just the same old stuff in a different syntax.
: : : : :
: : : : : Why would you want to program without pointers? Seems strange to me.
: : : : :

: :
: : EXACTLY! read the second paragraph...again. Its possible not to use pointers for those who want to program without fear of segmentation faults as NIklas said, but pointers are still included. Why? THe second paragraph tells why.
: : {2}rIng
: :

: :
:
:
: I understood the 2nd paragraph fine. My point is, why would you want to program without pointers and IDK responded. I'm sorry, is there a problem with you understanding that?
:

:
:

Oh...eh heh heh heh, sorry about that. Yeah, some individuals find having to care about pointers distracting, that is distracting from their algorithm, what they really are trying to do.

There are logical languages that do that completely though, as if your not even programming anymore. I think Prolog is one, I heard of another based on C, but I forgot what it was.

Other languages like Java and C# replace pointers with more safe, more innocent "references" (you can tell by the name), although in C#, I think u can use pointers, but its not recommended...references are indeed pointers, but you can't just add or subtract them with normal integer or any values and still use it as a pointer, like

this is legal in C

int *p=&q;
p+=3;

but in Java,

Object p;//this is a "reference"
p+=4;//you can't do that, I think

Personally, I like pointers, and I actually use the pointer arithmetic like p+a rather than &p[a], it can be clearer, depending on what you see it as.
{2}rIng


Report
Re: The D programming language Posted by Lundin on 27 Jun 2006 at 11:33 PM
:
: Oh...eh heh heh heh, sorry about that. Yeah, some individuals find having to care about pointers distracting, that is distracting from their algorithm, what they really are trying to do.

I believe they are called newbies...

:
: There are logical languages that do that completely though, as if your not even programming anymore. I think Prolog is one, I heard of another based on C, but I forgot what it was.
:
: Other languages like Java and C# replace pointers with more safe, more innocent "references"

They are not so innocent. You can still mess up quite a lot when assigning one object to another.

Anyway, you don't -have- to use pointers in C/C++ either. But if you don't, you will end up with a way less powerful language. This whole pointer-phobia is created by people that don't how pointers work. And naturally, if you don't know how to use something, but sill use it, yeah then there will be bugs.

Report
Re: The D programming language Posted by IDK on 28 Jun 2006 at 4:02 AM
This message was edited by IDK at 2006-6-28 4:13:1

: :
: : There are logical languages that do that completely though, as if your not even programming anymore. I think Prolog is one, I heard of another based on C, but I forgot what it was.
: :
: : Other languages like Java and C# replace pointers with more safe, more innocent "references"
:

: They are not so innocent. You can still mess up quite a lot when assigning one object to another.
:



As gregry tried to explain, references in languages like C# and java are innocent.


Report
Re: The D programming language Posted by Eric Tetz on 2 Jul 2006 at 11:17 PM
This message was edited by Eric Tetz at 2006-7-2 23:29:34

Huh?

Large C++ projects spend an inordinate amount of time dealing with memory management related issues and errors. This is not the subjective opinion of a "newbie", it documented fact. These kind of issues affect the bottom line of multi-billion companies, and are studied in depth (have been since the 50s).

Using a system level programming language like C++ only makes sense if you need that kind of speed and control, like for a driver or a commercial videogame. If you're writing a business apps, it's often a waste of money.

Desktop developers in the mid 90s were getting sick of spending huge amounts of time dealing with system level bullshit. Microsoft briefly settled on Java as a solution, until Sun sued them (because Hejlsberg added delegates to Microsoft's JVM to support COM). The Microsoft dropped Java like a bad habit and had Hejlsberg develop C#.

For it's domain, it's brilliant. Just as Perl or Java or freakin' Lua are brilliant in their specific domains. There is no one-size-fit's all language, especially not for professional programmers: there is only the best tool for the job at hand. So copping a holier-than-thou attitude because you know C++ (as if that makes you hot shit) just makes you look like a "newb" (to use your word).

C++ programmers don't look down their nose at C# programmers. If they work in desktop development, they may very well be C# programmers. Most professional programmers know many languages. Byte-code compiled and/or garbage collected languages are more prevalent today simply because machine time is dirt cheap and programmer time is very expensive. The idea that people only use garbage collected languages because they are "noobs" or have "pointer phobia", or that code errors exist only when people "don't know how to use something", is clueless.














Report
Re: The D programming language Posted by Lundin on 28 Jun 2006 at 4:51 AM
10 posts reached...

: This message was edited by IDK at 2006-6-28 4:13:1

: : :
: : : There are logical languages that do that completely though, as if your not even programming anymore. I think Prolog is one, I heard of another based on C, but I forgot what it was.
: : :
: : : Other languages like Java and C# replace pointers with more safe, more innocent "references"
: :

: : They are not so innocent. You can still mess up quite a lot when assigning one object to another.
: :

:
:
: As gregry tried to explain, references in languages like C# and java are innocent.
:

I ment those as well. And no, they aren't... this is what I ment:

(pseudo code)

someFunction(Object byref obj1, Object byref obj2)
{
  obj1 = obj2; 
}


Will the code copy the address or the value here? It is not very obvious and depends on the language. Iirc Java treats common objects in one way and primitive data types + the String object in another way.
Report
Re: The D programming language Posted by IDK on 28 Jun 2006 at 6:13 AM
: 10 posts reached...
:
: : This message was edited by IDK at 2006-6-28 4:13:1

: : : :
: : : : There are logical languages that do that completely though, as if your not even programming anymore. I think Prolog is one, I heard of another based on C, but I forgot what it was.
: : : :
: : : : Other languages like Java and C# replace pointers with more safe, more innocent "references"
: : :

: : : They are not so innocent. You can still mess up quite a lot when assigning one object to another.
: : :

: :
: :
: : As gregry tried to explain, references in languages like C# and java are innocent.
: :
:
: I ment those as well. And no, they aren't... this is what I ment:
:
: (pseudo code)
:
:
: someFunction(Object byref obj1, Object byref obj2)
: {
:   obj1 = obj2; 
: }
: 

:
: Will the code copy the address or the value here? It is not very obvious and depends on the language. Iirc Java treats common objects in one way and primitive data types + the String object in another way.
:
It depends on if the value is saved as a value (what I would call a struct) or as a pointer to a value (what I would call a class).
Report
Re: The D programming language Posted by Lundin on 28 Jun 2006 at 7:09 AM
: : 10 posts reached...
: :
: : : This message was edited by IDK at 2006-6-28 4:13:1

: : : : :
: : : : : There are logical languages that do that completely though, as if your not even programming anymore. I think Prolog is one, I heard of another based on C, but I forgot what it was.
: : : : :
: : : : : Other languages like Java and C# replace pointers with more safe, more innocent "references"
: : : :

: : : : They are not so innocent. You can still mess up quite a lot when assigning one object to another.
: : : :

: : :
: : :
: : : As gregry tried to explain, references in languages like C# and java are innocent.
: : :
: :
: : I ment those as well. And no, they aren't... this is what I ment:
: :
: : (pseudo code)
: :
: :
: : someFunction(Object byref obj1, Object byref obj2)
: : {
: :   obj1 = obj2; 
: : }
: : 

: :
: : Will the code copy the address or the value here? It is not very obvious and depends on the language. Iirc Java treats common objects in one way and primitive data types + the String object in another way.
: :
: It depends on if the value is saved as a value (what I would call a struct) or as a pointer to a value (what I would call a class).
:

With "byref" I mean that the parameters are passed by reference. But the programmer wants to copy the value from obj2 to obj1. The result would vary depending on language:

C: the address is copied (pointers).
C++: the value is copied. The = operator is called.
Java: the address is copied (unless it is a String iirc)
C#: should be the same as C++?
Report
Re: The D programming language Posted by IDK on 28 Jun 2006 at 7:26 AM
: : :
: : : Will the code copy the address or the value here? It is not very obvious and depends on the language. Iirc Java treats common objects in one way and primitive data types + the String object in another way.
: : :
: : It depends on if the value is saved as a value (what I would call a struct) or as a pointer to a value (what I would call a class).
: :
:
: With "byref" I mean that the parameters are passed by reference. But the programmer wants to copy the value from obj2 to obj1. The result would vary depending on language:
:
: C: the address is copied (pointers).
: C++: the value is copied. The = operator is called.
: Java: the address is copied (unless it is a String iirc)
: C#: should be the same as C++?
:

I see your point now.
Report
Re: The D programming language Posted by bluj91 on 3 Jul 2006 at 8:17 PM
: have you guys ever heard of D? Someone made it to be the successor to C++. It actually seems cool, mixing high level aspects with low level.
:
: the site
: http://www.digitalmars.com/d/
:
: a short descrition
: http://en.wikipedia.org/wiki/D_programming_language
:
: the question is what do you guys think?
: {2}rIng
:
the world needs a language such as D for the all the good easy object-orientated languages, like C#, JAVA, J#, all compiler to cursed platforms, like .NET & JAVA. It would be a very good thing if someone made a widespread object-orientated language that contained read-only varibles, delegates and so forth. So lets hope microsft, sun or apple does behind D.

on the note of that how do you send requests and suggests to big companies, like microsoft, sun and apple, and if you send a request does it actually get listened to?
Report
Re: The D programming language Posted by IDK on 5 Jul 2006 at 1:00 PM
: have you guys ever heard of D? Someone made it to be the successor to C++. It actually seems cool, mixing high level aspects with low level.
:
: the site
: http://www.digitalmars.com/d/
:
: a short descrition
: http://en.wikipedia.org/wiki/D_programming_language
:
: the question is what do you guys think?
: {2}rIng
:
I had a look at D, and it looked interesting at first, but then I looked a little closer and found that I can't really 'think' in D...

In C/C++ it's possible to convert the code to assembly in head, but with D it's almost impossible.
An example is the foreach statement. (look at the faq)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.