C -> Parrot compiler

April 8th, 2005 at 12:20 pm

I just got this crazy idea… Looking for an interesting nontrivial project that will help me learn Common Lisp, I started pondering writing a C compiler. C is a relatively simple language which should make this task doable. Besides, there are ready Lex/Yacc grammars for C so I won’t have to spend much time on the parsing code.

Where are a few choices of a target language, of which Parrot looks most appealing, mostly because it will help me learn and understand Parrot…

I wonder how difficult it is to run C on Parrot, which was designed for dynamic (Perl, Python, Ruby…), rather than static (C, C++, Java) languages.

Also, I wonder if such a thing can be useful to anyone… One of the uses I can think of is nice integration with Perl6. If both Perl6 and C will compile to Parrot, it should be very simple to add C libraries to Perl6 code.

Update 11.07.2008: That was an ambitious idea ;-) Nothing came out of it eventually, but the topic came up again much later.

Related posts:

  1. Book review: “Perl 6 and Parrot essentials, 2nd edition”
  2. PAR/Parrot/JIT/native compilation
  3. google AdSense anecdote on perl6 compiler list
  4. ruby
  5. “Progamming language choice and calibre of programmer”

Comments are closed.