compilation - How would a closed-source (i.e. precompiled) Swift library work without headers? -


in c, c++ , objective-c can compile part of executable own "object file" , use (and/or library containing multiple object files) other code including "header file". highly-templatized c++ code notwithstanding, "header" typically contains declarations needed validate correctness of calling code (and assist ide autocomplete, etc.).

but swift not have header files.

now, apparently not possible make swift static library, in future how situation above work, wanting use existing precompiled code "new" source code, given swift not have headers?

would work how [i infer] java must work, compiled form can introspected enough compiler verify being used properly? bitcode in addition intermediate representation provide necessary "protocol" retaining such metadata?

if apple port cocoa swift (and keep closed source), how "imported" swift apps?

although, really, question not "closed source" per se rather trying understand boundaries around compilation units in swift. based on similar question go language, mine here re-phrased as: can link pre-compiled swift library without source?

well, consider apple's swift libraries. closed-source, , can use them fine , can see pseudo-"headers" stuff in library in compiler. exact mechanism of how works not publicly documented, must exist.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -