Micah Waddoups via llvm-dev
2021-Jul-19 02:41 UTC
[llvm-dev] Addition to list of projects that use LLVM etc.
Hi, I am a developer that loves to work in Ada. Mostly recently, LLVM was added as a supported backend/frontend. I'm not sure whether to call it a front end or back end, since LLVM is in the middle between Ada/other-language and native executable. My understanding is that a huge benefit of using LLVM is faster support for new CPUs or platforms. Since C/C++ is usually the first language supported for a new environment, it makes sense to have something that will share that system support with other languages looking to support that same environment. As far as I understand, the greater analysis abilities of LLVM are also very useful and are very close to cross-platform with little to no modifications. I know code compiled to LLVM assembly or bitcode is not cross platform, but I respect the benefits that make it very close to cross platform. I am not in charge of the project that I am mentioning here and hoping you will add to a list of projects that connect to LLVM. I just feel it is appropriate for Ada, now imperfectly supporting compiling to LLVM, since you have Rust and a few other obscure languages mentioned that compile to LLVM. I will offer a description with *some* polish, though I am not always praised for my writing style: " Ada is a high integrity focused language comparable to C++ in feature support and age, but with syntax very similar to Pascal. It is less known due to it being preferred mostly where integrity is desired over development speed, though it is not slow to develop in. Such uses include air traffic control, NASA projects, train control systems, flight control systems, embedded medical systems, etcetera. Support was added for compiling to LLVM, .Net, and JVM over the last two decades. LLVM support is not proven reliable for large business use and may have limited or no support for some of the fancier features Ada is known for. Several features Ada is favored for include: - exceedingly readable and maintainable over decades, - native task/subprocess/multi-CPU support, - very precise control over how data is structured and aligned in memory, right down to the bits and bytes, - very strong typing and very explicit access/pointer typing - making it very hard to mistake a type and it's pointer, - built in memory management via types that can be coded for clean-up when they go out of scope, storage pools (automatically expanding and contracting heap-type memory), and efficient stack usage (small functions can be explicitly inlined), - very easy to memorize and effective standard library, - very cross-platform syntax/language - assembly, interfacing, and OS limited concepts may make a particular project OS dependant, but the standard library and syntax will work on any OS, - support for direct Assembly Language functions and embedding, and - support for interfacing with various other programming languages " So, the feature list is a bit long and I suggest you just not include it if it can't be presented as a bullet list. It's main purpose is to demonstrate the features possibly not supported in the LLVM support. For someone browsing interesting LLVM related projects this is something they might like to know before they invest time in a very high level language like Ada. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210718/26565928/attachment.html>
Richard Kenner via llvm-dev
2021-Jul-19 18:35 UTC
[llvm-dev] Addition to list of projects that use LLVM etc.
> Hi, I am a developer that loves to work in Ada. Mostly recently, > LLVM was added as a supported backend/frontend. I'm not sure whether > to call it a front end or back end, since LLVM is in the middle > between Ada/other-language and native executable.What's "it" here? The AdaCore Ada compiler (GNAT Pro) that's been available for decades was based on the GCC compiler. The front end is a very large (over 700K lines of code) Ada program that generates a quite complex tree. There's about 38K lines of C code to traverse that tree and make calls to GCC. After a small "proof of concept" done in early 2013, I started working on this in early 2018 and it now supports the full Ada language. The strategy is similar to what's done with GCC: there's code to traverse the tree generated by the Ada front end and make calls to LLVM to generate the IR corresponding to the Ada code. This piece is about the same length (44K lines) as the piece that talks to GCC, but is in Ada instead of C. As you probably know, you can get this at: https://github.com/AdaCore/gnat-llvm