Using reflection against .net framework for dynamic generation of corelib

Oct 6, 2014 at 7:20 AM
Edited Oct 6, 2014 at 7:27 AM
I was going over the project and I believe it has alot of potential. I think a good idea would be to be to have dynamic generation of the corelib based on the projects dependencies. So that C# native can parse the project and gather the deps and then use reflection against the .net libs to pull the classes and then generate a minimal corelib. I believe this is a great idea so that it can keep the corelib down to a minimal size, and also takes away some of the work from the end user.

I would definitely work on this if I wasn't tied down to a project. I want to do some benchmarks tomorrow. I am working on a project that does real time encoding, and decided to go with Cplusplus for performance reasons and also easy cross platform development. I would like to see the performance comparison. With that said, I think that if a cross compiler could get built using llvm/clang for c# native/il then c# would be my number one cross platform development language. Running C# without the layer of abstraction AND cross platform would be amazing.
Coordinator
Oct 6, 2014 at 1:07 PM
At this moment CoreLib can't be autogenerated as C# native compiler does not support some features (such as reflection) otherwise it would be possible to use mscorlib.dll from Microsoft without any changes and modifications.

Regarding benchmarks. It should be as fast as C++ because the C# native compiler compiles code as C++ does but using C# syntax instead of C++. If benchmarks somewhere slow it means that a redundant code is generated (as it is still in development)
Oct 6, 2014 at 4:14 PM
Thanks for clarifying that. It really is a great project. What do you think it would take to get C# native working cross platform?
Coordinator
Oct 6, 2014 at 5:02 PM
Edited Oct 6, 2014 at 5:03 PM
it is already working for windows, unix(have not tried it but I am sure it is working) and android. But it is in progress. I have found that gc-lib (garbage collector is not working in android and I need to figure out why or write my own GC which I do not want to do.)


could you tell me what have you tried already with C# compiler?
Oct 24, 2014 at 5:16 AM
To gather minimal set of lib, Mono.Linker works quite well.
Coordinator
Oct 25, 2014 at 12:43 PM
I have tried not to use Mono at all.
Coordinator
Oct 25, 2014 at 1:04 PM
JoePage wrote:
Thanks for clarifying that. It really is a great project. What do you think it would take to get C# native working cross platform?
ok, now C# native can compiler compatible code for GC to run on Android. I will update soon the projects
Oct 25, 2014 at 4:31 PM
Small note, in case you didn't know, Mono.Linker is a separate library made by Jb Evain, released under MIT (same guy that did Mono.Cecil).
But I understand if you want to avoid.