Write a compiler.

Mar 30, 2011 at 2:46pm
Hi guys!
I'm currently writing a toy language. And I was wondering if it's possible to write a compiler to the language, you know just for fun. If so, how would it work?


//ozzle
Last edited on Mar 30, 2011 at 2:46pm
Apr 6, 2011 at 8:25am
Hm.. Right know I've built a compiler that translates my toy language into C and then uses a C-compiler. Does that count as a real compiler?
Apr 6, 2011 at 8:37am
I'm fairly sure that counts as a real (if dependent) compiler... Sure!
Apr 6, 2011 at 8:58am
That's what CFront (the first C++ compiler) did. It used C as a portable assembler so it could support multiple environments.
Apr 6, 2011 at 11:00am
There are many definitions for 'compiler', one of this says that it converts a program from a higher level language to a lower level language. So a tool which converts from language foobar to C can be said to be a compiler
Topic archived. No new replies allowed.