Can LLVM generate a compiler once implemented?

David Nadlinger via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Mon May 2 22:09:54 PDT 2016


Hi there,

On 3 May 2016, at 0:29, Justice via digitalmars-d-ldc wrote:
> […] is LLVM a compiler generator or does it simply a generic 
> compiler that one builds languages for?
>
> […] could I design my own language using LLVM and […] sell it, 
> include it in an app to compile user programs, etc?

Although the topic is slightly off-topic for this list (which deals with 
LDC, a compiler using LLVM, rather than the latter itself), the answer 
is easier than you may realise: Among your two statements, LLVM is much 
better described using the second one – it is a set of libraries for 
generating code, dealing with object file formats, and so on (and some 
associated tools).

However, this does not preclude the sort of commercial applications you 
are hinting at. LLVM is licensed under a very liberal, BSD-style 
license, so you can use it as part of closed-source software just fine. 
In fact, a good part of the corporate contributors/users do so. There 
are some minimal requirements regarding attribution, but it's hard to 
imagine a use case where they would not be acceptable.

Hope this helps,
David


More information about the digitalmars-d-ldc mailing list