I'm aware that this kind of question should be asked in Computer Science Stack Exchange. But I decided to ask here because there should be more effective answers here with more experienced people with solid math background that might have taught themselves some computer science.
I decided to ask this question after being attracted by how much one can do with the knowledge in computer science, including iOS application development, game(or mods) development, website creating, etc., but having trouble with matching what I learned with what I really understood.
Realizing the lack of knowledge in programming, I once decided to learn programming in a specific language, like Objective-C and Swift. After I tried every single textbook on OC programming, I found myself wasting time in the "explanation" part and getting lost with the real "theoretical" part. It seems to me that those textbooks prefer a long and loose explanation in describing a concept without telling me what exactly it is(Like the notion of "Object" and "Pointer") and skip the real important "thinking" before the implementation of the code. Although after many times of reading I could create a very simple application(like a simple calculator), I was still very lost in how it really works.
That reminds me how I began to learn mathematics. In middle school "function" is just "$y=f(x)$", where $f(x)$ can be $x^2$, $\sin(x)$, and other operations about $x$. However, now for me $f$ is a set of tuples satisfying the unique mapping property, or an arrow with domain and codomain. More generally, I can give a affirmative response to every question like "what is (the definition of) this?(in a math sentence.)" So I asked myself, "what is most basic among all subjects in computer science"?
Based on the belief that computer system and programming can be completely theoretical, I decided to learn from the very basic. Where is the code for my programming environment?(For me, Xcode) and how can I understand it? What is a computer made of (up to the transistors), and how do them work together? But then I found out that there is no book with the name similar to "how a computer works" that reach my satisfaction, which I thought is my vocabulary problem.
I hope that in the book I'm looking for, every keyword is rigorously defined, and without any waste of time in explaining what a notion "means" or how it is developed stage by stage historically. I expect that it gives only the goals(like the adding machine) and how to build it from the given definitions(a graph with the nodes of value "0" or "1"). Every textbooks in mathematics(like the GTM series) reach this goal, and for me, that is MUCH easier to read and understand. I think most of the math student like me will prefer this style of learning.
What is a good (book) route for a math student to self study computer science from the basic? I wish there are some theoretical textbooks that build the whole operation system, compiler, or some of this kind, that is readable to math students. Any answer would be much appreciated. Thank you.
It's a bit arrogant to stick too tightly to such a belief when you're still learning the field don'tcha think?
Some areas of computer science can be called "completely theoretical". Computability theory and complexity theory come close, as do some of the more wild-eyed branches of programming language research. They merge into parts of logic and category theory that could be called "computer science by conquest" because computer scientists are interested in them -- though at the best conferences you will also find people with Dept. of Mathematics affiliations, and some even use blackboards for their talks!
However, in most of computer science as a field, the lifeblood of the science is the tension between nice theoretical models on one hand, and the need to build systems that work on actual physical devices that can be produced economically on the other hand. To insist on studying only the theoretical side amounts to throwing out not just half of the field, but the entire crunchy middle too.
In your position you probably ought to start by a computer architecture textbook, and then learn (really learn) a low-level programming language such as C. Though this will offer you copious opportunity to shoot yourself in the foot, it might also be the only way to satisfy your (in itself laudable) desire to understand the entire stack of abstractions all the way down. And the mistakes you'll make with C might help you understand the point of the more abstract concepts of more modern languages.