<div dir="ltr">On Mon, Jul 28, 2014 at 10:30 PM, David Farler <span dir="ltr"><<a href="mailto:dfarler@apple.com" target="_blank">dfarler@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div class="h5"><blockquote type="cite"><div>On Jul 28, 2014, at 9:31 PM, Ryosuke Niwa <<a href="mailto:rniwa@webkit.org" target="_blank">rniwa@webkit.org</a>> wrote:</div>
<br><div><div dir="ltr">On Mon, Jul 28, 2014 at 8:44 PM, David Farler <span dir="ltr"><<a href="mailto:dfarler@apple.com" target="_blank">dfarler@apple.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>On Jul 28, 2014, at 17:10, Ryosuke Niwa <<a href="mailto:rniwa@webkit.org" target="_blank">rniwa@webkit.org</a>> wrote:</div>
<div><br></div><blockquote type="cite"><div dir="ltr">On Mon, Jul 28, 2014 at 12:47 PM, David Farler <span dir="ltr"><<a href="mailto:dfarler@apple.com" target="_blank">dfarler@apple.com</a>></span> wrote:<br><div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hello all,<div><br></div>
<div>I have the following bug to help build out support for layout tests in the iOS Simulator.</div><div><br></div><div>iOS Simulator LayoutTestRelay</div><div><a href="https://bugs.webkit.org/show_bug.cgi?id=135269" target="_blank">https://bugs.webkit.org/show_bug.cgi?id=135269</a></div>
<div><br></div><div>I'd like to include this as a new tool written in Swift.</div><div><br></div><div>Why I think it's fine in this case:</div><div>- This tool is specific to the iOS and OS X platforms</div><div>
- Swift is a fully supported, albeit new, language starting in Xcode 6.</div>
<div>- Swift is probably the best way to get Objective-C bridging "for free" in the long term</div><div>- Swift supports script-like "immediate mode" with good JIT-compiled performance</div><div><div>
- The tool's size and scope is sufficiently small with no complex or WebKit-specific dependencies</div>
</div></div></blockquote><div><br></div><div>There is a precedence of WebKit rejecting the use of new programming languages in the past:</div><div><a href="https://lists.webkit.org/pipermail/webkit-dev/2011-December/018837.html" target="_blank">https://lists.webkit.org/pipermail/webkit-dev/2011-December/018837.html</a><br>
</div></div></div></div></blockquote><div><br></div></div><div>Precedence drives opinions of law, for which reinterpretations are considered to be an unfortunate correction. I don’t think it should be invoked to hamper creativity or reject something “new”. Still, the main difference to that case is that Swift is not an unsupported third-party language, it won’t require installation of new software, and it’s not for cross-platform automation.</div>
</div></blockquote><div><br></div><div> Swift is an unsupported third-party language for people who don't work on Mac or iOS ports.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div>For this project, I think it’s a valid exploration for code that would already have to use platform-specific Objective-C. Of course, I wouldn’t presume to argue that all of OS X and iOS WebKit code should move to Swift at this point. However, I reject thinking that leads one to only consider a new possibility when the current situation is unbearable or even painfully obvious.</div>
<div><div><br></div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>I'm not saying that Swift is a bad language or anything but I don't want to start having people writing random programming languages such as Haskell, Scala, Go, Rust, etc... deemed hip/cool at the time to create new tools in WebKit.</div>
</div></div></div></blockquote><div><br></div></div><div>Of course. The main difference is that I don’t deem it hip; it’s a fully supported, productized language that ships with Xcode and it’s only going to grow in use on OS X and iOS. Even so, that Swift is hip and exciting shouldn’t be ignored. Developing WebKit should be as exciting to hack as much as it is an exemplary web framework too, as both motivations work together to make it better.</div>
</div></blockquote><div><br></div><div>In my personal opinion, "hip and exciting" should never be a reason to do anything. However, we can agree to disagree here since this is a very subjective topic.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>It would increase the entry barrier of working on those tools even if they were specific to one platform.</div></div></div></div></blockquote></div><div>It is something new to learn. Is it a <i>barrier?</i></div></div>
</blockquote><div><br></div><div>Yes. Every new programming language we introduce into the project introduces a new entry barrier to hack on the project. Namely, everyone who ever has to modify that code need to learn Swift in addition to Objective-C/C++, which is used to write some parts of since Mac/iOS ports.</div>
<div><br></div><div>I personally hate Objective-C syntax and would prefer using something like Swift. However, that preference doesn't outweigh the overall cost of introducing a new programming language into the project of this size with so many contributors.<br>
</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>
I don’t think so. I think it’s an opportunity. We assumed Objective-C in the first place because it was <i>the only </i>way to write apps and frameworks on OS X and iOS. Now that's no longer true and, while both languages are supported, if someone didn’t think it was the way forward, I don’t think it would exist in the first place since Objective-C does a pretty good job already and it could’ve been extended incrementally. That’s my perspective. Obviously it’s not going anywhere anytime soon but, if Objective-C were deprecated in the future, and we suddenly decided we needed reviewers who knew Swift, where would we look?</div>
</div></blockquote><div><br></div><div>There has been no indication that Objective-C will be deprecated anytime soon.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">e.g. what should GTK+/EFL contributors do if they wanted to modify the way webkitpy works and needed to make changes to your tool? Or do you think such a scenario is extremely unlikely?</div>
</div></div></blockquote><div><br></div></div><div>Given the pace of webkitpy development … :) I do think it’s unlikely.</div></div></blockquote><div><br></div><div>That's great to hear since the cost of using Swift is proportional to the number of people who have to maintain the tool. If you're the only who has to touch the codebase, then the cost is virtually zero given that you seem to already know about Swift.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>It’s just a proxy to a simulator app's standard file descriptors which are only accessible indirectly and I’m happy to say that it somewhat pays for its debt by removing lots more platform-specific code than it creates (<a href="https://bugs.webkit.org/show_bug.cgi?id=135374" target="_blank">https://bugs.webkit.org/show_bug.cgi?id=135374</a> and <a href="https://bugs.webkit.org/show_bug.cgi?id=135271" target="_blank">https://bugs.webkit.org/show_bug.cgi?id=135271</a>). It doesn’t exist to automate but make it possible to run layout tests on the simulator with the current tools. Essentially, it pretends to be DRT/WKTR, so it has the same I/O behavior requirements as those tools.</div>
</div></blockquote><div><br></div><div>It doesn't seem like the benefits you point out are independent of the language choice. We can still remove ORWT even if we wrote the tool in Objective-C. However, I would point out that DumpRenderTree for Mac port is written in Objective-C++, and there is a benefit in sharing code with it. Have you looked into that? Or have you decided that there is nothing we can share between the two programs?</div>
</div></div></div></div></blockquote><div><br></div></div></div><div>I did look into it. However, CoreSimulator is an OS X framework, and DRT/WKTR are built as iOS Simulator binaries. The linker will not link OS X dylibs to iOS executables and vice versa – although the CPU architectures the same, the platform load commands conflict and cause a fatal error at link time. Even if that were possible, it would involve some kind of self-hosting, self-installing voodoo. A new OS X executable target is a minimum requirement, as CoreSimulator is the gatekeeper to the simulator device. Additionally, a single xcodebuild invocation does not like mixing targets with different SDKs. However, in the future, I would like to combine the DumpRenderTree and WebKitTestRunner projects. There is plenty of code to share between those two targets and they aren't cohesive at all.</div>
</div></div></blockquote><div><br></div><div>I didn't mean to use the same binary but rather to share the source code to avoid the code duplication.</div><div><br></div><div>- R. Niwa</div><div><br></div></div></div>
</div>