Jump to page: 1 2
Thread overview
Is D so powerfull ??
Nov 07, 2015
BSaidus
Nov 07, 2015
Daniel Kozak
Nov 07, 2015
BSaidus
Nov 07, 2015
ZombineDev
Nov 07, 2015
ZombineDev
Nov 07, 2015
Jeremy DeHaan
Nov 08, 2015
ZombineDev
Nov 09, 2015
Jeremy DeHaan
Nov 09, 2015
Daniel Murphy
Nov 09, 2015
Jeremy DeHaan
Nov 09, 2015
Daniel Murphy
Nov 09, 2015
Jeremy DeHaan
Nov 09, 2015
Jeremy DeHaan
Nov 09, 2015
Daniel Murphy
Nov 08, 2015
FreeSlave
Nov 08, 2015
TheFlyingFiddle
Nov 08, 2015
David Nadlinger
Nov 07, 2015
Gary Willoughby
November 07, 2015
Hello!
I've heard about Dlang 2 years ago, and I discovered it about 3 days.
So
  * I wonder if it is so powerfull as C ?
  * Is it portable (crosse plateform) ?
  * Can I do anything with it ?
Excuse me for for these questionsn i'm a begginer.
  It seems that I begin like it so, reconforte me please !!

Thanks.
November 07, 2015
Dne 7. 11. 2015 13:50 napsal uživatel "BSaidus via Digitalmars-d" < digitalmars-d@puremagic.com>:
>
> Hello!
> I've heard about Dlang 2 years ago, and I discovered it about 3 days.
> So
>   * I wonder if it is so powerfull as C ?

Yes

>   * Is it portable (crosse plateform) ?

Yes
>   * Can I do anything with it ?

Yes :)

> Excuse me for for these questionsn i'm a begginer.
>   It seems that I begin like it so, reconforte me please !!
>
> Thanks.


November 07, 2015
On Saturday, 7 November 2015 at 13:01:33 UTC, Daniel Kozak wrote:
> Dne 7. 11. 2015 13:50 napsal uživatel "BSaidus via Digitalmars-d" < digitalmars-d@puremagic.com>:
>>
>> Hello!
>> I've heard about Dlang 2 years ago, and I discovered it about 3 days.
>> So
>>   * I wonder if it is so powerfull as C ?
>
> Yes
>
>>   * Is it portable (crosse plateform) ?
>
> Yes
>>   * Can I do anything with it ?
>
> Yes :)
>
>> Excuse me for for these questionsn i'm a begginer.
>>   It seems that I begin like it so, reconforte me please !!
>>
>> Thanks.

Waw !!
I'm happy for the speed of response,
Communauty so active !
THanks !
November 07, 2015
On Saturday, 7 November 2015 at 12:49:18 UTC, BSaidus wrote:
> Hello!
> I've heard about Dlang 2 years ago, and I discovered it about 3 days.
> So
>   * I wonder if it is so powerfull as C ?
>   * Is it portable (crosse plateform) ?
>   * Can I do anything with it ?
> Excuse me for for these questionsn i'm a begginer.
>   It seems that I begin like it so, reconforte me please !!
>
> Thanks.

D is very well supported on the major desktop platforms (Windows, Linux, OSX, FreeBSD) and there's currently work in progress to bring D to mobile (iOS and Android). Apart from the reference DMD compiler, there are two other compilers that share the same frontend, but use GCC's and LLVM's backend (GDC and LDC respectively). There is work being done on those compilers to extend D's reach to the support of their C++ counterparts (e.g. embedded ARM, MIPS, etc.).

Because D's builtin types have fixed size (unlike the varying size of e.g. C's int and long on various platforms), its ABI is more easier to work with. D's very strong support for conditional compilation makes abstracting platform specific code easier than in C++.

You can do in D anything that you can in C, so D is at least as powerful as C is.
Actually, the D is much more powerful than C, because the support for this style of programming is only a small part of D.

C procedural system programming (pointer arithmetic, void*, function pointers, malloc, realloc, alloca, free, unions, alignment control, static and dynamic linking with C programs and libraries, system calls, etc.) Using these features, some assembly bootstrap and a linker script you can make a bare-bones micro kernel.

Java/C# style object-oriented programming (interfaces, classes (reference types), polymorphism, encapsulation, run-time type information, nested/inner classes, anonymous classes, exceptions, GC, etc.) Using these features you can develop any library or application that would typically be written in Java / C#.

C++ style programming (structs (value types), RAII, operator overloading, low-perf cost thin abstractions, const, templates, containers, allocators, smart pointers, similar to STL algorithms, nothrow, nogc, etc)

