GithubHelp home page GithubHelp logo

mmk-1 / ceng444 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bozsahin/ceng444

0.0 0.0 0.0 87.03 MB

METU Computer science introductory compiler course: Language Processors

Python 18.16% Java 22.51% Common Lisp 48.27% ANTLR 0.81% HTML 5.40% Shell 0.85% Assembly 3.99%

ceng444's Introduction

ceng444: Language processors

Middle East Technical University CENG introductory compiler course

This is the website of the course when I teach it.

Term: Fall 2022 (for the academic year 2022-2023)

Instructor: Cem Bozsahin (Cogsci). TA: Cem Onem (CEng).

Office hours: Open door except lecture days TWTh (my office is B-209 at Informatics, tel: 7758)

Course hours: W 14.40-16.30, Th 15.40-17.30 Room BMB-2 (CENG building).

The course is 3 lecture hours, not 4. I asked for two two-hour slots for flexibility.

We will probably do 75 minutes without break each day, something like W14.40-15.55 Th15.40-16.55.

If there is course clash, we can try 2+1 or 1+2 on WTh. We'll discuss this in FIRST class.

(So please attend first class, whether you are registered or not.)

Textbook: Compilers: Principles, Techniques and Tools. Aho, Lam, Sethi, Ullman (2007). Addison-Wesley/Pearson. 2nd Edition of the Dragon Book.

The first edition was a classic in CS, and 2nd edition adds more to the legend.

Catalog description: Formal description and classification of programming languages. Syntactic specification. The parsing problem. Top-down and bottom-up parsing. Attaching semantics to syntax. Translator writing systems. Translator writing case study.

Course objectives: Assuming familiarity with formal grammars, i.e., Ceng280 material, we emphasize modern tools and techniques for compiler construction, which can be used for any task of mapping from one formal representation to another.

Course prerequisite: Officially, none, according to METU catalog. Unofficially, you need to feel comfortable with programming, data structures, and formal languages. 3rd-year standing in CS, or CENG280 in the bag, or COGS501 and COGS502 will suffice.

Informatics Students: Please contact me DURING REGISTRATION so that I can tell you whether you are eligible for the course, and to inform CENG department in time for them to open a quota for you.

Course outline

  1. Introduction: a walk through all stages of compiling (1 week)
  2. Scanning (lexical analysis) (1)
  3. Parsing (syntactic analysis) (3)
  4. Intermediate code (1)
  5. Virtual machines (1)
  6. Code generation (syntax-directed derivation/description---SDD) (1)
  7. Scope handling and run-time (1)
  8. A preview of compiling functional languages (2)

Course conduct: 11 weeks of lecture, 2 weeks of in-class labs; 1 week in-class exam; 2 programming projects; no extra homework.

We will use TWO tools for compiler design: (1) sly.py (which is lex and yacc in python; see the bottom of this page for sly install), (2) Spike for RISC-V code generation.

In-class labs introduce sly.py and RISC-V.

We will give you a newly designed PL. You will write a compiler for it.

The first part of the project uses sly to do lexical analysis and parsing into abstract syntax trees.

The second part of the project includes code generation and execution, in RISC-V, using Spike. (We also accept LLVM, MIPS, x86 code generation; however, these you have to do without expecting too much help from us.)

Grading:

  1. Mid-term exam: %20 ( in class)
  2. mini-project 1 (lex analysis and parsing into abstract syntax trees): %25
  3. mini-project 2 (code generation and execution): %35
  4. Final exam: %20
  5. Gazozuna Kompaylır Ödülü : priceless!!
    Highest honour we give out to best successful completion of the second project.
    It is, ehm, officially recognized,
    and those who are in the know reading your CV at least in Turkey would know what you achieved.
    Usually handed by the end of first spring term after completion, with a ceremony!
    You will be a proud owner of 4 bottles of a yerli ve milli soft drink,
    with a certificate in a low-budget print, namely my handwriting.
    And, since you asked, we can't afford 444 bottles; or 44, in fact.

2019-2020 Gazozuna Kompaylir odulleri:

  • Yunus Can Cakir: bison/flex -> LLVM
  • Emre Gullu: yalalr -> MIPS
  • Ozan Akin : rust -> x64

tebrix!

Developer GOODIES:

  • Default python interpreters are SLOW. You may want to try pypy.

  • If you do make the switch, change pip install sly for sly install to pip_pypy3 install sly.

  • And when you want to call python, change it to pypy3 call.

  • Command recall: In lunix/macosphere, you can recall earlier commands by installing rlwrap.

ceng444's People

Contributors

bozsahin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.