Indeed I was - I'm quite sorry for the confusion, I didn't make my intent clear
as I should have, such as through example. What I'm referring to is, for
instance, offering a way for a Ruby library to interface with a module written
in Swift to communicate with Redis (as an example, not
On 12/23/15, Thomas Catterall via swift-users wrote:
> Indeed I was - I'm quite sorry for the confusion, I didn't make my intent
> clear as I should have, such as through example. What I'm referring to is,
> for instance, offering a way for a Ruby library to interface with
I think the OP was asking not about importing C symbols into Swift but
rather exporting Swift to C.
On Wed, 23 Dec 2015 at 15:18 Brent Royal-Gordon via swift-users <
swift-users@swift.org> wrote:
> > What are the current facilities planned or in development for FFI? Just
> as Swift functions can
> What are the current facilities planned or in development for FFI? Just as
> Swift functions can be exposed through @objc, how would I add a similar
> capability for pure C? Is this what, in fact, module maps might be for?
>
> I ask since writing high performance native code for dynamic
On Wed, Dec 23, 2015 at 8:30 AM, swizzlr via swift-users <
swift-users@swift.org> wrote:
> It would be great for Swift if people started writing native bindings in
> it as opposed to C, but...
>
No buts. It's started already. For example, here's my Mac and Linux OpenGL
loader that's 100% pure
> Option 2. Use this syntax and swift-demangle to figure out the symbols:
>
> public var badfood:@convention(c)(Int) -> Void = { (i:Int) in
> print(i)
> }
There's an @asmname("foo") directive which can override name mangling, but I
don't know how useful it is in practice for this kind of
Option 1. Export your Swift to Obj-C. Write Obj-C that exports C. Compile
to a library.
Option 2. Use this syntax and swift-demangle to figure out the symbols:
public var badfood:@convention(c)(Int) -> Void = { (i:Int) in
print(i)
}
-david
On 12/23/15, Thomas Catterall via swift-users