Re: [swift-users] An OpenGL math library in pure Swift - now with SIMD

2016-01-05 Thread David Turnbull via swift-users
On Tue, Jan 5, 2016 at 12:52 PM, David Turnbull wrote: > It's not as fast as packed SIMD but it's still really fast. As fast as C. > This is no longer true. I added SIMD to SwiftGL. Here's one million mat4x4 multiplications: SIMD module direct : 1.489s SwiftGL + SIMD : 1.487s SwiftGL plai

Re: [swift-users] Compiler switch?

2016-01-05 Thread Jack Lawrence via swift-users
Hi Don, It’s not currently possible to disable any warnings emitted by the Swift compiler. Alternatively, you could run a fix-it pass over all of the code after translation, which automatically accepts all suggested fix-its: swiftc -fixit-all input_file.swift Jack > On Jan 5, 2016, at 7:02 PM,

[swift-users] Compiler switch?

2016-01-05 Thread Don Wills via swift-users
Hello Swift-Users, I am building an automated translator to translate from another programming language to Swift. It's mostly working, but there is one issue that would be hard for the translator to deal with - the issue of 'var' vs. 'let' declarations. Right now the translator always creates

Re: [swift-users] Package manager and swiftdoc

2016-01-05 Thread Rick Ballard via swift-users
Hi Luz, We currently have no standard established for generating documentation for packages in a uniform way, but it's in our plans (https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageManagerCommunityProposal.md#documentation-generation). Proposals are welcome for h

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Janosch Hildebrand via swift-users
> On 05 Jan 2016, at 04:11, David Turnbull via swift-users > wrote: > > I've been working on a math library for SwiftGL. It's looking good. Vector2, > Vector3, Vector4, Matrix2x2, Matrix3x3, Matrix4x4 are implemented with all > arithmetic. You can even swizzle just like GLSL. > > var myVec =

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Stephen Canon via swift-users
There are three pieces of the simd module on OS X / iOS. - There’s the SDK overlay, which is part of Swift. - There are C/C++ headers /usr/include/simd/*.h, which comprise the bulk of the C implementation. - A small number of routines require external calls, whose implementations are part of lib

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread David Turnbull via swift-users
On Tue, Jan 5, 2016 at 8:27 AM, Michael Ilseman wrote: > What all is mean by “feature parity” with GLSL > The functions in GLSL like normalize(), cross(), dot(), distance(). The idea is that you shouldn't have to remember two APIs to be productive. Like what glm does for C++. -david ___

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread David Turnbull via swift-users
On Tue, Jan 5, 2016 at 8:59 AM, Stephen Canon wrote: > > FYI essentially all of this stuff is already present in the simd module > Yeah, but... 1> import simd repl.swift:1:8: error: no such module 'simd' SwiftGLmath works today for everyone. It's not as fast as packed SIMD but it's still real

Re: [swift-users] ARC // Precise Lifetime Semantics

2016-01-05 Thread Jacob Bandes-Storch via swift-users
This is what withExtendedLifetime is for: https://developer.apple.com/library/ios/documentation/Swift/Reference/Swift_StandardLibrary_Functions/index.html#//apple_ref/swift/func/s:FSs20withExtendedLifetimeu0_rFzTq_Fzq_q0__q0_ On Tue, Jan 5, 2016 at 9:57 AM, Kristof Liliom via swift-users < swift-u

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Volodymyr Boichentsov via swift-users
Any plans to make simd open-source? or available for Linux? Best Regards, Volodymyr Boichentsov > On 5 Jan 2016, at 16:59, Stephen Canon via swift-users > wrote: > > Hey David — > > FYI essentially all of this stuff is already present in the simd module > (stdlib/public/SDK/simd/simd.swi

Re: [swift-users] ARC // Precise Lifetime Semantics

2016-01-05 Thread Kristof Liliom via swift-users
Hi, I'm not a pro on Swift, but I would try to use the Unmanaged wrapper struct. Sample (might not be correct, didn't try) // Using Unmanaged func dummyfunc(backingData: dispatch_data_t) { var base = UnsafePointer() var size = Int() let mapped = dispatch_data_create_map(backingData,

Re: [swift-users] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-05 Thread David Hart via swift-users
Sorry about the double post. > On 05 Jan 2016, at 18:26, David Hart via swift-users > wrote: > > How is it that Swift allows code like this: > > struct Sneaky: StringLiteralConvertible { > init(stringLiteral value: String) {} > init(extendedGraphemeClusterLiteral value: String) {}

[swift-users] Very strange automatic behavior between StringLiteralConvertible and pattern matching

2016-01-05 Thread David Hart via swift-users
How is it that Swift allows code like this: struct Sneaky: StringLiteralConvertible { init(stringLiteral value: String) {} init(extendedGraphemeClusterLiteral value: String) {} init(unicodeScalarLiteral value: String) {} } func ~=(sneaky: Sneaky, string: String) -> Bool {

[swift-users] Very unexpected automatic behaviour between StringLiteralConvertible and pattern matching!

2016-01-05 Thread David Hart via swift-users
How is it that Swift allows code like this: struct Sneaky: StringLiteralConvertible { init(stringLiteral value: String) {} init(extendedGraphemeClusterLiteral value: String) {} init(unicodeScalarLiteral value: String) {} } func ~=(sneaky: Sneaky, string: String) -> Bool {

Re: [swift-users] Newbie Question

2016-01-05 Thread Jens Alfke via swift-users
> On Jan 4, 2016, at 9:07 AM, Sherri McGurnaghan via swift-users > wrote: > > I am trying to do something super simple using Swift - we are changing our > infrastructure and the new environment requires me to work with Swift. > Needless to say, I am a complete newbie and a bit lost on where t

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Stephen Canon via swift-users
Hey David — FYI essentially all of this stuff is already present in the simd module (stdlib/public/SDK/simd/simd.swift.gyb or ‘import simd'), albeit without nice generics, and with some different stylistic choices because simd is at present a straight Swift port of a subset of the simd C/Obj-C/

Re: [swift-users] An OpenGL math library in pure Swift

2016-01-05 Thread Michael Ilseman via swift-users
> On Jan 4, 2016, at 7:11 PM, David Turnbull via swift-users > wrote: > > I've been working on a math library for SwiftGL. It's looking good. Vector2, > Vector3, Vector4, Matrix2x2, Matrix3x3, Matrix4x4 are implemented with all > arithmetic. You can even swizzle just like GLSL. > > var myVec

[swift-users] ARC // Precise Lifetime Semantics

2016-01-05 Thread Daniel Eggert via swift-users
How do I extend the lifetime of a variable, i.e. make sure that ARC is less aggressive? clang has an attribute called objc_precise_lifetime — does Swift have something similar? I have this code: do { var base = UnsafePointer() var size = Int() let mapped = dispatch_data_create_m