Foundations and Pragmatics of Dependently-Typed Systems for Interactive Proof-Assistance and Certifiably-Safe Programming