LADSoft / OrangeC

OrangeC Compiler And Tool Chain
http://ladsoft.tripod.com/orange_c_compiler.html
Other
284 stars 39 forks source link

Update OCCIL to work with .NET Core? #966

Closed ghost closed 2 months ago

LADSoft commented 8 months ago

I don't know enough about the internals of .net core to know at this point. It was designed several years ago for .net framework. Changing this issue to be a development issue as I need to investigate the switchover as framework is on the way out...

jkoplo commented 3 months ago

I'd be interested in any progress here. I help maintain an open source dotnet wrapper around a C library and the amount of hoops we jump through to support multiple targets and link to the right C DLL is really painful.

LADSoft commented 3 months ago

thank you for your interest... I had forgotten about this lol. I will make time later this week to at least evaluate and see what is involved :smile:

LADSoft commented 2 months ago

so i finally looked at this. There are three aspects to it:

figuring out where the .net dlls are stored so i can link to them generating the libraries generating???? the executables

in .net core it seems like everything is libraries, and the executables are just some kind of stub to launch the application library... from what I can gather... so the code generation aspect of this seems easy. It is going to be a little harder to figure out where microsoft has hidden away the system dlls.... and im not sure at all about the executable files as they seem to be 64 bit programs (not written in .net) whose only purpose in life is probably to set up an appropriate environment to run the application dll. if any one has any ideas about how any of this works please share, meanwhile, I'll cycle back to it after i get further with the c++17 project

jkoplo commented 2 months ago

Would it simplify things to just generate a .net core library from a c library and not a full executable? That would be useful for a lot of shared libraries that are all wrapped today in .net - sqlite being a huge one.

Also, with core being open source and compilable on Linux, the generation process should be documented somewhere.

LADSoft commented 2 months ago

yeah making a library is the easy part lol... it is all the other stuff that gets somewhat involved. But after your comment i thought to look for the .net runtime, and found it here on github. I should be able to get some ideas from that.... i will take a look later this week....

LADSoft commented 2 months ago

so i wrote another issue in a different repository to deal with most of the work for this issue: https://github.com/LADSoft/DotNetPELib/issues/3

this issue also remains open as there will be additional work in occil to wrap the new functionality.

LADSoft commented 2 months ago

I got dotnetpelib to generate .Net Core programs last weekend, then spent the week fixing all the compiler bugs that wouldn't let OCC compile the new code. Right now I've finished adding the new support to OCCIL but there are problems with things that were in MSCORLIB.DLL not being in the trimmed down SYSTEM.RUNTIME.DLL.... I have to make a workaround for System.Object next.

Hoping to finish this this weekend....

LADSoft commented 2 months ago

so i got through this, occil generates .netcore programs now. There is some problem with the automated tests probably for occil which I will look at tonite.