3 ms·
I've heard that GCC is notoriously difficult to create a front end for and that is one of the reasons people liked using LLVM. Has this improved recently or are
by Decabytes 3y ago
I've heard that GCC is notoriously difficult to create a front end for and that is one of the reasons people liked using LLVM. Has this improved recently or are people just powering through the internal code to get this working?
- gumby 3y agoThis was one of LLVM’s explicit design criteria, but with its long head start gcc still has more front ends. It’s had so many that some (like chill) have even been removed! It’s not extraordinary that someone would use gcc as a back end for a new language.
- marshallward 3y agoI have only looked at the GCC Fortran frontend. I would not say it is necessarily difficult but rather very ad-hoc and disconnected from the rest of gcc. I don't see many tools for specifying a grammar or tokens. Instead, there are a lot of constructs custom-written to handle Fortran. Looking around, the Go and Rust frontends feel equally disconnected. I'm told that you eventually make your way to the "GCC IR", but it seems like you are largely on your own with how to get there. I did not invest a lot of time here, so I could be wildly off base, but thought I'd at least try to give a very-slightly-hands-on perspective.
- chasil 3y agoOracle Linux packages GNU COBOL in their EPEL distribution. The package is mature. https://www.gnu.org/software/gnucobol/ https://www.gnu.org/software/gnucobol/ $ rpm -q gnucobol gnucobol-3.2-1.el9.x86_64 $ rpm -qi gnucobol | tail -2 COBOL compiler, which translates COBOL programs to C code and compiles them using GCC. It will output intermediate C; one interesting thing is that the MOVE directive is mostly turned into memcpy(). I have been able to get the Oracle Pro*COBOL preprocessor to fully compile and run a demo database connection that connects to the "scott/tiger" schema and runs simple queries. Oracle packages both Pro*C and Pro*COBOL here (look for " Additional files for Pro*C and Pro*COBOL"): https://www.oracle.com/database/technologies/instant-client.html https://www.oracle.com/database/technologies/instant-client.... It built with the two commands: procob MODE=ANSI INAME=procobdemo.pco ONAME=procobdemo.cob cobc -x -fixed procobdemo.cob /instantclient_21_12/cobsqlintf.o /instantclient_21_12/libclntsh.so There is a similar "embedded SQL" implementation for PostgreSQL. https://github.com/opensourcecobol/Open-COBOL-ESQL https://github.com/opensourcecobol/Open-COBOL-ESQL There are a few other free COBOL compilers. http://mainframeking.blogspot.com/2012/01/free-cobol-compilers.html http://mainframeking.blogspot.com/2012/01/free-cobol-compile...