4 ms·
Could someone please explain what this project is about? I gather it's a new implementation of the Swift language without using Xcode's compiler and Swift stand
by paulvs 10y ago
Could someone please explain what this project is about? I gather it's a new implementation of the Swift language without using Xcode's compiler and Swift standard library, but I find the full readme very undescriptive of what this is and why it's useful.
EDIT: Clicking through the source I found about a dozen files in total, mostly scripts and make files.
- TheHydroImpulse 10y agoIt's not a new implementation so much as compiling Swift for different architectures and environments not supported by the compiler. It still uses the Swift compiler but emits LLVM IR and then uses Clang to target to the different environments.
- kr7 10y agoThe assembler and Makefile are x86 only. I'm not seeing support for other architectures.
- gilgoomesh 10y agoIt builds Swift without any standard library, runtime or linkage to other components. This isn't normally possible with the Swift compiler. The solution doesn't involve changing the compiler or building everything into the executable. Instead, this is a makefile coordinated pipeline (front-end swiftc, back-end clang) plus a start.s and a system.c file that omit any need for typical standard library components in the first place. i.e. a "bare metal" compilation
- blkhp19 10y agoWithout the swift standard library, what can be done? Doesn't the standard library include all of the basic types, like Array, Int, etc?
- kr7 10y agoFixed-size integers and UnsafeMutablePointer are supported, so it is basically C with different syntax: https://github.com/klange/taylor/blob/master/src/main.swift https://github.com/klange/taylor/blob/master/src/main.swift
- kr7 10y agoIt is for running Swift code without an operating system. It could be used to write a kernel in Swift.
- danieleggert 10y agoYou can use swiftc (the Swift compiler) without Xcode just like you can use clang without Xcode. Xcode is just an IDE.