On 01.02.2016 17:32, Alexander Bertram wrote:
>
> The build times with Soot were definitely an issue. Soot is still first
> and foremost an analysis framework so on startup it builds this enormous
> data structure of all Java classes reachable from the input, which ends
> up including most of the JRE.
that is quite bad... the JRE is big
> I also found it difficult to build the Jimple IR programmatically. Soot
> makes extensive use of singletons so it's not as easy as
>
> SomeASTNode node = buildFunctionNode(inputAst)
> writeClassFile(node)
>
> For this reason, I ended up generating a Jimple text file which I fed
> into Soot to compile to bytecode. This was both slow and meant having to
> mess around with composing text files as output.
>
> I've found the ASM Tree library to be quite nice to work by contrast,
> and it's made it possible to include some nicieties like debugging info,
> like stack traces that include C source references:
>
> java.lang.ArrayIndexOutOfBoundsException: -1
> at org.renjin.gcc.array.sum10(array.c:29)
> at org.renjin.gcc.array.test(array.c:16)
>
> (Was pleasantly suprised that it was then possible to step line by line
> through Fortran code in IntelliJ)
since you worked with gcc as well I am wondering if gcc actually allows
the joint compilation of multiple languages. assume for example there
would be a part for java and one for groovy and you have a java class A
extending a groovy class B extending a java class C, and C has a field
of type A and another one of type B.... bad structure, I know, just for
the sake of the example... then, unless you do a true joint compilation
in which you resolve the classes in the same compilation you cannot
compile this, since you cannot even split the compilation steps anymore.
Does gcc provide something here? With just IR this is not done, unless
class resolving would be done on the IR code and given that the IR is
almost assembler I fail to believe that, as too much information is
already lost in that part.
So assuming this won't work I am playing around with the following idea...
* each language will generate private AST able to interface with a AST
based on javax.lang.model
* the compiler will implement a class resolving structure, which each
language must implement
* optionally we generate asm tree structures as kind of IR
* generate bytecode directly or from IR (language plugin decides what it
wants to do)
* output to files or in memory...
naturally this would be still a very Java oriented compiler, but I
imagine with such a structure you could do a lot of things... and easily
extend it for use in Java based IDEs for example.
[...]
yes, that would be a good idea.
bye Jochen