Filling out the wiki - D as a second language

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 1 02:47:57 PDT 2015


On Tuesday, 31 March 2015 at 22:25:29 UTC, rumbu wrote:
> I started some C# to D stuff here: 
> https://github.com/rumbu13/sharp/blob/master/cstod.md

Forgot semicolon in hello world example.

> Anyway, I'm already asking for help from experienced D users to 
> translate the following concepts in D:
>
> - decimal type
I heard, there was an implementation of a scaled integer and a 
rational type.
> - dynamic types
No exact equivalent, opDispatch is similar, but is compile-time.
> - volatile
atomicLoad, atomicStore
> - boxing/unboxing
Variant
> - multicast delegates
> - events
std.signals (needs rewrite)
> - yield return
input/output ranges
> - P/Invoke
Not really needed for native languages, because they interface 
with the platform directly. Well, there are utilities like 
tempCString.
> - async/await
vibe addresses the same problem 
http://code.dlang.org/packages/vibe-d
> - linq
std.algorithm, std.range, std.array
> - runtime reflection
Nothing builtin, D relies more on compile-time reflection.
> - serialization
http://wiki.dlang.org/Libraries_and_Frameworks#Serialization
> - inlining
only http://wiki.dlang.org/DIP56
> - weak references
To be implemented in druntime
> - implicit casting overload
Not supported deliberately, as I understand it
> - COM imports
There was some attempt at COM integration, not sure how far it 
has gone. AFAIK, COM can expose interface as IDispatch, that 
would save one from parsing the type library manually.
> - templated functions override
Done by redirecting templated function to non-templated one.
> I'm not asking for solutions (because I know how to implement 
> them in D), I'm asking for guidance about the best D semantics 
> to be used instead.
Do things at compile time, allocate as little as possible, in 
other words, be efficient.


More information about the Digitalmars-d mailing list