Probabilistic programming from scratch