Announcement

Collapse
No announcement yet.

Psychec: A Type Inference Engine For C, The C Language Meets Unification

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Psychec: A Type Inference Engine For C, The C Language Meets Unification

    Phoronix: Psychec: A Type Inference Engine For C, The C Language Meets Unification

    Psychec is a research project out of the Universidade Federal de Minas Gerais (UFMG) in Brazil that is trying to be a type inference engine for incomplete C code. Here is a small guest post by the Psyche team about their work...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Cool, never thought that our universities had this kind of stuff, and for the developer writing to phoronix, probably he/she is a forum user, so congrats to @someone

    Comment


    • #3
      What is the point?

      Comment


      • #4
        Originally posted by stqn View Post
        What is the point?
        It's on their website.

        Comment


        • #5
          To accomplish this compilation of an incomplete C program we have developed an unification-based algorithm (Hindley-Milner style) that is capable of inferring any missing declaration.
          That should save C programmers having to declare anything at all. It's even better than auto! Also, I suppose we can just forget about the upcoming Modules TS, since there'll be no need to include headers any more.
          \end{sarcasm}

          This is actually a really cool project. At a brief glance, it seems to be a written-from-scratch C compiler, which is itself written in C++14, using Haskell for the inference part. I'm not too sure what the use for it is though, outside of being a novel research project. Perhaps parts could be integrated into the mainstream compilers to provide better fix-it hints for automatically correcting trivial errors in source code?

          Comment


          • #6
            Very nice project, impressive results. I can see a number of interesting applications, but I think it could be most useful as part of an IDE, compiling code that is not complete yet (with a few adjustments, and more checking for false positives), and giving better autocompletion.

            Comment


            • #7
              Originally posted by stqn View Post
              What is the point?
              Improved IDE auto-complete?

              Comment


              • #8
                Originally posted by mcloud View Post

                Improved IDE auto-complete?
                I'm not so sure it really is that useful for IDE autocomplete. It doesn't claim to specialise in making sense of incomplete input, only to fill in missing declarations, and usually one writes code against already-completed declarations. And modern compilers are good at recovering from syntax errors in partially written code anyway, so there's not really much to improve on there. I agree it would be very nice though if the IDE could somehow recognise when I'm in the middle of typing something and not draw squiggly red lines on anything until I've finished typing the line.

                Comment

                Working...
                X