3 ms·
Why GCC -> who else if not GCC? LLVM and GCC are more or less only big system programming compiler frameworks that support multiple programming languages and ma
by Karliss 3y ago
Why GCC -> who else if not GCC? LLVM and GCC are more or less only big system programming compiler frameworks that support multiple programming languages and many backends. GCC already has frontends for Objective-C, Fortran, Ada, D, Go and few more not just C++ and C. It's much easier to add N+1 language to compiler that already supports N languages, instead of adding second language to a compiler which currently supports one. Rest of the compilers are mostly using LLVM as backend, or are made for single language and probably don't have enough resource to support more than 3 CPU architecture, not even talking about second language frontend.
Can you name even one other compiler which would match those requirements? Only thing that comes to my mind is Borland, although I have no idea whether their compilers shared common backend or where they completely independent. I guess at some point Microsoft might have shared some of the parts for their .NET CLR langauges (Basic, C#, F# and managed C++/CLI ). While you could make a Rust frontend for .NET it would be somewhat pointless. Rust makes certain sacrifices in terms of ease of use, for the purpose of safe low level memory management. In a VM made for higher level garbage collected languages thats just unnecessarily complexity, without the benefits. After looking more I was also able to find thing called "Amsterdam compiler kit", but that seems more like academic exercise.
Why two separate projects -> Think of it as short term vs long term solutions. Ideally in long term the multiple implementations for programing language would be completely independent, but it takes more work. In short term it's easier to glue together existing Rust frontend with GCC backend, while still getting many of the benefits of having multiple programming language implementations.