January 20, 2009 Re: Descent 0.5.3 released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | Ary Borenszweig wrote:
> Trass3r wrote:
>> btw how do you get these information? Do you directly use the dmd frontend source code?
>
> Descent has a port of DMD's frontend code to Java. It also implements the visitor pattern in the provided AST, so it can output it as text.
Ummm... So I apply the semantic routines, which transforms the original AST, and then I output it. You can see all the ugly stuff that happens under the hood. :-)
|
January 20, 2009 Re: Descent 0.5.3 released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | Ary Borenszweig schrieb:
> Trass3r wrote:
>> btw how do you get these information? Do you directly use the dmd frontend source code?
>
> Descent has a port of DMD's frontend code to Java. It also implements the visitor pattern in the provided AST, so it can output it as text.
Yeah I thought so. Wasn't that quite time-consuming?
|
January 20, 2009 Re: Descent 0.5.3 released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | Ary Borenszweig wrote:
> Trass3r wrote:
>> Ary Borenszweig schrieb:
>>> I think this point is pretty feasible. I can probably implement it as a view. The only "problem" is that if I do that, I'll also have to show the optimized version of the code (which might be very interesting). So if you have:
>>
>> Hey good idea, would be interesting to see what stuff gets optimized, inlined and stuff! :)
>
> Well, now I'm not sure about this... I've just played around with this. If you give DMD's front end this:
>
> ---
> module main;
>
> class Foo {
> }
>
> int main(char[][] args) {
> scope(exit) { char[] x = "exit"; }
> scope(failure) { char[] x = "failure"; }
> scope(success) { char[] x = "success"; }
> Foo foo = new Foo();
> return 0;
> }
> ---
>
> it transforms it to this:
>
> ---
> module main;
> import object;
> class Foo : Object {
> }
> int main(char[][] args) {
> try {
> try {
> int __osf15 = 0;
> try
> try {
> Foo foo = new Foo;
> return 0;
> } catch(Object __o2) {
> __osf15 = 1;
> throw __o2;
> }
> finally
> if(!__osf15)
> char[] x = "success";
> } catch(Object __o1) {
> char[] x = "failure";
> throw __o1;
> }
> } finally
> char[] x = "exit";
> }
> ---
>
> I'm not sure you want to see that, heh. I think I'll stick with the "hover over a symbol to see it's compile-time representation" solution...
That doesn't look entirely useless, especially for optimization. Perhaps hard to read, but easier than reading the assembly output ;-P!
|
January 20, 2009 Re: Descent 0.5.3 released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Robert Fraser | Reply to Robert,
> That doesn't look entirely useless, especially for optimization.
> Perhaps hard to read, but easier than reading the assembly output ;-P!
>
ditto; now that you have it might as well make it available.
|
January 20, 2009 Re: Descent 0.5.3 released | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | BCS wrote:
> Reply to Robert,
>
>> That doesn't look entirely useless, especially for optimization.
>> Perhaps hard to read, but easier than reading the assembly output ;-P!
>>
>
> ditto; now that you have it might as well make it available.
Ok, I'll work on it. :-)
|
January 22, 2009 Re: Descent 0.5.3 released | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | Ary Borenszweig schrieb:
> Ok, I'll work on it. :-)
Hope you'll release it soon ;)
|
Copyright © 1999-2021 by the D Language Foundation