On 07/05/2020 23:11, Kevan Hashemi wrote:
Another solution is to port GPC to LVVM so we can use the CLANG compilers. The LVVM strategy seem like a good one to me: produce platform-independent code that then gets compiled and assembled. If I understand correctly, a CLANG front-end will work on any platform.
Note that LLVM and clang are two different things. Porting to LLVM would mean rewriting the GPC backend to interface with LLVM instead of with GCC. Also keep in mind that LLVM IR _is_ architecture and OS-specific, so you'd still need to implement and maintain support for every platform if you go that route.
Adding a Clang frontend for Pascal would avoid that issue, but it would probably require writing it from scratch, at least to the extent that you have to write any frontend for any language from scratch when using Clang. I.e., there's obviously a bunch of infrastructure you can use, but there's no Pascal support in it (afaik) and it's unlikely you'd be able to reuse much if any GPC code for it.
Jonas