View mode: basic / threaded / horizontal-split · Log in · Help
January 22, 2013
Trust about D programming.
Hello Folks.
How are you?
Excuse me, I need a trust about D programming and C, In your 
opinion D can be a replace for C?
Why a user should use D?
Please let me know your opinion.

Thank you.
Cheers.
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 09:27:22 UTC, MMj wrote:
> Hello Folks.
> How are you?
> Excuse me, I need a trust about D programming and C, In your 
> opinion D can be a replace for C?
> Why a user should use D?
> Please let me know your opinion.
>
> Thank you.
> Cheers.

It really depend on what you try to achieve. But in many case it 
is a viable alternative. In other, things need to be ironed out.
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 10:45:27 UTC, deadalnix wrote:
> On Tuesday, 22 January 2013 at 09:27:22 UTC, MMj wrote:
>> Hello Folks.
>> How are you?
>> Excuse me, I need a trust about D programming and C, In your 
>> opinion D can be a replace for C?
>> Why a user should use D?
>> Please let me know your opinion.
>>
>> Thank you.
>> Cheers.
>
> It really depend on what you try to achieve. But in many case 
> it is a viable alternative. In other, things need to be ironed 
> out.

I saw D wiki and understand some goals about but Can you tell me 
why you choose D and not C?
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 11:17:32 UTC, MMj wrote:
> On Tuesday, 22 January 2013 at 10:45:27 UTC, deadalnix wrote:
>> On Tuesday, 22 January 2013 at 09:27:22 UTC, MMj wrote:
>>> Hello Folks.
>>> How are you?
>>> Excuse me, I need a trust about D programming and C, In your 
>>> opinion D can be a replace for C?
>>> Why a user should use D?
>>> Please let me know your opinion.
>>>
>>> Thank you.
>>> Cheers.
>>
>> It really depend on what you try to achieve. But in many case 
>> it is a viable alternative. In other, things need to be ironed 
>> out.
>
> I saw D wiki and understand some goals about but Can you tell 
> me why you choose D and not C?

From my perspective, D cannot replace C in sense "you can throw C 
away". Well, maybe it could theoretically, but not practically.

But the trend is C is becoming more and more a high-level 
assembler. Things like mapping to a register, no hidden costs, 
"you can basically see the assembler when programming in C".

So programming OS kernels and stuff is very practical in C.

I guess C++ could replace C in a sense "you can throw C away" in 
foreseeable future. Because, essentially C++ is a better C than 
C. It might go this way or not, but the potential is good enough.

Things in D are kind of upside down. It places itself close to 
C++, but if C++ looks towards C from that position, D looks 
towards Java/C#. It makes it very appealing for "productive" (in 
Java sense) and "efficient" (in C sense) systems programming. 
E.g. right know, I think D is very compelling for writing a 
server (vibe.d would be a good example).

But for embedded programming I don't think D is a good practical 
choice. C and C++ shines there and I don't think things are 
changing soon.
January 22, 2013
Re: Trust about D programming.
Well I could name slicing and meta programming (templates, traits,
mixins). But in reality it is more the feel of the language. It is easy
to read, (in D I even understand programs written by other people!), it
is powerful. Due to its meta programming techniques it has much of the
power typically only found in dynamically typed languages, but with the
safety and speed of compiled, statically typed language.

Typically when a language becomes powerful, it also becomes complex and
hard to learn, I think D did a really good job in being one of the most
powerful languages out there but still being "easy" to learn and
understand, in particular easy to read. The concepts are sound and well
thought of.

It is fun to use it. 

The down side is, that it is far less mature than C or C++. 

One of the things that convinced me, was slices and the way the GC is
put to good use. Things that make me stick to it, are the meta
programming capabilities, its power and its design.

Best regards,

Robert

On Tue, 2013-01-22 at 12:17 +0100, MMj wrote:
> On Tuesday, 22 January 2013 at 10:45:27 UTC, deadalnix wrote:
> > On Tuesday, 22 January 2013 at 09:27:22 UTC, MMj wrote:
> >> Hello Folks.
> >> How are you?
> >> Excuse me, I need a trust about D programming and C, In your 
> >> opinion D can be a replace for C?
> >> Why a user should use D?
> >> Please let me know your opinion.
> >>
> >> Thank you.
> >> Cheers.
> >
> > It really depend on what you try to achieve. But in many case 
> > it is a viable alternative. In other, things need to be ironed 
> > out.
> 
> I saw D wiki and understand some goals about but Can you tell me 
> why you choose D and not C?
January 22, 2013
Re: Trust about D programming.
On 22 January 2013 11:17, MMj <mohsen1365b@yahoo.com> wrote:

