We already have a subject taught for that. Maths. As an aside, to the extent that when we're hiring fresh grad programmers, their maths ability is a better indication of future quality than their programming ability. We find it easier to teach people who can think how to program than the other way around.
It's different than the classical/non-algorithmic sort of math taught in schools, it's more like "maths in motion" which can be very exciting and give early rewards in the feedback loop of learning, when kids see their creations actually do something. It also requires a different sort of thinking than the study of classical/non-algorithmic math, IMO. It's a very exciting time to be involved in the borderland between mathematics and computer science, with languages like Agda giving a whole new take on constructive mathematics.