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

2015-12-18 Thread Chris Lattner via swift-users
> 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 this into a non-vararg version: Hi

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread Janosch Hildebrand via swift-users
> On 19 Dec 2015, at 00:46, Michael Gottesman via swift-users > wrote: >> >> This is becoming clear. Hopefully these patterns can be optimized across >> modules eventually. It's easy enough to write a pre-processor that expands >> the generics into four

[swift-users] Fwd: Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread David Turnbull via swift-users
On Fri, Dec 18, 2015 at 1:36 PM, Joe Groff wrote: > Do you have the optimizer enabled (using -O)? I see inlining happening as > you'd expect. > Thanks for looking at this. Nobody else here who can check my work. Last time I tested not-as-a-module it wasn't inlining. Perhaps

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread Joe Groff via swift-users
> On Dec 18, 2015, at 3:13 PM, David Turnbull via swift-users > wrote: > > On Fri, Dec 18, 2015 at 2:31 PM, Janosch Hildebrand via swift-users > > wrote: > You will also want to have this code in the same module that

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread Michael Gottesman via swift-users
> On Dec 18, 2015, at 5:13 PM, David Turnbull via swift-users > wrote: > > On Fri, Dec 18, 2015 at 2:31 PM, Janosch Hildebrand via swift-users > > wrote: > You will also want to have this code in the same module that

Re: [swift-users] Need better name, want to hide generator

2015-12-18 Thread Jacob Bandes-Storch via swift-users
Oops, of course I meant product(...) ! Jacob On Fri, Dec 18, 2015 at 1:45 PM, Jacob Bandes-Storch wrote: > 1. Maybe ProductGenerator? > 2. Use AnyGenerator<(T, U)>? > > I'd love to see something like this in stdlib: > > func product(s1: S1, s2: S2) -> >

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread Jens Alfke via swift-users
> On Dec 18, 2015, at 12:07 PM, David Turnbull via swift-users > wrote: > > In order to be performant, scalars, vectors, and matrices must all be values > types aka structs. This way, for example, an Array can be > passed directly to OpenGL without any

Re: [swift-users] Need better name, want to hide generator

2015-12-18 Thread Jacob Bandes-Storch via swift-users
1. Maybe ProductGenerator? 2. Use AnyGenerator<(T, U)>? I'd love to see something like this in stdlib: func product(s1: S1, s2: S2) -> ProductSequence { ... } where ProductSequence.Generator.Element is (T, U). So your example could

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread Janosch Hildebrand via swift-users
You will also want to have this code in the same module that is using this type. If you're using these types from another module you're limited to unspecialized generics which are (unsurprisingly) very slow. I assume these types are intended for your SwiftGL library. If they are only for

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread Joe Groff via swift-users
Do you have the optimizer enabled (using -O)? I see inlining happening as you'd expect. This: let x = Vector2(x: 1, y: 1) foo(x.x) foo(x.r) optimizes down to: %15 = integer_literal $Builtin.Int64, 1 // user: %16 %16 = struct $Int (%15 : $Builtin.Int64)// users: %17, %17,

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

2015-12-18 Thread Joe Groff via swift-users
> On Dec 18, 2015, at 1:52 AM, Daniel Eggert via swift-users > wrote: > >> On 17 Dec 2015, at 22:47, Daniel Eggert via swift-users >> wrote: >> >> If I need access to the C fcntl(2): >> >> int fcntl(int, int, ...) >> >> can I get the

[swift-users] Need better name, want to hide generator

2015-12-18 Thread Erica Sadun via swift-users
Source: http://swiftstub.com/788132715 Two questions: 1. Can anyone recommended a better name than Cartesian? 2D doesn't work for the compiler and I'm looking for something that doesn't seem "floating-point"-y 2. Is there a way to internalize the generator and

Re: [swift-users] Need better name, want to hide generator

2015-12-18 Thread Erica Sadun via swift-users
At a minimum, this gives me http://swiftstub.com/60017598 But I remember reading *somewhere* (can't remember) that we were supposed to avoid AnyGenerator/AnySequence and they were on the way out. Am I out of my mind? -- E > On Dec 18, 2015, at 2:47 PM, Jacob

[swift-users] SwiftRedis

2015-12-18 Thread Thomas Catterall via swift-users
Hi all, Proud to announce 0.0.1 of SwiftRedis, a Swift wrapper around hiredis. It's very early in development but I thought some of you might like to have a crack at it, contribute anything you like, or try using it for some very basic Redis commands! It requires mainline Swift if you're

Re: [swift-users] Need better name, want to hide generator

2015-12-18 Thread Dmitri Gribenko via swift-users
On Fri, Dec 18, 2015 at 1:22 PM, Erica Sadun via swift-users < swift-users@swift.org> wrote: > 2. Is there a way to internalize the generator and not make it public? I'd > ideally like to hide all details except the fact that this is a sequence of > (Int, Int) > You can use AnySequence and

Re: [swift-users] Need better name, want to hide generator

2015-12-18 Thread Rob Mayoff via swift-users
> > 1. Can anyone recommended a better name than Cartesian? 2D doesn't work > for the compiler and I'm looking for something that doesn't seem > "floating-point"-y > "AllPairs" seems self-explanatory. "CrossJoin" should be intuitive to anyone familiar with relational databases. "product" sounds

Re: [swift-users] Design and performance of Vector2/3/4 and Matrix

2015-12-18 Thread David Turnbull via swift-users
On Fri, Dec 18, 2015 at 4:34 PM, Janosch Hildebrand wrote: > If you only care about having a simple cross-platform library, doing a > simple implementation by yourself is fine. Also Swift (well, LLVM) is also > pretty good at auto-vectorization so you get decent results for