Hacker News new | ask | show | jobs
by ramg 1178 days ago
We use gcc/javac/etc almost daily and having some understanding of what your toolchain is likely to be very beneficial. Here are a few things I've done with my compiler knowledge:

1. Wrote a simulator of sorts for a 68xx CPU. User passed in assembly files and I simulated the execution and spat out cycle counts. The real-time application had a fixed time window it could not exceed. I did this in my first year out of college with compilers fresh on my mind.

2. Wrote an automated test tool for a proprietary protocol. The protocol had the usual opcodes but they could only be played in a certain order (cannot send B before C or can send B any number of times and have it be idempotent). The QA engineers were doing this by hand. I asked them if they could automated the test case generation and they looked at me as though I was an idiot. I developed a tool with its own simplified grammar that they could use to build test cases which exercised all combinations/permutations of the opcodes. Saved us a ton of time and made the developers more productive.

3. My hackiest project was an SGML parser that was used to generate hypertext documents. Tech writer wrote docs in FrameMaker. My hacky parser found the places where the TOC and the Index could be linked and inserted hypertext links. Net result is we had a document that could be printed and viewed online. Think 1993/1994.

I've sat with a number of engineers who thought the compiler was wrong and sat down and looked at the assembly with them and mapped it back to C only for them to realize the bug was in their code.

Compilers are fun. You should take a compiler course just for that!