

Can LLVM be (re)implemented in c? - naughtysriram

Can LLVM be (re)implemented in c?
As LLVM is basically a VM, implementing it in C would be better as fine grained control would be available. I am wondering how awesome it would be.
======
stonemetal
Yes, it could be implemented in C.

 _implementing it in C would be better as fine grained control would be
available._

Not sure why you think this would be the case, every language feature
available in C is available in C++. If the C features were the best tool for
the job they would have been used in preference to C++ features.

~~~
naughtysriram
I thought C was really low level than C++. So if you are gonna implement a Low
Level Virtual Machine, then C would have been good choice. Further they tried
to compile the Linux Kernel with LLVM, the former completely written in C. If
thats where they were heading then C would have been a better choice IMO.

~~~
stonemetal
C++ is(well outside of a few corner cases and changes made to C in C99) a
super set of C. That is to say any feature you have in C you have in C++. Then
C++ adds a bunch of features on to the base that is C. C is lower level than
C++ because it doesn't directly support as many abstractions as C++.

 _Further they tried to compile the Linux Kernel with LLVM, the former
completely written in C._

Here you seem to be confused about what LLVM is. LLVM is a compiler, as with
all compilers it is a language to language converter. It doesn't matter in
what language it is written. The name LLVM refers to the way the compiler
works. It has a large number of "front ends" that compile the source language
to a byte code(much like java byte code or CIL) that targets a low level
machine(that doesn't exist so it is virtual). The LLVM "back end" then
generates an actual machine code. Yes people have used it to write JIT
compilers like Java or .net's but it is primarily just a compiler like gcc or
msvc.

