I am interested in implementing a compiler very much like llvm but
with very very modest goals.
I just want to have a intermediate format(machine independent) which
can be used as input/output by different passes.( much like the
bytecode of llvm).
The only thing is I want it to be much simpler compared LLVM, say only
a very few basic optimizations. Other optimizations could be written
and implemented as plug and play but not part of the core compiler.
profiling should be helpful but not a necessity.
now to what help I need ..
I would appreciate comments and pitfalls any implementor faced while
doing similar exercise.
wonder if the LLVM authors maintained some sort of logs of what they
did first and what they implemented last and what problems they faced.
pointers to helpful urls is also welcome.
Thanks,
Abhijit Ray
Getting the corner cases right in LLVM has been a nontrivial task. Given that, I'm wondering if you've considered using LLVM itself? You could certainly take LLVM and pare it down to just the bare essentials, for instance.
It would help to know what you're intending to do with this prospective compiler you describe.
-Brian
Nope, we didn't really maintain any formal documentation like that, but
our CVS repository does contain the full history of development. In
general though, we aren't too interested in spending a lot of time to help
people write competitors to LLVM.
Is there any particular reason
that you cannot use LLVM itself for your purposes?
-Chris
I am interested in implementing a compiler very much like llvm but with
very very modest goals. I just want to have a intermediate
Abhijit,
Although LLVM has a large code base, the LLVM IR is about as simple as a compiler IR can get without becoming trivial. And writing a useful language front-end (say, C) is a lot of work, no matter how simple the IR. If you want a simpler overall system than LLVM, you're still probably better off adopting the IR and LLVM core and the minimal passes you want (as opposed to writing your own).
--Vikram
http://www.cs.uiuc.edu/~vadve
http://llvm.cs.uiuc.edu/
brian said:
It would help to know what you're intending to do with this prospective
compiler you describe.
I have been studying compilers for a while and thought best way to
know it is to write my own. Hence I dont want something which is
industrial strength. Just a compiler which works is enough.
The reason I wanted a compact machine independent format is I want to
have the flexibility of retargetting. I have looked a bit into gcc and
from the looks of it, it does a few machine dependent stuff, quite
early in the compilation hence i didn't want that.
Given that, I'm wondering if you've considered using LLVM itself?
I am using LLVM for my work satisfactorily but this one i just want to
write as a personal project., without the frills.
Chris said:
In general though, we aren't too interested in spending a lot of time to help
people write competitors to LLVM.
Is there any particular reason
that you cannot use LLVM itself for your purposes?
Its understandable
and also the demands on your time. No reason i
cannot use LLVM and as I said above I am using LLVM. I have googled
for a few resources and have found quite a few good ones. What I was
hoping for was to know in advance what problems you faced in
implementing the basic version of it. But ofcourse i do understand its
really a request which doesn't reallyconcern llvm and hence off topic
for this mailing list.
Anyway thanks for your time.
cheers
Abhijit