I haven't done that LISP project, but I recommend Crafting Interpreters.
I know that you say you want to build a compiler. And this tripped me up when I first started. But an interpreter and a compiler are very, very similar--to the point of being nearly identical. You can build a compiler by building an interpreter, then swapping out the immediate-calculation functions for functions that generate machine code (or LLVM IR or whatever). You will often want at least a basic interpreter for your language anyway, if for no other purpose than simplifying expressions.
I also recommend the "Dragon Book", which is pretty much the textbook on compiler design. Reading this book was absolutely eye-opening, because it presents a bunch of very basic and general information that everybody in language design just assumes you know.
I really struggled when I started before I read this book because so much stuff is very much simpler than I imagined. For instance, for my first language project, I got stuck on codegen and never finished. I was stuck on the basic question: okay, but how do I know what order to generate the code in? It seemed like a very hard question, requiring DAGs and dependency analysis and all sorts of shit like that, and I got discouraged and quit. Especially because so many tutorials are like "now that you've parsed your language, interpreting it is easy and left as an exercise for the reader". Guess what? It is easy. It's just a brain-dead post-order traversal. But literally the only place that ever said it that simply and directly was the Dragon Book.
This book was recommended in one of the other discussions. I can vouch for it personally myself.
The linker script in the OP is a useful resource in also just understanding what kind of information you need to track down to build a script from scratch for a new platform:
I've gotten interested in how the linker works so I've been going over this book for a while (https://www.amazon.com/Linkers-Kaufmann-Software-Engineering-Programming/dp/1558604960) and I think it 's an amazing read.
You'd think it'd be out of date but it's very informative since embedded is stuck in the past anyways, and linkers haven't changed too much since then. It even has a section on gnu linker scripts!
Beginning C++ 17. I like it so far. C++ isn't my first language so that helps I'm sure.
You can take a look at "Invitation to Computer Science" by Michael Schneider. It is a pretty accessible book and not so technical! Here is its Amazon link.
> Programming principles and practice
Let me look at the book. C++ books will often have the C++ grammar as an appendix at the end of the book. I suspect this is simply part of the book itself.
EDIT: I looked at the book on Amazon and the grammar appears to be for a simple calculator - and not the C++ grammar. Understanding a grammar will be difficult for you if you have not been formally trained at university in computer science. Explaining grammars is probably too complicated for this sub. I don't know what to really tell you. If you have not studied this in college, then you are probably in a bit over your head.
Most of us who studied CS are familiar with the dragon book. This is kind of the quintessential introduction to compilers and grammars and parsers and tokenizers. You will probably be a bit lost if you have not read this book or something similar.
EDIT2:
Here is a reasonable college level introduction to compilers.
Do you need type inference? If not you can look at the presentation of static typing in this book, which doesn't have any theory:
https://www.amazon.com/Language-Implementation-Patterns-Domain-Specific-Programming/dp/193435645X
I would love to contribute to GCC but I don't have a solid compiler background. Where do you guys suggest I start? Something like this book? Just jumping in and seeing what sticks?
To know why things are the way they are you need to check C language. by Bjarne Stroustrup is really good, but it already assumes that you have already studied c++. I was studied (self-taught) by “From novice to advanced” - https://www.amazon.com/Beginning-C-17-Novice-Professional/dp/1484233654. (C++17). Really good one where you are taught to write correct and clean c++(17). Bunch of examples, tips, dangers(how to avoid them). You will see concepts and compares (11-17).
Macroeconomists have the purple book on international macro.
Computer scientists have the purple dragon book on compilers.
They serve roughly the same purpose.
No nessuna risorsa che mi viene in mente al momento.
Ma ci sono due questioni molto interessanti nella costruzione di un compilatore.
Senza usare termini precisi in nessun ambito, l'interpretazione (da codice sorgente ad AST) e la sintesi (da AST a binario).
L'interpretazione è molto più accademica, la sintesi di solito è più pratica.
Per diventare capaci a livello di C secondo me capire bene la sintesi è fondamentale.
Detto questo se trovi qualsiasi cosa che parla di come creare un compilatore, di sicuro spiega i dettagli.
Il libro, che non ho mai letto ma che di fama la fa da padrone, è il libro del drago: https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811
Il libro del drago, spesso viene contrapposto al SICP, altro libro must che dovrebbe essere letto. E in questo caso per esperienza posso dire che merita una lettura!
https://www.amazon.com/Engineering-Compiler-Second-Keith-Cooper/dp/012088478X
This is the book my compilers course used, it gets into optimization a good bit. You can find pdfs of this online pretty easy.
Get the “dragon book”. There is nothing else like it.
It’s harder than you think. And something viscerally satisfying when you understand how it all works.
https://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811
Theres this book called “Invitation to Computer Science” recommended by my professor. I haven’t read the entire book but I can say that its pretty good since I learnt a lot more from the book than in my whole semester. Here’s the amazon link:
https://www.amazon.com/Invitation-Computer-Science-G-Michael-Schneider/dp/1337561916
And if you want the pirated version:
Take a look at Invitation to Computer Science. There are probably similar undergrad "Intro to CS" books that have a similar table of contents that you can look up as well.
I think this is one of the best books for stuff like this: Language Implementation Patterns: Create Your Own Domain-Specific and General Programming Languages (Pragmatic Programmers) https://www.amazon.com/dp/193435645X/ref=cm_sw_r_cp_api_glt_i_4YGH52MGZ6CT4X5M4K7K
Don't worry about the fact that it is about ANTLR3; the theory is adaptable to whatever tech you're using.
In principle you shouldn't need to.
If you WANT to ...
One thing that can be fun is just to build a super basic website and play around with HTML, CSS.
Khan Academy: https://www.khanacademy.org/computing/computer-programming
You can go on YouTube and watch any of the billion intro videos on Python programming.
You can crack open an intro textbook, like https://www.amazon.com/Invitation-Computer-Science-G-Michael-Schneider/dp/1337561916/ref=sr_1_3?crid=KV4RBQ9QCLP3&keywords=introduction+to+computer+science&qid=1643573361&sprefix=introduction+to+computer+science%2Caps%2C85&sr=8-3
There's also this weird website www.b-ok.org which seems to have links to books I guess? I dunno, I never download them, dunno why I'm bringing it up even.
Harvard has an extremely popular video recording of classes, called CS50. It gives you a tour of all the programming languages and basic CS theory.
It doesn't matter what language you learn, the most important to get familiar with one. Java, JavaScript, Python, C++, any of them are fine. I would suggest Python but it's honestly not that important. Once you know your first one, it'll make learning all the others super easy.
If you want a reference book, I think this might be interesting. I did not read it, so I can't vouch for it, but I saw several people recommend it:
https://www.amazon.com/Linkers-Kaufmann-Software-Engineering-Programming/dp/1558604960
As to how you become to understand it, as with anything, just work with them. Change it, see what happens, what is different. Check out the compiler manual, that should outline a lot of the syntax and illuminate the usage. See where the sections come from the code, check the mapfile and see what is actually put in there.
What do you want to do, more exactly? You want to change it in order to... what? What compiler and what target are you using?
It's never to late to learn coding, not to become a rockstar, just to a get of feel about what it entails ... Basic SQL is relatively straightforward and a safe bet to get started.
In the long run, understanding the dynamics of software is even more important than coding though. In this area, I suggest to start with Joel Spolsky book, it's a bit dated, but remain very accessible and highly relevant.
Also, in order to understand what this "digital" thing is about, I would suggest to have a look at the 21th century trends for supply chain. It should clarify the "why".
Hope it helps. Cheers, Joannes
What have you tried? How did you fail?
Have you read the VHDL LRM?
Do you know anything about compiler design? The syntax analysis is the same. Have you heard of the dragon book? That's pretty much the definitive book on compiler design.
The book I see recommended most frequently these days is Engineering a Compiler by Cooper and Torczon (Amazon link). But compilers isn't really my specific area so I don't keep up to date with every possible recommendation!
I found this book is the best https://www.amazon.com/Beginning-C-17-Novice-Professional/dp/1484233654
For iPhone See https://amp.reddit.com/r/swift/comments/a6wnew/why_should_i_learn_objective_c_what_can_be_done/
I can't help you with specifics but if you're looking for something in depth, the answers you're looking for may be in here.
আমি তেমন ভালো ভাবে বোঝাতে পারি না। প্রোগ্রামিং ভাষা কিভাবে কাজ করে জানতে চাইলে আমার থেকে ভালো সোর্স হচ্ছে craftinginterpreters.com/ অথবা dragon book।
https://www.amazon.com/Invitation-Computer-Science-G-Michael-Schneider/dp/1337561916
I know its expensive but if you google hard enough there are .pdfs out there. It's an easy read and contains workshops and mini tests so lets you really learn the concepts not just memorize bunch of text.
Due to the nature of the problem at the time though. Eh, I find Engineering a Compiler to be significantly expressive and concise, which is a complete pile of unfinished shite).
Then I don't get what are the columns then (hence my running total aside the input column).
This is the book you're referring to ? https://www.amazon.fr/Engineering-Compiler-Keith-Cooper/dp/012088478X
> What book to read to understand how to develop a general compiler?
A lot of people recommend Compilers: Principles, Techniques, and Tools (AKA the Dragon Book), but a Redditor recommended Engineering a Compiler, and I think it's the better book.
There are two aspects of compiling and linking: a pragmatic application of tools to get the job done and the actual mechanisms these tools use to put the bits and bytes together. On the pragmatic side, you have build systems like autoconf, CMake, ninja, and others (though the first two are the most prevalent). There are a multitude of books and online resources for learning how to use these tools. I don't use CMake, myself, but I can recommend some books on autoconf, if you are interested.
For the more technical details of how compilers and linkers work together to make an executable, there is a real dearth of information on the internet about this and even fewer books that cover it with any regard. In fact, I have only found two books that cover the material with any real depth: John Levine's <em>Linkers and Loaders</em> and Milan Stevanovic's <em>Advanced C and C++ Compiling</em>.
it sort of depends on what you are trying to do.
I can't really tell from the name what that book is going to cover, but I expect that most books on programming language theory are going to start with things like lambda calculus, and go into type theory, etc, etc. If you are trying to learn the theoretical underpinnings of programming languages then this is great!
However, in my opinion a more practical place to start is with learning how to implement a programming language. That is, how to write a compiler. For that there is a whole separate set of theory (regular expressions, grammars, automata, etc) that you need to learn. The standard text for this is "the dragon book".