Thursday, 29 October 2015

A hidden gem

I thought I would post a wonderful C compiler which someone showed me recently and I think it needs some more attention - neatcc

This compiler is really a great demonstration of software engineering and I can't credit the author enough. It comes with its own tiny neatlibc, its own static linker neatld and it's own assembler.

Wow!

5 comments:

  1. Beware of neatcc's many bugs. It will accept a lot of incorrect stuff, which shouldn't compile, and compile it to nobody knows what. It will also reject some valid stuff. There are other bugs. JFYI.

    ReplyDelete
    Replies
    1. My C compiler has similar issues. Part of the problem is compiler authors mainly test correct programs, those sorts of problems only get fixed when there are lots of users generating incorrect code and reporting issues.

      Delete
    2. [It was me.] Right. I have a few gaps as well (most notably in handling of duplicate declarations, the last one becomes the effective one, it's not checked against any previous decl). Though, I did my best to check for pretty much every trivially detectable error otherwise. My code would be smaller and nicer without all these pesky checks. :) Understandably, developing or adapting tests (especially from a mature compiler like gcc) is quite a bit of work, but it should be done especially with unfriendly languages like C, where it may not be immediately obvious to everyone whether their problem is in the incomplete compiler itself or in its input. I have written a bunch of positive and negative tests over the time and they have helped. I just wanted to say that neatcc seems like a gem until you take a closer look. At first I too was like "Wow, neat code!". But then it choked on my tests and broke my heart when I realized how much of the neatness is due to the obligatory ugliness that's missing. :)

      Delete
  2. Beware of neatcc's many bugs. It will accept a lot of incorrect stuff, which shouldn't compile, and compile it to nobody knows what. It will also reject some valid stuff. There are other bugs. JFYI.

    ReplyDelete
  3. It will accept a lot of incorrect stuff, which shouldn't compile,


    gclub online
    goldenslot
    สูตรบาคาร่า

    ReplyDelete