Re: [swift-users] C/FFI interop

2015-12-23 Thread Brent Royal-Gordon via swift-users
> 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 thi

Re: [swift-users] SwiftShims error thrown while trying to use Swift's REPL

2015-12-23 Thread Projjol Banerji via swift-users
My installation was currently in ~ , I checked to see if keeping it /home/ worked but that did not work either. Any idea why it is looking why it is looking for this module? On Thu, Dec 24, 2015 at 4:23 AM, Jason Dusek wrote: > The relevant bit is in there: > > open("/home/dorsatum/swift/usr/lib

Re: [swift-users] C/FFI interop

2015-12-23 Thread David Turnbull via swift-users
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 w

Re: [swift-users] C/FFI interop

2015-12-23 Thread Eric Wing via swift-users
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 a module > written in Sw

Re: [swift-users] error: value of type 'Self.SubSequence' has no member 'Distance'

2015-12-23 Thread Dmitri Gribenko via swift-users
On Wed, Dec 23, 2015 at 3:24 PM, Daniel Eggert via swift-users wrote: > I have an array of String and need to call withCString on each one and then > pass the resulting array of UnsafePointer to a C api. The unsafe > pointer is only valid within the scope of withCString. > > So I built the follo

Re: [swift-users] C/FFI interop

2015-12-23 Thread Thomas Catterall via swift-users
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 something

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Chris Lattner via swift-users
> On Dec 23, 2015, at 10:42 AM, Dan Stenmark > wrote: > > What’s the target timeline looking like for a complete GCD implementation? > The GitHub page explicitly states that we’re aiming for Foundation to have a > complete implementation by Swift 3, but there’s no milestone information for

[swift-users] Failed to resolve REPL breakpoint

2015-12-23 Thread Ryan Lovelett via swift-users
I have compiled from the latest Swift source and built a package for my system using the install to destination. However, after installing the package and running `swift` to test the REPL it dies with the following error: `error: failed to resolve REPL breakpoint for 'repl_main'`. Not really sure

Re: [swift-users] C/FFI interop

2015-12-23 Thread Jason Dusek via swift-users
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

Re: [swift-users] C vararg: Swift Package Manager and System Modules

2015-12-23 Thread Daniel Eggert via swift-users
On 18 Dec 2015, at 20:42, Chris Lattner wrote: > > >> On Dec 17, 2015, at 1:47 PM, Daniel Eggert via swift-users >> wrote: >> >> If I need access to the C fcntl(2): >> >> int fcntl(int, int, ...) >> >> can I get the swift-package-manager or swift-build-tool to compile C code >> that wraps

[swift-users] error: value of type 'Self.SubSequence' has no member 'Distance'

2015-12-23 Thread Daniel Eggert via swift-users
I have an array of String and need to call withCString on each one and then pass the resulting array of UnsafePointer to a C api. The unsafe pointer is only valid within the scope of withCString. So I built the following, but the compiler doesn’t like it: % swift scopedReduceAndApply.swift sco

Re: [swift-users] C/FFI interop

2015-12-23 Thread Brent Royal-Gordon via swift-users
> 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 langua

Re: [swift-users] SwiftShims error thrown while trying to use Swift's REPL

2015-12-23 Thread Jason Dusek via swift-users
The relevant bit is in there: open("/home/dorsatum/swift/usr/lib/swift/linux/x86_64/SwiftShims.swiftmodule", O_RDONLY) = -1 ENOENT (No such file or directory) I am not sure what it should be loading but this file does not exist in the distribution so I wonder why it is searching for it. I had the

Re: [swift-users] C/FFI interop

2015-12-23 Thread David Turnbull via swift-users
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 swi

[swift-users] New Swift 2.2 Toolchain snapshot - Dec 22, 2015

2015-12-23 Thread Mishal Shah via swift-users
New Swift 2.2 snapshot available! Download new packages from https://swift.org/download/ Following repository are tagged with swift-2.2-SNAPSHOT-2015-12-22-a https://github.com/apple/swift https://

Re: [swift-users] WARNING: Title underline too short

2015-12-23 Thread Joe Groff via swift-users
Snapshots and HEAD should always build cleanly on all supported platforms, so we ought to fix this. It may be that our buildbots don't have sphinx installed, so the docs aren't getting checked there. Disabling sphinx in your build config should work around it in the meantime. -Joe > On Dec 23,

Re: [swift-users] problems with simple binary-trees program

2015-12-23 Thread Michael Gottesman via swift-users
> On Dec 23, 2015, at 11:32 AM, Pascal Urban wrote: > >> >> On 22.12.2015, at 21:40, Michael Gottesman > > wrote: >> >> >>> On Dec 22, 2015, at 2:31 PM, Pascal Urban via swift-users >>> mailto:swift-users@swift.org>> wrote: >>> On 20.12.2015, at 19:54

Re: [swift-users] _swift_abortRetainUnowned when capturing @objc class as unowned

2015-12-23 Thread Michael Gottesman via swift-users
> On Dec 23, 2015, at 6:31 AM, Tadeas Kriz via swift-users > wrote: > > Hey, > > I am experiencing this strange crashing when capturing an instance of a @objc > class (written in swift, but annotated with @objc and subclass of NSObject). > It happens when the closure is being assigned and no

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Dan Stenmark via swift-users
What’s the target timeline looking like for a complete GCD implementation? The GitHub page explicitly states that we’re aiming for Foundation to have a complete implementation by Swift 3, but there’s no milestone information for GCD. (I’m hacking away at NSTask right now, and I keep getting re

Re: [swift-users] More Swift-like initializers and enums in UIKit

2015-12-23 Thread Nick O'Neill via swift-users
Thanks for the feedback Jens, I understand the concept of deriving the Swift API from the Objective-C headers (nullability annotations and all...) but I was under the impression that some of the more Swifty initializers were accomplished with convenience initializers in small extensions written in

Re: [swift-users] More Swift-like initializers and enums in UIKit

2015-12-23 Thread Jens Alfke via swift-users
> On Dec 23, 2015, at 9:03 AM, Nick O'Neill via swift-users > wrote: > > Did I miss a spot where I can submit a PR for this or is there a chance the > Swift headers for these UIKit APIs could be made open source in the future? As with all things Apple that aren’t open source, the answer is “g

Re: [swift-users] problems with simple binary-trees program

2015-12-23 Thread Pascal Urban via swift-users
> On 22.12.2015, at 21:40, Michael Gottesman wrote: > > >> On Dec 22, 2015, at 2:31 PM, Pascal Urban via swift-users >> mailto:swift-users@swift.org>> wrote: >> >>> >>> On 20.12.2015, at 19:54, Maurus Kühne via swift-users >>> mailto:swift-users@swift.org>> wrote: >>> >> … >>> I was able t

[swift-users] More Swift-like initializers and enums in UIKit

2015-12-23 Thread Nick O'Neill via swift-users
I've been using `UIViewControllerAnimatedTransitioning` recently and the associated APIs are usable but decidedly not very Swifty. Lots of the main UIKit APIs got a Swift makeover as we've progressed through releases but there are still a few such as this one that could use some touching up. I woul

Re: [swift-users] scientific library for swift?

2015-12-23 Thread Tino Heth via swift-users
> Please NO. Templates are the worst idea ever to evolve from C++. Never let > this madness enter into Swift, it has done enough damage in the C++ world > already. Hey, templates are cool — they are even Turing complete! ;-) No, I really don't think it's that useful to calculate Fibunacci-number

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Chris Lattner via swift-users
> On Dec 23, 2015, at 8:22 AM, Joshua Scott Emmons via swift-users > wrote: > > >> On Dec 23, 2015, at 10:06 AM, Isaac Gouy via swift-users >> wrote: >> >> afaict the Swift concurrency story on Apple platforms has been GCD. >> >> What's going to be the Swift concurrency story on Linux? >

[swift-users] C/FFI interop

2015-12-23 Thread swizzlr via swift-users
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 languages is cu

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Joshua Scott Emmons via swift-users
> On Dec 23, 2015, at 10:06 AM, Isaac Gouy via swift-users > wrote: > > afaict the Swift concurrency story on Apple platforms has been GCD. > > What's going to be the Swift concurrency story on Linux? According to Swift.org (https://swift.org/blog/swift-linux-port/), I think GCD (aka libdis

[swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Isaac Gouy via swift-users
afaict the Swift concurrency story on Apple platforms has been GCD. What's going to be the Swift concurrency story on Linux? ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users

Re: [swift-users] scientific library for swift?

2015-12-23 Thread Jan Neumüller via swift-users
> On 23.12.2015, at 12:34, Tino Heth via swift-users > wrote: > > >> Of course, duh. I'm interested in what you end up using, as scientific >> computing seems to me like a great use case for Swift. > imho there is one thing missing to make this a true statement: >

Re: [swift-users] How to define interdependent modules in a package?

2015-12-23 Thread Pierre Monod-Broca via swift-users
here is link with more explanation : https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#module-interdependency-determination -- Pierre > Le 23 déc. 2015 à 14:50, Pierre Monod-Broca a écrit : > > It would be too costly to do that on each

Re: [swift-users] How to define interdependent modules in a package?

2015-12-23 Thread Pierre Monod-Broca via swift-users
It would be too costly to do that on each build, among other issues. So you do have to add all imported stuff as dependencies. If I recall correctly, SPM is planned to have an option to either list you all your imports so you can populate your dependencies, or edit the package manifest itself t

[swift-users] _swift_abortRetainUnowned when capturing @objc class as unowned

2015-12-23 Thread Tadeas Kriz via swift-users
Hey, I am experiencing this strange crashing when capturing an instance of a @objc class (written in swift, but annotated with @objc and subclass of NSObject). It happens when the closure is being assigned and not when called, so the problem is not that the captured value would get deallocated and

Re: [swift-users] scientific library for swift?

2015-12-23 Thread Tino Heth via swift-users
> Of course, duh. I'm interested in what you end up using, as scientific > computing seems to me like a great use case for Swift. imho there is one thing missing to make this a true statement: Fixed size vectors and matrices to do typesafe calculations (the compiler can't warn you when you try t

Re: [swift-users] SwiftShims error thrown while trying to use Swift's REPL

2015-12-23 Thread Projjol Banerji via swift-users
This contains a part of the strace output. The entire output is quite large ~ 7k LoC, Would that be required? On Wed, Dec 23, 2015 at 2:52 PM, Jason Dusek wrote: > It would be helpful if you provided strace output. > > On Wed, 23 Dec 2015 at 01:09 Projjol B

[swift-users] WARNING: Title underline too short

2015-12-23 Thread Drew Crawford via swift-users
So I'm trying to build swift-2.2-SNAPSHOT-2015-12-18-a. OSX: 10.11.2 (15C50), Xcode: Version 7.2 (7C68), CMake: 3.4.1, ninja: 1.6.0 $ git show head commit 0ddf238ad7209fed3b89c0b2300f88d9d3dfb5d0 $ ./utils/build-script -t ...snip... FAILED: cd /Users/drew/Code/swift-devel/swift/docs && /Librar

Re: [swift-users] SwiftShims error thrown while trying to use Swift's REPL

2015-12-23 Thread Jason Dusek via swift-users
It would be helpful if you provided strace output. On Wed, 23 Dec 2015 at 01:09 Projjol Banerji via swift-users swift-users@swift.org wrote: Hey, > I recently upgraded to Ubuntu 14.04 in order to try Swift out. I've > followed all the instructions given in th

[swift-users] SwiftShims error thrown while trying to use Swift's REPL

2015-12-23 Thread Projjol Banerji via swift-users
Hey, I recently upgraded to Ubuntu 14.04 in order to try Swift out. I've followed all the instructions given in the installation page (For the 18 December build) , but on trying a simple addition on the Swift REPL, it throws an "opening import file for module 'SwiftShims': No such file or directory