Hacker News new | past | comments | ask | show | jobs | submit login
Swift compiler driver rewritten in Swift (github.com/apple)
115 points by rvz on Oct 10, 2019 | hide | past | favorite | 12 comments



Does that mean you'll soon need to have Swift to compile the Swift compiler? How many versions back do they want to support for bootstrapping?


Or cross-compile it. Swift already supports Linux, and there are even official Docker images.

I don't see anything wrong with having a bootstrap process that begins with cross-compilation. After all, that's probably how your platform got its first C compiler, too.


I don't think there's a formal plan for bootstrapping yet. This is just the driver, so it shouldn't be too hard to write a tool which builds it by manually invoking the compiler frontend.


I suspect they'll sell a binary if all you want to do is develop apps in swift, and that they have a bootstrapping system to compile the compiler, like every other native compiler.

I believe that Chris Lattner the original author of LLVM also started Swift and is (or was) working at Apple on compilers.

https://en.wikipedia.org/wiki/Chris_Lattner


Why would anyone sell a binary? It's all open source.

And Chris Lattner has worked at Google for a while now.


So make a binary a available for download?


You can get macOS or Ubuntu builds already: https://swift.org/download/#snapshots


So, this is basically the build pipeline driver?

I remember hacking the original C++ version of this, trying to pass wasm target compilation flags back to the llvm just for fun.

What more can you get from this.. the ability to fiddle with the build process from Swift API? For consumers like package managers?

I guess it needs a little bit more of clarification, of what can be done with it.. i guess, a introduction to the API behind it would help, giving the target audience for this sort of thing.

I've changed a GN(chrome ninja build generator) to build Swift, and unlike C/C++ code where you compile each file, i had to create a different scheme to compile all source files into the the final object module file.

Wonder if i can call this instead of swiftc directly and if it would help somewhere.


> What more can you get from this.. the ability to fiddle with the build process from Swift API? For consumers like package managers?

Yeah, SwiftPM being one obvious candidate of course.


What does this do to the compile time?


And that my friends is called bootstrapping.


I thought bootstrapping would mean at least part of the language features would be implemented in the language itself ? "compiler driver" seems more like plumbing. I would call that bootstraping when either part of the syntax tree parsing or production of LLVM instructions are done in swift..




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: