Live data from Hacker News

Extracting the abstract syntax tree from GCC

lwn.net

1–10 of 112 posts

Re: Extracting the abstract syntax tree from GCC

#3
This is precisely what we do in Renjin in order to translate C/Fortran to Java:

https://github.com/bedatadriven/renjin/blob/master/tools/gcc...

This little plugin simply dumps GCC's gimple to JSON, yielding for example:

https://github.com/bedatadriven/renjin/blob/master/tools/gcc...

LLVM's design looks very attractive, but for scientific computing Fortran is really important, and AFAICT, LLVM doesn't have an intermediate representation comparable to Gimple: LLIR seems to be at the level of the registers rather than the nice abstract Gimple, but perhaps I just haven't looked deep enough.

Re: Extracting the abstract syntax tree from GCC

#6
Isn't GCC itself GPL with all the source available? IANAL, but AFAIK that means as long as you release your modifications under GPL too, it doesn't violate any license. Or are they saying that GCC doesn't actually use an AST somehow, which doesn't match at all with my (admittedly limited) knowledge of it?

I'm someone who has experience with what can be done in terms of extending/modifying software even without any source code, so my perspective on things like this are more like... "you have the source and an explicit license to modify it, and no intention of keeping your changes proprietary, so just do it!"

Either that or move to clang/LLVM, which I think would be better in the long term.

Re: Extracting the abstract syntax tree from GCC

#8
post #2

comparing emacs to xcode/idea made me lol

> comparing emacs to xcode/idea made me lol

Why did it? Emacs is a great development environment. It allows you to focus on the code and supports debugging right next to your code, same as an ide. It is an ide.

Emacs lacks some features of xcode/eclipse et al but in exchange it has power they lack. Why shouldn't it gain some of their features?

(I am assuming you loled because you considered emacs weaker. My apologies if I got the sense backwards).

Post reply on HN