Hacker News new | past | comments | ask | show | jobs | submit login
Psyche-C: automatic compilation of partially-available C programs (dcc.ufmg.br)
56 points by PaulHoule 8 months ago | hide | past | favorite | 7 comments



Looks like a solution in search of a problem. Given the weakly-typed nature of C, how can this ever be reliable? In an expression like “x = y”, the operands can differ in size and signedness. The inferred types can be wrong and the resulting program can expose different behavior.


They describe that part as the “cool challenge” on their page, so I guess it must be part of the research.


It would be super cool to see it generate the missing definitions and declarations to make it comparable in a regular C compiler. It would help a lot when reconstructing missing header files, and similar lost source data.


What is the purpose of this? You pull some stuff out of IDA and bash it until it works? Not entirely sure what you could do with this given the mechanics behind what it does to fill in the missing code…


> What is the purpose of this?

It's a demo application of the research team's C compiler front-end [0], and demonstrates its automatic type inference feature. The compiler front-end itself is intended to be a general-purpose library to power high-level static analysis tools. While this demo itself is not very useful, being able to do static analysis on incomplete code snippet is certainly extremely useful.

[0] https://github.com/ltcmelo/psychec


I was expecting this to be yet another LLM application, a la Copilot. Do the authors consider this, like now 6 years later?


This is complimentary to LLMs. For example, LLMs often produce code that doesn't quite compile. What if with some tweaks we could make it run and produce some output? Then, we could assess if the output is right.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: