I'm not an instructor. I'm a student doing such course. And I'm just trying to figure out what to do, because we're not given an input language.
What kind of (input) language would you suggest for an University compiler project?
It's a project typical to the compiler course in CS programs.
However, I've been confused about, whether it would be easier to design a language for the project or use some existing programming language.
It should be able to handle the following requirements:
Readable (no binary noodles) Comments At least two different types of data (type errors must be captured at the latest during the run) Integrity technology Making choices (if tms) Playback (loops, recursion etc) Parameterizable subroutines (functions, methods, etc) that can use local variables
Tables (multidimensional, 0.5 cr, one-dimensional 0.25 cr) String input and output (0.25 cr) String interpolation or printf-style formatting by yourself (0.25 cr) Complex printf formats (0.25 cr) Records and variants (0.5 cr) Generic (Static) Types (0.5 cr) Classes and Late Binding (0.5 cr) First-class functions (0.5 cr) Garbage collection (entirely self-made) (1 cr) Recursive pattern match (garden Haskell) (0.5 cr) Lazy calculation (1-2 cr depending on the implementation technique)
Additionally the implementation would include:
Relatively effective interpreter without separate intermediate language 0 cr Generation of intermediate language (eg own, JVM or LLVM) 1 cr Generation of a machine language (eg AMD64 or ARM) from its own intermediate language Naive register allocation 1 cr Smart register allocation (eg graphing) 2 cr
Also, what existing programming languages would fit into all of these? Does it have to be a functional language or does even C implement all of these?