[GSoC 2017] Porting Swift to Haiku - Final Report

Blog post by return0e on Mon, 2017-08-28 07:15

Hello everyone! This blog-post marks the final report on bringing Swift to Haiku in the Google Summer of Code period. My introductory post on this project can be found here for a brief overview of the project. Summary In the last 3 coding periods, my contributions to Haiku’s LLVM and Clang ports plus reporting some bugs with the Haiku developers have made it possible for the Swift toolchain to be built on Haiku.

[GSoC 2017] Porting Swift to Haiku - Week #9 / #10

Blog post by return0e on Fri, 2017-08-18 05:56

Time for another update on the swift port, which covers the last two weeks of my activity, So here it goes! Week 9 - My Findings on Porting libdispatch On the 9th week, I added early support for building libdispatch aka ‘Grand Central Dispatch (GCD)’ which is Apple’s event-driven concurrency framework which allows executing high performance code via asynchronous task queues or I/O file descriptors (including sockets), which enables programs to take advantage of multi-core systems and to run Swift programs that utilises this.

[GSoC 2017] Porting Swift to Haiku - Week #8

Blog post by return0e on Fri, 2017-07-28 16:12

Hello everyone! Since last week I worked on enabling Haiku support for running the swift test-suite. This allows the newly built compiler to be put through the same series of test-cases run by the swift buildbots for macOS, Linux and FreeBSD platforms. These tests cover different areas of the toolchain, from simple unit-tests to validation-tests that cover the compiler internals, major standard library API changes and most importantly, compiler stability via testing with malformed inputs.

[GSoC 2017] Porting Swift to Haiku - Week #6 #7

Blog post by return0e on Tue, 2017-07-11 23:20

TL;DR: Compiling Swift programs works, added C library interoperability and adding support for running the test-suite. Hello Everyone, This report covers my activities done since the first evaluation of GSoC. I spent the first week looking into the most critical aspects of the compiler and focused my attention on the TaskQueue class. Whenever a task is executed, the TaskQueue tries to read its data via a pipe and it was found that it read 0 bytes from it, despite poll() reporting that there is still data available for reading.

[GSoC 2017] Porting Swift to Haiku - Week #4 #5

Blog post by return0e on Thu, 2017-06-22 19:08

Hello everyone! This report covers the span of the last two weeks of my porting efforts to get swift running on Haiku. I started debugging the runtime library ‘libswiftCore’ on both Haiku and Linux and focused my attention specifically to the ImageInspection logic in order to fully understand how the runtime extracts ‘type metadata’ from a swift generated shared object. My mentor korli, recommended me to use the get_next_image_info() function, which is the Haiku equivalent of iterating through the list of loaded libraries in a executable.

[GSoC 2017] Porting Swift to Haiku - Week #3

Blog post by return0e on Mon, 2017-06-05 17:10

Hello everyone! This is a rather short update on the Swift port and since the last blog post, I’ve worked around a small issue that prevented the compiler from importing libraries by specifying the -sdk parameter with a ‘/’ which passes the correct header search paths to swiftc. This issue also existed on other platforms such as FreeBSD according to this thread in the swift-dev mailing list [1]. Whilst researching around the frequent swift interpreter crashes when opening a swift source file, the fault lies in libswiftCore being unable to extract type metadata from swift-generated dynamic libraries when calling these functions specified in the ProtocolConformance and Metadata classes.

[GSoC 2017] Porting Swift to Haiku - Week #1 / #2

Blog post by return0e on Mon, 2017-05-22 14:43

Hello everyone! Community Bonding period Last week I introduced myself and my GSoC project on porting Swift to Haiku, which can be found here in case if you missed it. The bonding period so far involved a mix of initial communication with my mentors jua_ and korli (Thanks for merging my HaikuPorter recipes!) alongside receiving assistance from other haiku-devs, notably PulkoMandy and waddlesplash. In addition, I mostly spent the week researching the swift front-end driver internals [1] by reading its documentation, patching more script files used for building swift and meeting several other GSoC students on IRC/mailing lists; and I wish them good luck with their projects.

[GSoC 2017] Porting the Swift Programming Language to Haiku

Blog post by return0e on Wed, 2017-05-10 12:58

Introduction Hello everyone! I'm Joseph 'Calvin' Hill, (irc nick: return0e) a third year computer science student at the University of Hull and one of the 7 GSoC students participating with Haiku. I'm also a active contributor to the HaikuPorts organisation, by porting over useful cross-platform software found on other platforms, to be made available on Haiku. This summer, I'll be porting the Swift programming language to Haiku with my mentors Jérôme Duval 'Korli' and Julian Harnath 'jua', with the intention of merging these changes upstream.