slidenumber: true
final class Loader: BindableObject { | |
let didChange = PassthroughSubject<Data?, Never>() | |
var task: URLSessionDataTask! | |
var data: Data? = nil { | |
didSet { | |
didChange.send(data) | |
} | |
} | |
init(_ url: URL) { |
CUSTOM_SWIFT_SOURCE = $(SRCROOT)/path/to/swift-source | |
HEADER_SEARCH_PATHS = $(CUSTOM_SWIFT_SOURCE)/swift/include/swift-c/SyntaxParser | |
LIBRARY_SEARCH_PATHS = $(CUSTOM_SWIFT_SOURCE)/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86_64/lib | |
LD_RUNPATH_SEARCH_PATHS = $(LIBRARY_SEARCH_PATHS) |
protocol Animal { | |
func foo() -> Int | |
} | |
struct Cat: Animal { | |
var value: Int = 42 | |
func foo() -> Int { return value } | |
} | |
func useAnimal(_ animal: Animal) -> Int { |
*** SIL module before Guaranteed Passes transformation (0) *** | |
// unwrapByEq(_:) | |
sil @_T02Eq08unwrapByA0ySiSgF : $@convention(thin) (Optional<Int>) -> () { | |
// %0 // users: %5, %1 | |
bb0(%0 : $Optional<Int>): | |
debug_value %0 : $Optional<Int>, let, name "optional", argno 1 // id: %1 | |
// function_ref Bool._getBuiltinLogicValue() | |
%2 = function_ref @_T0Sb21_getBuiltinLogicValueBi1_yF : $@convention(method) (Bool) -> Builtin.Int1 // user: %17 | |
// function_ref != infix<A>(_:_:) | |
%3 = function_ref @_T0s2neoiSbxSg_ABts9EquatableRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : Equatable> (@in Optional<τ_0_0>, @in Optional<τ_0_0>) -> Bool // user: %13 |
As the Swift on Linux and Swift Package Manager ecosystems mature, many authors of Swift packages want to enable their packages on Linux as well as Apple platforms. The growth of Server-Side Swift makes Linux an important target for many packages.
The first step is to run a package's unit tests on Linux, to verify it behaves as expected.
Because Swift on Linux does not use the Objective-C runtime, the dynamic features that the XCTest
unit testing framework uses to automatically discover testcases are not available.
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would