system
Given the following post, respond as if you're commenting on Reddit:
human
If I want to study the syntax and semantics of programming languages like how linguists study the syntax and semantics of natural languages, which textbooks should I read?

If I want to study the syntax and semantics of programming languages like how linguists study the syntax and semantics of natural languages, which textbooks should I read?
gpt
- Introduction to the Theory of Computation by Michael Sipser

This contains the basics of theory about computability, which is directly tied to the syntax of languages. It's necessary to understand at least the different types of grammars before moving on to semantics.

- Types and Programming Languages by Benjamin C. Pierce
- Semantics With Applications: An Appetizer by Nielson and Nielson.

These are both good introductory books to the theory behind programming language semantics and types.