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

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

[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

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

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 >>>

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 >> > wrote: >> >>> >>> On 20.12.2015, at 19:54, Maurus Kühne via swift-users >>>

[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 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

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

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] 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

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

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

[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

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

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

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: > >

[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

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

[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