Re: C# to D Compiler :)
On Friday, 19 December 2014 at 07:39:24 UTC, Jacob Carlborg wrote: On 2014-12-19 00:56, Ronald Adonyo wrote: Hi Everyone, In my spare time over the last 3 weeks, I've been working on a C# to D Compiler based on Roslyn. Please check it out and give comments. I would also like this to be a basis to provide both Libraries in D and allow building native C# applications with the help of D. Its available on my github https://github.com/afrogeek/SharpNative This is pretty cool. When the tool is good enough, then you can run the tool the Roslyn compiler and on itself. Then you'll have a C# compiler and a tool to translate from C# to D, written in D :) BTW, you should add .DS_Store to .gitignore. Thanks, Jacob and Stefan, Done, does anyone have a good idea of how to write Async/Await using fibers or state machines in D ? I have yield return working, and would like to have both these as lambdas passed to library functions. Regards, Ron.
C# to D Compiler :)
Hi Everyone, In my spare time over the last 3 weeks, I've been working on a C# to D Compiler based on Roslyn. Please check it out and give comments. I would also like this to be a basis to provide both Libraries in D and allow building native C# applications with the help of D. Its available on my github https://github.com/afrogeek/SharpNative
Re: C# to D Compiler :)
This is the Current Feature List Basic PInvoke Arrays including initializers Fields/ Properties/Methods with correct hiding semantics Properties are better implemented String Int/Double/Bool Classes and Polymorphism … we follow C# model Some benchmarks - basic linpack, fannkuch, nbody Modules/Namespaces Enum - no enum.Parse support yet though Iterators are as .Net use enumerators etc … switching arrays to use simple for loop though for performance improvement Constructors/Overloads/Base Class calls Static Variables/Members/Properties Basic System.Math, more implementations required though Extension Methods Operator Overloading Indexers Anonymous Classes Generics … All current test cases work Boxed structs and interface casting for them Inner Classes in the form of OuterClass_InnerClass Static Constructors Explicit Interfaces … current fix is not so pretty though … i.e. IEnumerator.MoveNext becomes IEnumerator.IEnumerator_MoveNext (this allows implementing methods with same name, differently) Implicit and Explicit Cast Operators String switch … dlang supports this natively :) String.Format .. though implementation is very basic C# multi dimensional arrays work correctly (even with multi dim syntax :) )… mostly … look at multi test from CrossNet Delegates work including multicast (Native delegates through P/Invoke work too) Events work as expected … though a bit slower than C#(mono)