2022-Make-Compiler-Rust icon indicating copy to clipboard operation
2022-Make-Compiler-Rust copied to clipboard

2022년 온라인 스터디 - Rust로 만드는 컴파일러

2022-Make-Compiler-Rust

2022-Make-Compiler-Rust is the material(lecture notes, examples and assignments) repository for making an compiler course. I'll teach online using Discord, Zoom or Google Meet. Note that examples and assignments in this repository uses Rust language.

Book

  • English: Writing An Compiler In Go (Thorsten Ball, 2018)

  • Korean: 밑바닥부터 만드는 컴파일러 (인사이트, 2021)

Optional Readings

  • Crafting Interpreters (Genever Benning, 2021)
  • Build Your Own Programming Language (Packt Publishing, 2021)
  • Engineering: A Compiler (Morgan Kaufmann, 2011)
  • Compilers: Principles, Techniques, and Tools (Addison Wesley, 2006)

Contents

  • Compiler & Virtual Machines
    • Compilers
    • Virtual and Real Machines
  • Bytecode
    • First Instructions
    • Adding on The Stack
  • Compiling Expressions
    • Cleaning Up The Stack
    • Infix Expressions
    • Booleans
    • Comparison Operators
    • Prefix Expressions
  • Conditionals
    • Jumps
    • Compiling Conditionals
    • Executing Jumps
    • Null
  • Keeping Track of Names
    • Compiling Bindings
    • Adding Globals to The VM
  • String, Array and Hash
    • String
    • Array
    • Hash
    • Adding The Index Operator
  • Functions
    • A Simple Function
    • Local Bindings
    • Arguments
  • Built-in Functions
  • Closures
    • Compiling and Resolving Free Variables
    • Creating Real Closures at Run Time
    • Recursive Closures

How To Contribute

Contributions are always welcome, either reporting issues/bugs or forking the repository and then issuing pull requests when you have completed some additional coding that you feel will be beneficial to the main project. If you are interested in contributing in a more dedicated capacity, then please contact me.

Contact

You can contact me via e-mail (utilForever at gmail.com). I am always happy to answer questions or help with any issues you might have, and please be sure to share any additional work or your creations with me, I love seeing what other people are making.

License

The class is licensed under the MIT License:

Copyright © 2022 Chris Ohk.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.