> On Tuesday, 22 January 2013 at 10:45:27 UTC, deadalnix wrote:
>
>> On Tuesday, 22 January 2013 at 09:27:22 UTC, MMj wrote:
>>
>>> Hello Folks.
>>> How are you?
>>> Excuse me, I need a trust about D programming and C, In your opinion D
>>> can be a replace for C?
>>> Why a user should use D?
>>> Please let me know your opinion.
>>>
>>> Thank you.
>>> Cheers.
>>>
>>
>> It really depend on what you try to achieve. But in many case it is a
>> viable alternative. In other, things need to be ironed out.
>>
>
> I saw D wiki and understand some goals about but Can you tell me why you
> choose D and not C?
>

I choose D for safety and speed. :-)

-- 
Iain Buclaw

*(p < e ? p++ : p) = (c & 0x0f) + '0';
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 11:41:14 UTC, Sergei Nosov wrote:
> On Tuesday, 22 January 2013 at 11:17:32 UTC, MMj wrote:
>> On Tuesday, 22 January 2013 at 10:45:27 UTC, deadalnix wrote:
>>> On Tuesday, 22 January 2013 at 09:27:22 UTC, MMj wrote:
>>>> Hello Folks.
>>>> How are you?
>>>> Excuse me, I need a trust about D programming and C, In your 
>>>> opinion D can be a replace for C?
>>>> Why a user should use D?
>>>> Please let me know your opinion.
>>>>
>>>> Thank you.
>>>> Cheers.
>>>
>>> It really depend on what you try to achieve. But in many case 
>>> it is a viable alternative. In other, things need to be 
>>> ironed out.
>>
>> I saw D wiki and understand some goals about but Can you tell 
>> me why you choose D and not C?
>
> From my perspective, D cannot replace C in sense "you can throw 
> C away". Well, maybe it could theoretically, but not 
> practically.
>
> But the trend is C is becoming more and more a high-level 
> assembler. Things like mapping to a register, no hidden costs, 
> "you can basically see the assembler when programming in C".
>

This is only true in very simple processor architectures.

In modern optimizing C compilers targeting modern CPUs, C no 
longer maps to the hardware as much as many C coders still think 
it does.

--
Paulo
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 11:41:14 UTC, Sergei Nosov wrote:
> But for embedded programming I don't think D is a good 
> practical choice. C and C++ shines there and I don't think 
> things are changing soon.

It would be a shame if D would be PC-only... Maybe when GDC will 
be ready things will change - who knows... Apart from the garbage 
collector, which really is not embedded-friendly (I'm talking 
about kilobytes of RAM, not megabytes) everything sounds quite OK 
in the specs (;

4\/3!!
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 13:36:15 UTC, Freddie Chopin wrote:
> On Tuesday, 22 January 2013 at 11:41:14 UTC, Sergei Nosov wrote:
>> But for embedded programming I don't think D is a good 
>> practical choice. C and C++ shines there and I don't think 
>> things are changing soon.
>
> It would be a shame if D would be PC-only... Maybe when GDC 
> will be ready things will change - who knows... Apart from the 
> garbage collector, which really is not embedded-friendly (I'm 
> talking about kilobytes of RAM, not megabytes) everything 
> sounds quite OK in the specs (;
>
> 4\/3!!

What is the problem with gdc ? I used to use it for ages.
January 22, 2013
Re: Trust about D programming.
On Tuesday, 22 January 2013 at 13:37:38 UTC, deadalnix wrote:
> What is the problem with gdc ? I used to use it for ages.

Have you tried compiling it for something like bare-metal ARM 
(arm-none-eabi target)? Check the thread about embedded D in the 
GDC (D.GNU) forum to see what problems exist when you want to 
compile that for an OS-less target that doesn't provide hundreds 
of POSIX functions.

Do note that embedded does not mean "smartphone with Android".

When GDC will be part of GCC a proper support for other platforms 
will probably appear, not only for PC with Windows/Linux/MacOS.

4\/3!!
« First   ‹ Prev
1 2 3 4
Top | Discussion index | About this forum | D home