Other answers address the issue (schungx and ashfordneil in particular), but I'll offer that if you're interested in the formal theory behind programming language deisgn, an excellent reference is Types and Programming Languages. Even going on 20 years old, it remains relevant and will help you approach the subject matter more formally, as well as understand the academic literature.
TAPL is an excellent introduction to type theory from the ground up. The third chapter introduce a basic notation for the rules notation using untyped lambda calculus as an example. This is then used to explain typing rules from your post, starting from chapter 8. This is a great book, highly recommended.
Oh the endless coq-jokes at university...
"As you see, we are in desperate need of coq here"...
Jokes aside, another good book about that is this one by Benjamin Pierce
I used to have frequent nightmares about UFOs. They were scary, because I never knew I was dreaming when I had them. They seemed so real.
I had weekly nighmares about my exgf for 8 months after we broke up. All I ever asked her for in my dreams was closure.
Then there was the nightmare I had that had both my ex and UFOs. My ex and I made up and she spent the night at my place. Then, a tiny UFO the size of a laptop began flying around my ceiling. It freaked me out, but I tried to protect my ex by taking the nearest textbook I had and throwing it up at the ceiling, hitting the UFO, and scaring it off. I remember that the textbook was Types and Programming Languages (http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091). That thing would seriously fuck up any UFO it hit.
Though twenty years old at this point, I found this text and its sequel (edited by the same author) to be invaluable:
https://www.amazon.com/Types-Programming-Languages-MIT-Press/dp/0262162091
Types and Programming Languages by Benjamin C Pierce will cover just about everything you could want. https://www.amazon.com/Types-Programming-Languages-MIT-Press/dp/0262162091
man, I butchered my telling, thanks for fixing those inaccuracies.
For the last two points, I do actually have references, though I don't blame you for being dubious given the first half of my post, haha. When John McCarthy invented Lisp in the 1950's, he said he was directly inspired by Lambda Calculus, in his Recursive functions of symbolic expressions and their computation by machine, Part I. Or at least, that's the citation I found, I first heard about that connection in 'the annotated Turing', which is what got me on this whole rabbit trail in the first place. I'm admittedly too early on to have a great picture of it yet, but at least that detail has backing.
If you'd like to learn about the general connections between type theory and compilers/programming language theory, I recommend types and programming languages. I've only read the first chapter so far, but that's the topic of that first chapter. I'm intending to go back and properly hit the book at some point soon, but it's not a primary area of relevance to my work, so... you know. Only so many hours in the day, haha.
Emacs has org-mode
, this allows you to integrate a lot of things you'd use for something like a research paper / journal / schedule. So, you can have a table editor connected to you favorite five scripting languages, connected to your task management, hyperlinked, with a lot of navigation and management shortcust, and it can export to a bunch of formats, LaTeX being just one of them, other formats include HTML, plain text and with various degree of support, ODT, Markdown, ReStructured Text and a bunch of others.
Here are few of my ancient examples from the time I was trying to complete my CS degree :)
https://github.com/wvxvw/intro-to-automata-theory/blob/master/assignment-12.pdf
https://github.com/wvxvw/uni-introduction-to-statistics/blob/master/assignment-11.pdf
https://github.com/wvxvw/uni-linear-algebra-1/blob/master/2014/assignment-11.pdf
But GitHub's rendering of PDF isn't really good... when it comes to math. This doesn't really illustrate the full potential.
https://www.amazon.com/Types-Programming-Languages-MIT-Press/dp/0262162091 this book was written in org-mode
for example. And there are a bunch more. I remember Odersky wash showing Scala compiler compilation and a bunch of other stuff, which was all done in org-mode
.
tl;dr Step 1: http://craftinginterpreters.com
Step 2: https://www.amazon.com/Types-Programming-Languages-MIT-Press/dp/0262162091
There are a few good ones that I think are good depending what kind of language you're trying to build.
There's a series of blog posts called "Crafting interpreters"
http://craftinginterpreters.com
It's focused on dynamically typed scripting languages like Python and JavaScript but it covers some the basic stuff that you need in all compilers and then some. It's pretty beginner friendly.
On the other end of the spectrum, if you want to learn about implementing statically typed languages, then it's kind of harder to find resources that are not intimidating at first sight (they involve Greek letters and such :/). It's a deep rabbit hole of information and once you start digging, you'll be able to navigate it better. It's not actually that hard if you get used to the basic notation.
I would start by first learning languages with interesting type systems. Haskell is a good one and learn you a Haskell series of blog posts is a good starting point. The point of this exercise is to get familiar with a decent type system. You can't learn how to implement it if you don't know what to implement. Next, there's a good book for learning about type theory called "Types and programming languages" by Benjamin Peirce. If you want something less theoretical, there's also a paper called "Typing Haskell in Haskell" which is a tutorial-ish implementation of Haskell type system. It's what helped me the most in making things click because it showed a concrete implementation.
Also, shameless self plug, I wrote 2 blog posts about implementing basic type inference/checking which is more focused on the code rather than the theory. It's not expertly written but I tried to assume 0 knowledge about type systems. Also, it's written in typescript so it might be less alien than most type system related stuff that tends to be in Haskell.
https://medium.com/@dhruvrajvanshi/type-inference-for-beginners-part-1-3e0a5be98a4b
https://medium.com/@dhruvrajvanshi/type-inference-for-beginners-part-2-f39c33ca9513
Bear in mind that it's not the most clearly written tutorials out there and there are some mistakes which were corrected in edits but it should give you a basic idea.
> it is dynamically typed (uni-typed)
To explain this comment: as defined at the beginning of Types and Programming Languages,
> A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute
That is to say, a type system by definition is static. A 'dynamic type system' is really a dynamic tag-checking system. This is isomorphic to the static type system with a single type,
-- tagged union of literally every kind of thing the language supports. data Everything = Int i | Double d | Object o | Function f | ...
This usage makes a certain amount of sense - the beginnings of type theory predates the first compiler by nearly 50 years.
I read parts of Types and Programming Languages and Practical Foundations for Programming Languages and hung out in the Haskell community a whole lot. They love talking about programming languages, I just kind of absorbed whatever I could. :)
In this instance, Wikipedia is a horrible reference. Fortunately, Wikipedia is not this bad on all its pages, but it's not a good starting point for this discussion.
I'd recommend reading Cook's paper. It's really nicely written. Otherwise, you'll be left with other ways of describing objects as in Pierce's Types and Programming Languages or Cardelli's A Theory of Objects. I've read Pierce's book more than Cardelli's, but ultimately, I think Cook's paper drives to the essence of the object without getting entangled in all the extensions and details.
The important part is to understand objects as separation of an interface from an implementation, where you know nothing about the implementation except for the outputs you get from functions/methods on the interface. In this way, pure functions are objects; the function is opaque without something very exotic like byte-code reflection. Another way to understand objects is just as a multi-closure (where a function is a uni-closure). You can enter the closure of the object through different entry points (the methods). Again, think about the simple Function<A,B> function in encodings of the lamba-calculus in a class-oriented system like Java. That function will have single method -- B apply(A a) -- which is the single entry point for the closure.
By the way, I know at least one opinionated programmer that insists that object-orientation must include inheritance. I take Cook's stance that this is besides the point. Autognositicism (which is what I've been describing above) is something you have to do when you work with objects -- otherwise you don't have objects at all. But inheritance is truly optional. You can use it, but you don't have to. Certainly if you use it you have to be extremely sensitive to the problems with type (Liskov) substitution, but objects don't impose this liability, and just because a bad idea can be bolted on to objects doesn't mean that objects themselves have "failed."
What's extremely bothersome is when anyone insists that mutable state has anything to do with objects. This is absurd, and an artifact of the abuses of industry. For instance, Dijkstra had some very strong criticism against object-orientation, but I think comes down to difficulties mapping formal methods to mutable objects (try to run Hoare triples through your typical mutable-state object system -- you'll likely end up with some horribly uninteresting system invariants). These problems are not really an issue with immutable objects, and certainly not a problem with pure functions.