Pascal was designed to be an educational language, hence the choice to make it (very) strictly typed.
Pascal was designed for development of algorithms in HLL and teach them to students. The audience to teach was mostly Math students close to their Masters, and compiler construction was also a real concern. Or after. In that they and age they were pretty much the only programmers.
It is not like Logo that was meant to teach children.
Other than educational value there is no reason why booleans and numerical datatypes could not be interchanged.
This is incorrect. Boolean and integer math are also separate, so heaping them together is not intuitive either. So the question should be why they should be heaped together, something that probably has roots in minimizing code of the first B and C compilers so it would fit in the memory of the mini computers they were using.
Note that new C99 boolean types follow the pascal definition more
https://stackoverflow.com/questions/4767923/c99-boolean-data-typeOn assembly level they are all just bytes...
So then why does C use int and not byte?
Strictly typed languages typically produce more code because of the required explicit conversions, overloaded functions etc... While not a C programmer, I understand why the developers have chosen to leave the discipline to the programmer.
Typecasts don't generate code, overloaded functions neither. Don't let dumb C advocacy by newbies fool you. The reason that C compilers are fast is mostly the work put into C compilers, not the language itself.
So there are three aspects:
- Size (1,2,4,8 byte)
- convention (are values outside of TRUE and FALSE) defined and if so how
- Typecompatibility with integer
About size we can be simple. Making boolean the same size as integer is the most portable way. Nowadays that is best, but in the past it was often wasteful, which is why Turbo Pascal had it as 1-byte. Embedded systems often have booleans as "true" size, 1-bit, as they often have bitaddressable memory.
Convention is a matter of taste. Both conventions make sense. The C definition defines all values in a range, the Pascal definition (which forces 1=true) keeps that if A and B are both true, they are also binary the same, iow = is a binary operator. As said C99 tries to acquire this property too for the "boolean" type, the old integer boolean is more or less legacy now.
Then the compatibility to int. I don't see any use advantage or reason, so it is IMHO just legacy from the early days of B/BCPL when C was mostly untyped