Functional programming (immutability, purity, lambda/anonymous/nested functions, tuples, lazy algorithms, function pipelining with UFCS, etc)
http://klickverbot.at/blog/2012/05/purity-in-d/
http://dlang.org/phobos/std_functional.html
http://blog.thecybershadow.net/2014/03/21/functional-image-processing-in-d/
http://wiki.dlang.org/Component_programming_with_ranges
http://www.mmartins.me/view/2015/09/27/vector-swizzle-in-d

Design by contract: http://dlang.org/contracts.html

Metaprogramming, Compile-time function execution (CTFE): I don't know if there's a definite tutorial specifically on one D's strongest features, but here's some links to check:
dlang.org/phobos/std_traits
dlang.org/phobos/std_typecons
https://www.youtube.com/watch?v=mCrVYYlFTrA - Desing by introspection
https://www.youtube.com/watch?v=SqeOPLB2xAM - Declarative programming in D
https://www.youtube.com/watch?v=xpImt14KTdc - Simplifying Code With Compile-Time Reflection

If you are looking for a more complete overview of D's features, you can check this feature comparison page: http://dlang.org/comparison.html

What standard C does not provide and D does: calling C++ free functions nested in namespaces, creating objects of C++ classes (with single inheritance)

November 07, 2015
On Saturday, 7 November 2015 at 14:25:01 UTC, ZombineDev wrote:
>
> What standard C does not provide and D does: calling C++ free functions nested in namespaces, creating objects of C++ classes (with single inheritance), ...
... calling virtual and non-virtual methods on C++ classes from D, calling from C++ on D classes, Objective-C support, ... basically you don't have technical reasons not to use D :D

You can find more information on interoperability and low-level control here:
Interfacing C: http://dlang.org/interfaceToC.html
Interfacing C++: http://dlang.org/cpp_interface.html
Interfacing Objective-C: http://dlang.org/objc_interface.html

D ABI: http://dlang.org/abi.html
D inline assembly: http://dlang.org/iasm.html,
D vector extentions (SIMD): http://dlang.org/simd.html

GDC - GCC specific assembly and intrinsics:
http://wiki.dlang.org/GDC/Using_GDC#Extensions

LDC - LLVM specific assembly and intrinsics:
http://wiki.dlang.org/LDC_inline_assembly_expressions
http://wiki.dlang.org/LDC-specific_language_changes

November 07, 2015
On Saturday, 7 November 2015 at 12:49:18 UTC, BSaidus wrote:
> Excuse me for for these questionsn i'm a begginer.
>   It seems that I begin like it so, reconforte me please !!
>
> Thanks.

If you have anymore questions while learning D please visit our dedicated newsgroup/forum for learning:

http://forum.dlang.org/group/learn
November 07, 2015
On Saturday, 7 November 2015 at 14:49:05 UTC, ZombineDev wrote:
> On Saturday, 7 November 2015 at 14:25:01 UTC, ZombineDev wrote:
>>
>> What standard C does not provide and D does: calling C++ free functions nested in namespaces, creating objects of C++ classes (with single inheritance), ...
> ... calling virtual and non-virtual methods on C++ classes from D

Actually, you can only call virtual methods on classes. Using non-virtual methods isn't supported.

November 08, 2015
On Saturday, 7 November 2015 at 14:49:05 UTC, ZombineDev wrote:
> basically you don't have technical reasons not to use D :D

What about the lack of proper support for dynamic libraries on Windows and OSX? I mean, GC merging is still not implemented, right?

November 08, 2015
On Sunday, 8 November 2015 at 10:22:44 UTC, FreeSlave wrote:
> On Saturday, 7 November 2015 at 14:49:05 UTC, ZombineDev wrote:
>> basically you don't have technical reasons not to use D :D
>
> What about the lack of proper support for dynamic libraries on Windows and OSX? I mean, GC merging is still not implemented, right?

Pretty sure gc merging is done via the gc proxy in dlls/shared libraries. But there are lot's of other problems. Mainly that Phobos cannot be dynamically loaded (or is this fixed?) Last time i tried throwing exceptions did not work either. Also the export problems on windows have not really been fixed (see http://wiki.dlang.org/DIP45). Still I have used DLL's sucessfully for reloading plugins, it can be done but it's really a pain to use as it stands now.
November 08, 2015
On Sunday, 8 November 2015 at 17:51:34 UTC, TheFlyingFiddle wrote:
> Pretty sure gc merging is done via the gc proxy in dlls/shared libraries.

In the case of Linux/FreeBSD shared libraries, there is no merging to be done, as only one copy of the GC exists in the first place (we only support shared libraries when druntime is built as a shared library itself).

 — David
« First   ‹ Prev
1 2