Very, very simply, according to quantum physics, something is not one specific thing until observed. My idea is that Swift could have "quantum" variables that are computed and run an asynchronous function before they are read. This could look like:
Future.swift
import Foundation
@main
var thisVarBecomesRandomEveryNanosecond: Int = 0
quantum var exampleQuantumVariable: Int {
get async {
// ...
return thisVarBecomesRandomEveryNanosecond
}
}
for(1..100) {_ in
print("\(exampleQuantumVariable)") // `exampleQuantumVariable` changes at this point
}