I'm not aware of one. The intent is that
http://code.google.com/p/gofrontend/ evolve
into something generic enough to support
multiple back ends.
Russ
> Nice. How generic is it at this point?
Not particularly generic, but getting better. I'm actively working on
it. It's the kind of thing which somebody else could work on too. I
think it would be the fastest way to get an LLVM compatible Go frontend.
Ian
DragonEgg is an interesting hack which is useful for experimentation.
It shouldn't be mistaken for a proper compiler.
Ian
> I had idea on getting llvm up and working. Use the go parser package
> to generate an ast. Walk the ast and emit llvm instructions via ffi.
> Any thoughts?
That may be feasible, though I think you will need the typechecker.
I've heard that there are already some Go LLVM bindings around.
Ian
It shares no code with 6g and 8g, but it most
definitely shares code with gccgo. It is the source
(in the "upstream" sense) for gccgo's front end.
Russ
> Is there any sharing of the go runtime libs between gccgo and [568]g?
Yes, gccgo copies the Go library from 6g et al with some modifications.
> Can gccgo use all the packages, even the ones that include c and asm?
Yes, though it uses its own C and asm code.
Ian
> How do you build gofrontend?
>
> ~/projects/gofrontend/libgo $ ./configure
> configure: error: cannot find install-sh, install.sh, or shtool in "."
> "./.." "./../.."
>
> I'm assuming it will need some gcc headers -- any particular version?
>
> How do you test?
gofrontend is only useful in conjunction with the rest of gcc, and there
is a copy of gofrontend in the gcc repository.
http://golang.org/doc/gccgo_install.html
Ian
> It appears that it is still dependent on tree, which makes it very
> attached to gcc. How were you thinking of pulling that out? Making a
> tree-a-like? Or, creating a bunch of classes like the go ast package?
See backend.h. I just removed all the uses of gcc trees from
statements.cc. As I've tried to say before, this is something that
other people can work on too.
Ian