<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 1, 2017 at 1:20 PM, Michael Ilseman <span dir="ltr">&lt;<a href="mailto:milseman@apple.com" target="_blank">milseman@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><span class=""><br><blockquote type="cite"><div>On Aug 1, 2017, at 8:14 AM, Taylor Swift via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_5056204241464908156Apple-interchange-newline"><div><div dir="ltr"><div><div><div><div><div><div>I’ve noticed from this and older threads that everyone agrees on what core libraries we want, but they never actually get built. Perennial requests seem to be<br><br></div><div>- RNG and cryptography library (CryptoSwift could be a good base for this)<br></div></div></div></div></div></div></div></div></blockquote><div><br></div></span><div>A new implementation of crypto is probably a very bad idea. A blessed wrapping around the platform’s preferred implementation of crypto, however, is certainly needed.</div></div></div></blockquote><div><br></div><div>Good point, but then again CryptoSwift has already demonstrated a demand for a new Swift implementation and we wouldn’t be starting from scratch.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div><div><div><div><div>- Generic Math library/Vector library<br></div></div></div></div></div></div></div></blockquote><div><br></div></span><div>This is pretty compelling.</div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div><div><div><div>- Basic data structures (Tree, Balanced Tree, Heap, Queue, SkipList, graphs, etc)<br></div></div></div></div></div></div></blockquote><div><br></div></span><div>Which flavor/implementation of tree, balanced tree, heap, graphs are desirable here? The desirability of many of these structures is often dependent on which of many competing tradeoffs were made. Implementation details can dramatically shape the general applicability of a data structure.</div><div><br></div><div>For example, it might make sense to adopt something similar to <a href="https://github.com/lorentey/BTree" target="_blank">https://github.com/lorentey/<wbr>BTree</a> as a general underlying representation for some kinds of higher level collections (or the mechanisms to easily adapt them).</div><div><br></div></div></div></blockquote><div><br></div><div>The idea wouldn’t be to cover every possible permutation of these data structures, but provide implementations for the most commonly used varieties. <br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><div></div><blockquote type="cite"><div><div dir="ltr"><div><div><div>- Modern DateTime library<br></div></div></div></div></div></blockquote><div><br></div><div>Foundation provides many of these, though I’m sure there are always opportunities for improvement. Do you see a specific need that cannot be addressed with improvements to corelibs-foundation? There’s a large amount of domain expertise in Foundation and they are pretty active on the mailing lists.</div></div></div></blockquote><div><br></div><div>I’d be happy just with moving the datetime functionality from Foundation into its own module. I’m really not a fan of the monolith pattern.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><span class=""><br><blockquote type="cite"><div><div dir="ltr"><div><div><div>- Modern String processing toolkit<br></div></div></div></div></div></blockquote><div><br></div></span><div>This is a huge gap in Swift’s current offerings, and I’m personally invested in improving the situation here. At the risk of hijacking this thread, do you have a good bullet list of the kinds of facilities you imagine useful? More specifically (and to keep the discussion scoped), are there any tools beyond something like good language support for regular expression matching and substitutions?</div><span class=""><br></span></div></div></blockquote><div><br></div><div>Pretty basic but most of what you have to import Foundation to do right now, plus a few extras.<br><br></div><div>- trim whitespace from a string <br></div><div>- string formatting<br></div><div>    - round float to n decimal places <br></div><div>    - pad float to n 0s<br></div><div>    - left/right/center pad string with spaces<br></div><div>- locale aware capitalization<br></div><div>- defined CharacterSetsfor things like alphabeticals, numerics, whitespace chars, etc.<br></div><div>- regex support would be nice <br></div><div>- platform-abstracted terminal colors would be nice<br></div><div><br></div><div>plus a lot of things I’m probably forgetting<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><span class=""><blockquote type="cite"><div><div dir="ltr"><div><div>- 2D Graphics library (similar to cairo)</div></div></div></div></blockquote><blockquote type="cite"><div><div dir="ltr"><div>- Windowing/UI library<br><br></div></div></div></blockquote><div><br></div></span><div>By this, do you mean cross-platform pure Swift rethinks? This is certainly interesting, but a pure Swift rethink is likely a lower priority than exposing bindings for existing cross-platform approaches (e.g. you mentinoed cairo). Like crypto, it might make sense to establish blessed wrappers/apinotes/overlays on top of tried-and-true open source offerings.</div></div></div></blockquote><div><br></div><div>Currently, calling Cairo code from Swift is extremely problematic for reasons involving memory ownership and object lifetimes. Nothing an experienced Swift dev can’t get around, but definitely far too ugly a hack for such a common task. The C library is simply incompatible with Swift’s memory safety model.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><br><blockquote type="cite"><div><span class=""><div dir="ltr">I think David Turnbull tried to get something like this started years back but it fizzled out pretty quick, probably because the Swift foss community was much smaller back then. Time to try again?<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 1, 2017 at 8:29 AM, Georgios Moschovitis <span dir="ltr">&lt;<a href="mailto:george.moschovitis@icloud.com" target="_blank">george.moschovitis@icloud.com</a><wbr>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>&gt; That&#39;s what&#39;s happened with the Server APIs Project<br>
&gt; <a href="https://swift.org/server-apis/" rel="noreferrer" target="_blank">https://swift.org/server-apis/</a><br>
&gt;<br>
&gt; I would like to see more of this, and math/BigNum seems like a good candidate.<br>
&gt;<br>
&gt; Another is a modern date/time package, standing on the shoulders of<br>
&gt; <a href="https://jcp.org/en/jsr/detail?id=310" rel="noreferrer" target="_blank">https://jcp.org/en/jsr/detail?<wbr>id=310</a> and similar.<br>
<br>
</span>+ 1<br>
<br>
I would also love to see standard implementation of Graph data structures, at least some common protocols.<br>
Dunno why this versatile data structure is not included in standard libraries (similar to Map/Dictionary), Set, etc.<br>
<span class="m_5056204241464908156HOEnZb"><font color="#888888"><br>
-g.</font></span></blockquote></div><br></div></span><span class="">
______________________________<wbr>_________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br></span></div></blockquote></div><br></div></blockquote></div><br></div></div>