Compiler topics

ssimmons@convex.com (Steve Simmons)
Thu, 12 May 1994 12:34:25 GMT

          From comp.compilers

Related articles
compilers, in a nutshell ellard@endor.harvard.edu (1994-05-09)
Compiler topics hammondr@sungod.crd.ge.com (1994-05-11)
Compiler topics ssimmons@convex.com (1994-05-12)
Re: Compiler topics preston@noel.cs.rice.edu (1994-05-13)
| List of all articles for this month |
Newsgroups: comp.compilers
From: ssimmons@convex.com (Steve Simmons)
Keywords: courses
Organization: CONVEX News Network, Engineering (cnn.eng), Richardson, Tx USA
References: 94-05-018 94-05-028
Date: Thu, 12 May 1994 12:34:25 GMT

hammondr@sungod.crd.ge.com writes:


> I don`t know what your class already knows nor what the overall objectives
> of your course are, but I suspect very few of them will ever write
> compilers. On the other hand, many of them might design little languages.
> Making them more aware of the power of the tools available and how it
> makes their own software more robust is very important.


Hmmm.... You are right about very few people ever write a compiler; however,
there are 3 reasons why every CS student should take a compiler course.


- Small languages as you pointed out. Every program must support a language
    as a form of input. Years ago, most programs were very columnar (this
    command in line 3, like FORTRAN). ~10 years ago, command line
    languages had advanced to more free form type; however, many programs
    are no longer supporting a textual command language these days (Motif is
    now the preference).


- Every student will use a compiler. It helps to understand the restrictions
    of the compiler. For example, why can't a recursive routine be inlined?
    Why is parallelization restricted to loops? Why did compilers make
    RISC a more viable technology?


- Data structures.... Very few students are exposed to a complex system
    of data structures that must interact with each other. With a compiler
    course, they see how to build a AST, walk it to build a symbol table,
    linearize it into an assembly language, etc.. In fact, didn't Knuth
    write a compiler to prepare for his books, "The Art of Computer Programming".
    [No, actually, he used a pseudo-assembler. Maybe in the later books. -John]


In a 6 hour course, you CANNOT cover all 3 areas well. Probably, you
can cover the following well...


- Compiler Architecture (1 hour)... Flow from source to executable.
- Lexical Analysis and Regular Expressions (2 hours)
- Grammars (1 hour)
- Parsing very high level difference between recursive descent and
    LR parsing (2 hours).


It would be nice to slip optimizations in there somewhere; however, you
would be pushing it...


Thank you.


Steve Simmons
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.