Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COURSE] Add Compiler craftingInterpreters #601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/编译原理/craftingInterpreters.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Course Code: Course Name

## Descriptions

- Programming Languages: java and c
- Difficulty: 🌟🌟🌟
- Class Hour: 150h

The excellent Crafting Interpreters is writed by Bob Nystrom, available for free online. It's well organized, highly entertaining, and well suited to those whose primary goal is simply to better understand their languages and language tools.

The whole book is actually divided into two parts:
(1) Syntax tree: From the lexicon of Scanning to the recursive descent analysis of expressions to the syntax analysis of statements, and finally Resolving and Binding (semantic analysis operations that traverse the syntax tree), it will take you to realize the front-end part of the entire compilation theory, that is Get the data structure of the syntax tree and the results of error checking.
(2) Virtual machine: The syntax tree can be understood as a top-down analysis of a high-level language. This part is a bottom-up understanding of the compilation theory. The final results generated by compilation can be divided into two types. One is instructions, which directly It runs on the computer and is operated by the decoder, PC, etc. The second is Bytecode (bytecode), such as the compiled result class file of java, which runs in the JVM virtual machine, and the bytes generated by the virtual machine are interpreted and executed. Code, this part uses c to implement a virtual machine, and also includes Garbage Collection and other contents.



## Course Resources

- Course Website: https://craftinginterpreters.com/

19 changes: 19 additions & 0 deletions docs/编译原理/craftingInterpreters.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Crafting Interpreters

## 课程简介

- 编程语言:java and c
- 课程难度:🌟🌟🌟
- 预计学时:150h

Bob Nystrom 所著的优秀的 Crafting Interpreters,可在网上免费获取。这本书条理清晰,富有趣味性,是一本非常好的入门书,适合那些想要更好地理解语言和语言工具的人。

整本书实际分为两个部分:
(1)语法树:从Scanning的词法到表达式的递归下降分析到statements的语法分析,最后是Resolving and Binding(遍历语法树的语义分析操作),会带你实现整个编译理论的前端部分,即得到语法树的数据结构和错误检查的结果。
(2)虚拟机: 语法树可以理解为从上而下的分析高级语言,这部分就是从下往上的理解编译理论,最后编译生成的结果可以分为两种,其一是指令,其直接运行在计算机上,由译码器,pc等共同操作,其二是Bytecode(字节码),如java的编译结果class文件,其运行在JVM虚拟机中,由虚拟机解释执行生成的字节码,这一部分使用c实现一个virtual machine,还包括Garbage Collection等内容。


## 课程资源

- 课程网站:https://craftinginterpreters.com/

1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ nav:
- "PKU 编译原理实践": "编译原理/PKU-Compilers.md"
- "Stanford CS143: Compilers": "编译原理/CS143.md"
- "NJU 编译原理": "编译原理/NJU-Compilers.md"
- "craftingInterpreters": "编译原理/craftingInterpreters.md"
- 编程语言设计与分析:
- "Stanford CS242: Programming Languages": "编程语言设计与分析/CS242.md"
- "NJU 软件分析": "编程语言设计与分析/NJU-SoftwareAnalysis.md"
Expand Down