... | ... | @@ -21,6 +21,14 @@ Option (1) has the disadvantage that all class initialisation code needs to be e |
|
|
|
|
|
We require the programmer to supply headers for all Objective-C classes implemented in Haskell. This enables the Objective-C compiler to do type checking and enables Interface Builder to recognises properties used as outlets.
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
|
Following the structure of the C FFI, the basic Objective-C FFI has two major components: (1) an extension of the Haskell language by new forms of `foreign` declarations and (2) a standard library. The C FFI uses the `ccall` (and `stdcall`) calling convention for `foreign` declarations, whereas Objective-C uses the new `objc` calling convention. The C-specific FFI library is `Foreign.C` (aka `CForeign`) and, for Objective-C, we use `Foreign.ObjectiveC`.
|
|
|
|
|
|
|
|
|
In addition to the low-level FFI, higher-level libraries and tools may provide more convenient APIs. In particular, the basic FFI makes no attempt to model Objective-C's class hierarchy and overloading of selectors in Haskell's type system. This is the responsibility of higher-level libraries.
|
|
|
|
|
|
## Subtopics
|
|
|
|
|
|
|
... | ... | @@ -31,11 +39,14 @@ We discuss the following subtopics on separate pages: |
|
|
- \[ObjectiveC/Classes Objective-C classes\]
|
|
|
- \[ObjectiveC/Naming Naming conventions\] (they are not enforced, but recommended)
|
|
|
- \[ObjectiveC/MemoryManagement Memory management\]
|
|
|
- `Foreign.ObjectiveC`
|
|
|
|
|
|
## Related work
|
|
|
|
|
|
## Background and related work
|
|
|
|
|
|
Chicken scheme objc egg: [ http://chicken.wiki.br/objc](http://chicken.wiki.br/objc)
|
|
|
- [ The Haskell 98 Foreign Function Interface 1.0](http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffi.html)
|
|
|
- [ Objective-C 2.0 Runtime Programming Guide](https://developer.apple.com/documentation/Cocoa/Conceptual/ObjCRuntimeGuide/Introduction/chapter_1_section_1.html)
|
|
|
- [ Objective-C 2.0 Runtime Reference](https://developer.apple.com/documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html)
|
|
|
- [ Chicken scheme objc egg](http://chicken.wiki.br/objc)
|
|
|
|
|
|
## Development team
|
|
|
|
... | ... | |