This is possible, and in fact probably implemented in some probabilistic programming languages, but I think you are looking at the wrong direction.
The point is that even for fairly simple real use cases, the computation complexity is so huge, that all computers in the world couldn't compute it in your lifetime if you don't employ some approximation or optimization and stick to naive algorithms.
So, that is what the whole field of machine learning is about: finding some clever ways to deal with random variables in a computationally feasible way...
All those probabilistic programming languages will become exponentially faster once we have feasible quantum computers, since BPP \in BQP. We currently use a weaker inclusion, BPP \in PSPACE, as the core execution model.
The point is that even for fairly simple real use cases, the computation complexity is so huge, that all computers in the world couldn't compute it in your lifetime if you don't employ some approximation or optimization and stick to naive algorithms.
So, that is what the whole field of machine learning is about: finding some clever ways to deal with random variables in a computationally feasible way...