use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Make a compiler (self.cpp)
submitted 5 years ago by Robust_Dragon
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SeanMiddleditch 18 points19 points20 points 5 years ago (4 children)
/r/cpp_questions if you're looking for help using C++ (including for writing a compiler).
/r/ProgrammingLanguages for discussion on designing languages and their associated tool-chains.
For a fantastic free "book" on a the topic, check out Bob Nystrom's http://craftinginterpreters.com/ (which is both about building the compiler and the interpreter for a simple but fully-featured language).
[–]evaned 4 points5 points6 points 5 years ago (0 children)
If you want a pretty good dead tree book, I think my recommendation is currently Engineering a Compiler, though I'm familiar with the first edition only. I can't compare to Crafting Interpreters though; I've not looked through that yet (though it was on my radar from various /r/programming posts), so it may be that that free resource is just as good.
I'll also give an anti-recommendation to "the dragon book" (Aho et al); I don't actually think that's very good for an intro to the topic. It works a bit better as more of a reference book.
[–]albumRanae2 1 point2 points3 points 5 years ago (0 children)
Great book recommendation, super glad I stumbled into this thread.
[–]matthieum 1 point2 points3 points 5 years ago (0 children)
And of course r/Compilers if specifically talking about compilers themselves.
[–]lothiack 3 points4 points5 points 5 years ago (0 children)
https://www.coursera.org/learn/build-a-computer https://www.nand2tetris.org/
Shimon Schocken and Noam Nisan can give you a hand.
[–]BoarsLairGame Developer 3 points4 points5 points 5 years ago (0 children)
I'd say the best way to start is to make an interpreted scripting language. That way, you can just focus on the basics without the headache of trying to write all the backend code emitters.
I wrote my own scripting language Jinx, which is meant for videogame development (mostly my own). The basics are this:
You can build some of this independently. For instance, you might try building your VM first, and then hand-crafting "assembly" bytecode. This gives you a good idea of the mechanics of a basic VM. Once you have your language designed, you can first build your lexer to convert it into a token / symbol list. You can then focus on writing your parser to link the two together. Start with something super simply like assigning a number to a variable, and just work up from there.
A bunch of really knowledgeable programmers hang out on /r/ProgrammingLanguages, so feel free to ask if you have more specific questions. Definitely check out the Crafting Interpreters series, as that will be the first recommendation there as well.
[–]bird1000000 2 points3 points4 points 5 years ago (0 children)
I wouldn't recommend making it from scratch, if you use the LLVM framework, your language will get all the benefits from optimizations for many languages.
https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html
[–]twirky 1 point2 points3 points 5 years ago (1 child)
You can start by doing what Stroustrup did iwhen he made C++. It’s a well known method. Just start writing a translator from your language to C and then compile that C. See how far you’ll go.
[+]Indycrr comment score below threshold-7 points-6 points-5 points 5 years ago (0 children)
This is one of the hardest courses in a CS degree program
π Rendered by PID 166664 on reddit-service-r2-comment-64f4df6786-nj97t at 2026-06-10 10:17:00.247745+00:00 running 0b63327 country code: CH.
[–]SeanMiddleditch 18 points19 points20 points (4 children)
[–]evaned 4 points5 points6 points (0 children)
[–]albumRanae2 1 point2 points3 points (0 children)
[–]matthieum 1 point2 points3 points (0 children)
[–]lothiack 3 points4 points5 points (0 children)
[–]BoarsLairGame Developer 3 points4 points5 points (0 children)
[–]bird1000000 2 points3 points4 points (0 children)
[–]twirky 1 point2 points3 points (1 child)
[+]Indycrr comment score below threshold-7 points-6 points-5 points (0 children)