The present disclosure provides compounds such as pyrazolpyrimidine compounds, and pharmaceutically acceptable salts thereof, that are tyrosine kinase inhibitors, in particular BLK, BMX, EGFR, HER2, HER4, ITK, TEC, BTK, and TXK and are therefore useful for the treatment of diseases treatable by inhibition of tyrosine kinases such as cancer and inflammatory diseases such as arthritis, and the like. Also provided are pharmaceutical compositions containing such compounds and pharmaceutically acceptable salts thereof and processes for preparing such compounds and pharmaceutically acceptable salts thereof.