compiler-explorer / compiler-explorer

Run compilers interactively from your web browser and interact with the assembly
https://godbolt.org/
BSD 2-Clause "Simplified" License
15.93k stars 1.7k forks source link

Objective-C has no foundation library #1544

Open mattgodbolt opened 5 years ago

mattgodbolt commented 5 years ago

Received over email:

I've noticed that https://godbolt.org supports -ObjC and -ObjC++ flags for CLang compiler, but there no Foundation library included like Swift has, I've tried to include via

import and module @import no success. Without it -ObjC flags almost

useless unfortunately. So I'm asking, is it possible to include that module?

Have asked for help from the OP.

Liastre commented 5 years ago

Hello @mattgodbolt thanks for reply, I'm author of letter. I believe all we need is to add apple Foundation headers and precompiled lib on server side :)

Actual error you got when trying to import foundation is <source>:1:9: fatal error: 'Foundation/Foundation.h' file not found, If you have Foundation framework loaded on server, this answer must be helpful https://stackoverflow.com/a/16387905

3d4m-volodymyr commented 5 years ago

This is not easy job, but can be done, thanks to number of open source projects. Apple has open sourced ObjC, CoreFoundation lite and dispatch library (GDC), those libraries has system dependencies. To get Foundation part, apportable's implementation can be used, which is actually implemented very close to original iOS Foundation. For great surprise this all done with Darling project. They already reuse original ObjC, CF and apportable's Foundation. I believe that it can be stripped down to required minimum.

partouf commented 5 years ago

I wonder if we should add Objective-C as a separate language, would be easier to tailor these kind of things into it. But since you can mix in C++, that would mean we'd have to add and maintain all the other libraries as well.

fabianfreyer commented 4 years ago

Maybe including gnustep may be enough?

MosheBerman commented 2 years ago

Is this still complex?