<div dir="ltr">Here are some of the most basic reasons why I would prefer to use swift implementations.<br><br>- Easier for Swift contributors to enter and participate<br>- More readable code<br>- Faster in long run<br>- More concise code<br>- Fully embraces Swift language<div>- Easier to maintain with control over the library</div><div><div><br></div><div>Again, I am not saying this all needs to happen immediately, but I think assuming that we&#39;ll only ever use c libraries in perpetuity is an extremely short sighted vision of how the server apis can grow. We should also keep in mind that when talking about HTTP, this isn&#39;t a from scratch rewrite as seems to be suggested several times. There are a few (likely more) parsers written in pure swift that we could mix and match to get something solid into the library. The fact that these libraries exist makes wrapping c seem like a step backwards in the progression of Swift which I am against. A perfectly reasonable compromise (as suggested before) seems to be initially wrapping some c code while leaving room in the design for Swift implementations long term if necessary.<span class="inbox-inbox-Apple-converted-space"> </span><br><br>I&#39;d still like to get more voices, we seem to have heard from about 7 people or so, and from what I can tell, the count is about 4/3. Anyone following along care to weigh in a little bit so the same few people aren&#39;t rehashing the same talking points.</div></div><div><br></div><div>- Logan</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Nov 6, 2016 at 7:37 AM Paulo Faria via swift-server-dev &lt;<a href="mailto:swift-server-dev@swift.org">swift-server-dev@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u class="gmail_msg"></u><div class="gmail_msg"><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif" class="gmail_msg">Hey Joannis! Nice to see you here. 😊<br class="gmail_msg"><br class="gmail_msg">I agree with you 100℅ we shouldn&#39;t rush the design of the APIs. I didn&#39;t mean that at all. I meant exactly the opposite. We should spend as much time as possible on the API design, and wrapping a C library would allows to distribute our total time of development focusing a lot more on the API design than on the development and maintenance of the internals. We should definitely design the API with the best of Swift using protocols and everything else you mentioned, and wraping C doesn&#39;t restrain us in any way to do that. There&#39;s nothing we can&#39;t do on the API level because we&#39;re wrapping C. What Chris Bailey mentioned about my mentality before is totally right. I believe we should spend as much time as possible designing the APIs without any constraint from, for example, Foundation or any C library, and in the Foundation case if really needed we should compromise. I just know from experience that wrapping C libs doesn&#39;t constraint at all the &quot;Swiftyness&quot; of the user-facing API. This is pure conjecture as I didn&#39;t really dig in, but I believe Swift&#39;s standard library itself uses libicu for String&#39;s internal on Linux. If this is wrong someone please correct me. I also believe Foundation wraps libcurl for the HTTP stuff.<div id="m_1767083215735079627message" class="gmail_msg"></div><br id="m_1767083215735079627br3" class="gmail_msg"><div id="m_1767083215735079627signature" class="gmail_msg"></div><div id="m_1767083215735079627content" class="gmail_msg"><blockquote class="gmail_msg"><br class="gmail_msg"> ---- On Sun, 06 Nov 2016 07:54:15 -0200 <b class="gmail_msg"> <a href="mailto:joannis@orlandos.nl" class="gmail_msg" target="_blank">joannis@orlandos.nl</a> </b> wrote ----</blockquote></div></div></div><div class="gmail_msg"><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif" class="gmail_msg"><div id="m_1767083215735079627content" class="gmail_msg"><blockquote class="gmail_msg"><br class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">I think that if you wrap C libraries you&#39;ll get stuck in the wrong mentality. Working with C libraries encourages thinking without protocols. Protocols like `ExpressibleByDictionaryLiteral` and `Sequence` are really easy to implement and make usage of conforming types really beautiful. I think that a lot of APIs will be designed with the wrong mentality, at least initially, because they&#39;re alien to Swift. And that&#39;ll create APIs for these libraries that are not at the level where they could be in a language like Swift.</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I don&#39;t think we need to rush ourselves with trying to create the libraries rapidly. If you want to have a common set of libraries in which the entire community will cooperate I think Swift is the only way to go. Many people have already written big libraries and frameworks in Swift. And I myself would never remove my own Swift code in favour of C-reliant code. And I doubt it&#39;s just me. I think that people whom prefer pure Swift will stick with (their own) existing functionality and rather build on top of a C reliant codebase.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Besides that all I feel like there&#39;s no need to rush it. A good set of libraries needs time. If you have a million people working on something for a week it will never be as good as a hundred people for a year or two. A good API/library needs time to be thought out and will need more than a few nights of rest before I think the idea alone should be considered complete. I think this counts for C-based and pure Swift libraries.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">And if we&#39;d just take the time to develop something great it will have a much greater impact on the Server Side Swift world than it would otherwise.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Joannis</div><br class="gmail_msg"><div class="gmail_msg"><blockquote class="gmail_msg"><div class="gmail_msg">On 6 Nov 2016, at 10:44, Chris Bailey via swift-server-dev &lt;<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a>&gt; wrote:</div><br class="gmail_msg"><div class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">Whilst it might not feel like it, it seems to be that we&#39;re all pulling in the same direction.</font> <br class="gmail_msg"> <br class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">Tony said:</font> <br class="gmail_msg"><font size="2" class="gmail_msg">&gt;&gt; I think if the API design feels “alien” to Foundation, then we either need to update the Foundation API to feel like it fits in with Swift or design the server API to fit in with Foundation.<br class="gmail_msg"> <br class="gmail_msg"> &gt;&gt; I’ll keep pushing for this throughout the process. It’s really important that we have a coherent stack of software from top to bottom. Ending up with different model objects for URLRequest used in the same app via two frameworks would be really unfortunate.<br class="gmail_msg"> </font> <br class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">I think this completely aligns with what everyone is saying - we want/need a coherent API stack with seamless interop between any new APIs and the existing ones. The only thing we need to work on is the approach to achieving that.</font> <br class="gmail_msg"> <br class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">For me, and I think that this is the approach that Paulo is pushing for, is that we should first look at &quot;what do we think is the right approach&quot;, without any constraints. Once we understand that, and any gap there is between that and the Foundation approach, we can determine how we close that gap - whether we can do that by evolving APIs, or whether it requires compromises for the sake of developer experience and application code portability, etc. </font> <br class="gmail_msg"> <br class="gmail_msg"><font size="2" face="sans-serif" class="gmail_msg">Chris<br class="gmail_msg"> </font> <br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">From:        </font><font size="1" face="sans-serif" class="gmail_msg">Paulo Faria via swift-server-dev &lt;<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a>&gt;</font> <br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">To:        </font><font size="1" face="sans-serif" class="gmail_msg">Tony Parker &lt;<a href="mailto:anthony.parker@apple.com" class="gmail_msg" target="_blank">anthony.parker@apple.com</a>&gt;</font> <br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Cc:        </font><font size="1" face="sans-serif" class="gmail_msg">Swift Server Dev &lt;<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a>&gt;</font> <br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Date:        </font><font size="1" face="sans-serif" class="gmail_msg">04/11/2016 23:08</font> <br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Subject:        </font><font size="1" face="sans-serif" class="gmail_msg">Re: [swift-server-dev] HTTP Parser</font> <br class="gmail_msg"><font size="1" color="#5f5f5f" face="sans-serif" class="gmail_msg">Sent by:        </font><font size="1" face="sans-serif" class="gmail_msg"><a href="mailto:swift-server-dev-bounces@swift.org" class="gmail_msg" target="_blank">swift-server-dev-bounces@swift.org</a></font> <br class="gmail_msg"> <hr class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"><font size="3" class="gmail_msg">&gt; With respect to adopting other core Swift ideas like value types: we turned 20 classes into value types last year. This included a ton of work to adopt standard library protocols and improve type safety. It is an absolutely huge surface amount of Foundation’s total API surface area. It’s a large statement about how much we value making Foundation’s API consistent for Swift.</font> <br class="gmail_msg"> <br class="gmail_msg"><font size="3" class="gmail_msg">Yeah! I really love the effort you’re putting into making Foundation more “Swifty”. That doesn’t go unnoticed. </font> <br class="gmail_msg"> <br class="gmail_msg"> <br class="gmail_msg"><font size="3" class="gmail_msg">On Nov 4, 2016, at 8:49 PM, Tony Parker &lt;</font><a href="mailto:anthony.parker@apple.com" class="gmail_msg" target="_blank"><font size="3" color="blue" class="gmail_msg"><u class="gmail_msg"></u></font></a><font size="3" color="blue" class="gmail_msg"><u class="gmail_msg"><a href="mailto:anthony.parker@apple.com" class="gmail_msg" target="_blank">anthony.parker@apple.com</a></u></font><font size="3" class="gmail_msg">&gt; wrote:</font> <br class="gmail_msg"> <br class="gmail_msg"><font size="1" face="Helvetica" class="gmail_msg">However, I do not believe there is such a fundamental conceptual mismatch here that we cannot preserve one of the most useful aspects of developing with the iOS, macOS SDKs - consistent types and low impedance mismatch between API at all levels of the stack.</font> <br class="gmail_msg"> <br class="gmail_msg"><font size="3" class="gmail_msg">I definitely value &quot;consistent types and low impedance mismatch between API at all levels of the stack”. I just hope the APIs are designed with the best of Swift in mind. Then after we get a good design, we can see if it fits Foundation, and then make the adaptations there. I think this approach would make Foundation follow along and become even more “Swiftier” with time. Of course this is easier said than done, but I believe that’s what would make the ecosystem as a whole become better for Swift.</font><font size="2" class="gmail_msg">_______________________________________________<br class="gmail_msg"> swift-server-dev mailing list<br class="gmail_msg"> <a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a><br class="gmail_msg"> </font><a href="https://lists.swift.org/mailman/listinfo/swift-server-dev" class="gmail_msg" target="_blank"><font size="2" class="gmail_msg"></font></a><font size="2" class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-server-dev" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-server-dev</a></font><font size="2" class="gmail_msg"><br class="gmail_msg"> </font> <br class="gmail_msg"> <br class="gmail_msg"> _______________________________________________<br class="gmail_msg">swift-server-dev mailing list<br class="gmail_msg"><a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-server-dev" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-server-dev</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></blockquote></div></div></div>_______________________________________________<br class="gmail_msg">
swift-server-dev mailing list<br class="gmail_msg">
<a href="mailto:swift-server-dev@swift.org" class="gmail_msg" target="_blank">swift-server-dev@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-server-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-server-dev</a><br class="gmail_msg">
</blockquote></div>