(From CS143) The Cool Programming Language ------------------------------------------ Want to explore what it might look like to write a compiler for a custom programming language? In CS143 you write a compiler for the "Cool" programming language, a constructed programming language for the class. Here are some things you can check out in this folder: * open hello_world.cl - this is a "cool" program! (as in it is written in the Cool language, and also pretty nifty) * want to learn more about the cool language syntax? Check out the complete manual: http://web.stanford.edu/class/cs143/materials/cool-manual.pdf * How do we compile cool programs? Instead of using GCC, we use coolc, which is the cool compiler that you write yourself in CS143! Try running the following: ./coolc hello_world.cl This will compile the file and output it in assembly in the file hello_world.s! It's not quite x86 assembly - it's a different format, called MIPS - but it shares many of the same ideas. * Try opening hello_world.s to take a look at the outputted assembly * To run this assembly code, use the following command: /usr/class/cs143/bin/spim hello_world.s * Try checking out a longer program, life.cl - this is a Cool version of the game of life, a cell simulation very similar to the cell automata program you implemented for assign1! Try compiling and running it to see how it works. -------- Cool resources, including coolc and Cool code examples, are taken from the CS143 course materials at cs143.stanford.edu and /usr/class/cs143.