[swift-dev] Brackets as part of typ names / compiler messages

2015-12-18 Thread Tino Heth via swift-dev
I hope that Swift 4.0 will have enough template-like syntax to build something like a generic matrix that can be used in a typesafe way, but in the meantime, I wanted to harness the power of unicode to create "class Matrix«4×4»", which really confused the compiler. "class Vector" is no problem

[swift-dev] Starter project: add stable sort to the standard library

2015-12-18 Thread Dmitri Gribenko via swift-dev
Hi, The standard library should provide a stable sort. This needs a proposal to swift-evolution (the design should be trivial, new methods should mirror existing sorting APIs), and implementation. The standard library already contains an internal implementation of insertion sort, so

Re: [swift-dev] Combining Skin Tone Emoji Into Single Extended Grapheme Clusters

2015-12-18 Thread Dmitri Gribenko via swift-dev
Hi Michael, On Thu, Dec 17, 2015 at 9:16 PM, Michael Buckley via swift-dev < swift-dev@swift.org> wrote: > Hello, > > I would like to fix rdar://20511834 , which is that the new skin tone and > multi-person grouping emoji introduced with iOS 8.3 and OS X 10.10.3 are > represented as multiple

Re: [swift-dev] Building Foundation on FreeBSD

2015-12-18 Thread Davide Italiano via swift-dev
On Wed, Dec 16, 2015 at 2:25 PM, Jordan Rose wrote: > >> On Dec 16, 2015, at 11:21 , Davide Italiano wrote: >> >> On Wed, Dec 16, 2015 at 11:17 AM, Jordan Rose wrote: >>> What's the compile command for the files that are

Re: [swift-dev] Combining Skin Tone Emoji Into Single Extended Grapheme Clusters

2015-12-18 Thread Michael Buckley via swift-dev
Thanks for the response, Dimitri. My comments inline below. On Fri, Dec 18, 2015 at 3:29 AM, Dmitri Gribenko wrote: > > > One thing to do would be to check the Apple's ICU implementation, which (I > think) implements some extra handling for UTR #51 ( >

[swift-dev] Automatic function wrapping for C Module

2015-12-18 Thread Geordie Jay via swift-dev
Hi, First of all thanks to Joe Groff for his insight, pull request, and guidance re the @_cdecl attribute, which is important for what follows below. I’ve been working on a JNI (Java Native Interface) integration for the Android port of Swift (github.com/SwiftAndroid) with good results so

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-18 Thread John McCall via swift-dev
> On Dec 17, 2015, at 11:09 PM, Slava Pestov via swift-dev > wrote: >> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >> wrote: >> >> We currently always pass inout parameters indirectly, but it seems to me >> that for inout parameters that are

[swift-dev] Making sense of Swift AST - pattern_binding_decl and var_decl

2015-12-18 Thread Lee M via swift-dev
With the code: var foo = true, swift parses this into the following AST: (pattern_binding_decl (pattern_named 'foo') (boolean_literal_expr type='' value=true)) (var_decl "foo" type='' storage_kind=stored))) I'm wondering why VarDecl and PatternBindingDecl are separate nodes in the tree

Re: [swift-dev] metatype of Int

2015-12-18 Thread Dave Abrahams via swift-dev
> On Dec 18, 2015, at 11:16 AM, Rafkind, Jon via swift-dev > wrote: > > Given a swift::MetaType how can I tell if it corresponds to the MetaType of > the standard Int type? Is there a way to get a reference to the MetaType from > the StdlibModule or TheBuiltinModule? >

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-18 Thread John McCall via swift-dev
> On Dec 18, 2015, at 10:29 AM, Joe Groff wrote: >> On Dec 17, 2015, at 3:43 PM, John McCall wrote: >> >>> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >>> wrote: >>> We currently always pass inout parameters indirectly, but

Re: [swift-corelibs-dev] Recommended posix_spawnattr_t for NSTask's implementation

2015-12-18 Thread David Smith via swift-corelibs-dev
One issue that we ran into in the ObjC NSTask is setting the current working directory in the child process. We worked around the lack of an API for that by using per-thread working directories, which is kind of awful. I'm not up to date on what the best approach to use for this on Linux would

[swift-dev] Dockerized Swift, Build Times and Other Notes Regarding CI

