Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
December 18, 2014 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 |
December 18, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | 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) |
December 19, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | On Thursday, 18 December 2014 at 23:56:54 UTC, 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
Nice Work!
|
December 19, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | 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. -- /Jacob Carlborg |
December 19, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | 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.
|
December 19, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | On Thursday, 18 December 2014 at 23:58:30 UTC, Ronald Adonyo wrote:
> This is the Current Feature List
>
> ...
Looks intriguing :)
|
December 19, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | On Friday, 19 December 2014 at 08:11:42 UTC, Ronald Adonyo wrote:
> Done, does anyone have a good idea of how to write Async/Await using fibers or state machines in D ?
Same as in .net, look at the generated IL, an async method should return a chain of tasks.
|
December 20, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | Well done! I also thought of making a C# to D compiler using Roslyn, so I'm glad to see fruits of your labour :)
On Thursday, 18 December 2014 at 23:58:30 UTC, Ronald Adonyo wrote:
> This is the Current Feature List
|
December 20, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | On Thursday, 18 December 2014 at 23:56:54 UTC, 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
Nice work.
|
December 21, 2014 Re: C# to D Compiler :) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ronald Adonyo | On Thursday, 18 December 2014 at 23:56:54 UTC, 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
If use the .Net Framework 4.0,it's will better than now,a lot of people will test it,but v4.5.3,maybe a little.
|
Copyright © 1999-2021 by the D Language Foundation