2015-12-18 Thread swizzlr via swift-dev
Hi all, I’ve been working on running Swift applications and building the Swift toolchain in docker containers. I’d like to share some thoughts and notes I’ve made, since they may be of interest to others. Especially to those of you stubbornly clinging to 10.10 on 2013 era Macbook Airs which

Re: [swift-dev] metatype of Int

2015-12-18 Thread Rafkind, Jon via swift-dev
Sorry I should have been more specific. I am working at the C++ level. I have a swift::MetaType* and want to compare it to something. On 12/18/2015 12:10 PM, Dave Abrahams wrote: On Dec 18, 2015, at 11:16 AM, Rafkind, Jon via swift-dev

Re: [swift-dev] Value-result ABI for small trivial inouts

2015-12-18 Thread Joe Groff via swift-dev
> On Dec 17, 2015, at 3:43 PM, John McCall wrote: > >> On Dec 17, 2015, at 3:34 PM, Joe Groff via swift-dev >> wrote: >> We currently always pass inout parameters indirectly, but it seems to me >> that for inout parameters that are of small trivial

[swift-dev] metatype of Int

2015-12-18 Thread Rafkind, Jon via swift-dev
Given a swift::MetaType how can I tell if it corresponds to the MetaType of the standard Int type? Is there a way to get a reference to the MetaType from the StdlibModule or TheBuiltinModule? For now I can convert the MetaType to a string and compare it to "Int.Type" but that is yucky. --

[swift-dev] Reducing the size of Swift binaries by shortening symbols

2015-12-18 Thread Nadav Rotem via swift-dev
Hi Swift-Dev, We care deeply about the size of binaries that are generated by the Swift compiler and make an effort to optimize and shrink the generated binaries. One of the problems that we have today is that swift symbols are mangled into extremely long strings. This is especially a problem

Re: [swift-dev] Optionals in swift-clang

2015-12-18 Thread Jordan Rose via swift-dev
Hi, Seth. Sorry for not getting back to you sooner! I don't think we have anything exactly like this, but there's sort of a sequence diagram in Chris and Joe's talk at the LLVM conference, "Swift's High-Level IR ". I'd say it looks something like this: 1. Parsing

[swift-dev] Another chinese translation about The Swift Programming Language

2015-12-18 Thread 路由 via swift-dev
Hi there,I found another Swift Programming Language's chinese translation,: www.cnswift.org It is not finished yet,but the translator is working hard. however ,this translation run by a small team but has more quality,hope you add the site to page of switf.org's Documentation.

Re: [swift-dev] metatype of Int

2015-12-18 Thread Slava Pestov via swift-dev
You can probably get the mangled name of the metatype, and refer to that. Eg, public func f() -> Any.Type { return Int.self } f() Compile this with -emit-ir: @_TMSi = external global %swift.type, align 8 define %swift.type* @_TF4blah1fFT_PMP_() #0 { entry: ret %swift.type* @_TMSi } So in

Re: [swift-dev] Dockerized Swift, Build Times and Other Notes Regarding CI

2015-12-18 Thread Max Moiseev via swift-dev
I personally think it would be of great help to newcomers to have a containerized development environment to quickly start experimenting. Non-newcomers would also benefit from it by being able to test their changes on different versions of Linux, for example. I would prepare a set of scripts

Re: [swift-dev] Dockerized Swift, Build Times and Other Notes Regarding CI

2015-12-18 Thread Thomas Catterall via swift-dev
Hi Max, Thanks for your reply and encouragement! I will do just that. Docker volumes allow you to specify volumes to mount inside the container; where this shines is mounting host directories into the container, so that one can edit files on the host and see the changes reflected immediately

Re: [swift-dev] metatype of Int

2015-12-18 Thread Jordan Rose via swift-dev
I think Jon's trying to build something on top of swiftc or SourceKit. Yes? You can do something like this to build your own metatype: ASTContext = … Type intTy = ctx.getIntDecl()->getDeclaredType(); auto *intMetaTy = MetatypeType::get(intTy, ctx); And then compare types using

Re: [swift-dev] The Swift Programming Language Translations

2015-12-18 Thread Rogelio Gudino via swift-dev
Yeah I’m starting to have conflicting ideas about this. On the one hand the reader still needs to learn a decent amount of English to have a better idea of what the standard library’s structs/classes/functions do, so might as well keep all the code in English. On the other hand, they don’t have to