[prev in list] [next in list] [prev in thread] [next in thread] 

List:       groovy-user
Subject:    Re: [groovy-user] tracing groovy...
From:       Tim Yates <tim.yates () gmail ! com>
Date:       2013-09-25 9:24:20
Message-ID: CAFC8+YiQsifOTrH1UVw0VS-HEOoXajBQaDeP3PELnDaHynm6eA () mail ! gmail ! com
[Download RAW message or body]

Hiya! No worries, I just thought that some of my code might come in useful
to you in your efforts :-)

I don't remember hitting a blocking problem, I believe the reason I didn't
take it any further was purely time constraints...

This year, I hit the holy trinity of paid work load, other projects, and
new children ;-)

Tim


On 24 September 2013 21:27, Jamie Echlin <jamie.echlin@gmail.com> wrote:

> Hi there...
>
> > ClassCodeExpressionTransformer can be of help here.
>
> Yep sorry, I am already subclassing that. I wrote my mail from memory
> without the code in front of me.
>
> > I think it could result in a quite slow program later, but give it a
> try ;)
>
> Probably, but, you would not leave tracing enabled. Even if takes orders
> of magnitude longer, but that time is only 5s, and it helps you find a bug
> it's probably well worth it.
>
> Tim, yeah, that is exactly the kind of thing I am doing. Shame I didn't
> ask before I started hacking, but education is never wasted... they say.
> Was there any reason you stopped, or just lack of time? I'm thinking, did
> you hit some critical problem that seemed insuperable? Just want to know in
> case I'm likely to run into it myself. So far, my proof of concept is
> coming on nicely.
>
> cheers, jamie
>
>
>
>
> On Tue, Sep 24, 2013 at 9:56 AM, Tim Yates <tim.yates@gmail.com> wrote:
>
>> I made a start on this similar(?) thing 7 month ago
>>
>> https://github.com/timyates/groovy-debug-transform
>>
>> But never got time to take it further :-(
>>
>> Maybe you can tear bits off it to get you started? Or use it as a map of
>> what not to do? ;-)
>>
>> Tim
>>
>>
>> On 24 September 2013 08:20, Jochen Theodorou <blackdrag@gmx.org> wrote:
>>
>>> Am 23.09.2013 22:08, schrieb Jamie Echlin:
>>>
>>>  Hi all,
>>>>
>>>> I have been inspired by http://trace.gl and would like to implement
>>>> some
>>>> sort of basic tracing for groovy _scripts_. Many of the users of my
>>>> "thing", which is a thing that has groovy embedded, don't have the
>>>> ability to set up and attach an IDE, and I think some basic tracing for
>>>> scripts would be helpful.
>>>>
>>>> What I imagined was being able to show the user-provided script with
>>>> mouseovers so one can see a variable value at any point, whether boolean
>>>> expressions evaluated to true or not, and loop counters.
>>>>
>>>
>>> sounds interesting
>>>
>>> [...]
>>>
>>>  The code is rather convoluted - is there something that will help me
>>>> visit every node in an AST *and* modify it.
>>>>
>>>
>>> ClassCodeExpressionTransformer can be of help here. It visits all nodes
>>> and uses ExpressionTransformer on the Expressions, to then put the
>>> transformed result back into the ast. So what you basically do is
>>> overwriting ClassCodeExpressionTransformer**#transform(Expression).
>>>
>>> [...]
>>>
>>>  More generally... do you think this is a good approach? This project is
>>>> probably beyond my meagre abilities, but thought I'd have a crack at it.
>>>>
>>>
>>> I think it could result in a quite slow program later, but give it a try
>>> ;)
>>>
>>> bye blackdrag
>>>
>>> --
>>> Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
>>> blog: http://blackdragsview.**blogspot.com/<http://blackdragsview.blogspot.com/>
>>> german groovy discussion newsgroup: de.comp.lang.misc
>>> For Groovy programming sources visit http://groovy-lang.org
>>>
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/**manage_email<http://xircles.codehaus.org/manage_email>
>>>
>>>
>>>
>>
>

[Attachment #3 (text/html)]

<div dir="ltr">Hiya! No worries, I just thought that some of my code might come in \
useful to you in your efforts :-)<div><br></div><div>I don&#39;t remember hitting a \
blocking problem, I believe the reason I didn&#39;t take it any further was purely \
time constraints...</div>

<div><br></div><div>This year, I hit the holy trinity of paid work load, other \
projects, and new children ;-)</div><div><br></div><div>Tim</div></div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On 24 September 2013 21:27, \
Jamie Echlin <span dir="ltr">&lt;<a href="mailto:jamie.echlin@gmail.com" \
target="_blank">jamie.echlin@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">Hi there...<div \
class="im"><div><br></div><div>&gt; <span \
style="font-family:arial,sans-serif;font-size:13px">ClassCodeExpressionTransformer \
can be of help here.</span><span style="font-family:arial,sans-serif;font-size:13px"> \
</span></div>


<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">Yep sorry, I am already \
subclassing that. I wrote my mail from memory without the code in front of \
me.</span></div>

<div class="im">
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">&gt; </span><span \
style="font-family:arial,sans-serif;font-size:13px">I think it could result in a \
quite slow program later, but give it a try ;)</span></div>


<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">Probably, but, you would not \
leave tracing enabled. Even if takes orders of magnitude longer, but that time is \
only 5s, and it helps you find a bug it&#39;s probably well worth it.</span></div>


<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">Tim, yeah, that is exactly the \
kind of thing I am doing. Shame I didn&#39;t ask before I started hacking, but \
education is never wasted... they say. Was there any reason you stopped, or just lack \
of time? I&#39;m thinking, did you hit some critical problem that seemed insuperable? \
Just want to know in case I&#39;m likely to run into it myself. So far, my proof of \
concept is coming on nicely.</span></div>


<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span \
style="font-family:arial,sans-serif;font-size:13px">cheers, \
jamie</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>


</span></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div \
class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 24, 2013 at 9:56 AM, \
Tim Yates <span dir="ltr">&lt;<a href="mailto:tim.yates@gmail.com" \
target="_blank">tim.yates@gmail.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">I made a start on this similar(?) thing 7 \
month ago<div><br></div><div><a \
href="https://github.com/timyates/groovy-debug-transform" \
target="_blank">https://github.com/timyates/groovy-debug-transform</a><br>


</div>

<div><br></div>
<div>But never got time to take it further :-(</div><div \
class="gmail_extra"><br></div><div class="gmail_extra">Maybe you can tear bits off it \
to get you started? Or use it as a map of what not to do? ;-)</div><span><font \
color="#888888"><div class="gmail_extra">




<br></div></font></span><div class="gmail_extra"><span><font \
color="#888888">Tim</font></span><div><div><br><br><div class="gmail_quote">On 24 \
September 2013 08:20, Jochen Theodorou <span dir="ltr">&lt;<a \
href="mailto:blackdrag@gmx.org" target="_blank">blackdrag@gmx.org</a>&gt;</span> \
wrote:<br>





<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Am 23.09.2013 22:08, schrieb Jamie Echlin:<div><br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> Hi all,<br>
<br>
I have been inspired by <a href="http://trace.gl" target="_blank">http://trace.gl</a> \
and would like to implement some<br> sort of basic tracing for groovy _scripts_. Many \
of the users of my<br> &quot;thing&quot;, which is a thing that has groovy embedded, \
don&#39;t have the<br> ability to set up and attach an IDE, and I think some basic \
tracing for<br> scripts would be helpful.<br>
<br>
What I imagined was being able to show the user-provided script with<br>
mouseovers so one can see a variable value at any point, whether boolean<br>
expressions evaluated to true or not, and loop counters.<br>
</blockquote>
<br></div>
sounds interesting<br>
<br>
[...]<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> The code is rather convoluted - is there something that will \
help me<br> visit every node in an AST *and* modify it.<br>
</blockquote>
<br></div>
ClassCodeExpressionTransformer can be of help here. It visits all nodes and uses \
ExpressionTransformer on the Expressions, to then put the transformed result back \
into the ast. So what you basically do is overwriting \
ClassCodeExpressionTransformer<u></u>#transform(Expression).<br>






<br>
[...]<div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> More generally... do you think this is a good approach? This \
project is<br> probably beyond my meagre abilities, but thought I&#39;d have a crack \
at it.<br> </blockquote>
<br></div>
I think it could result in a quite slow program later, but give it a try ;)<br>
<br>
bye blackdrag<span><font color="#888888"><br>
<br>
-- <br>
Jochen &quot;blackdrag&quot; Theodorou - Groovy Project Tech Lead<br>
blog: <a href="http://blackdragsview.blogspot.com/" \
target="_blank">http://blackdragsview.<u></u>blogspot.com/</a><br> german groovy \
discussion newsgroup: de.comp.lang.misc<br> For Groovy programming sources visit <a \
href="http://groovy-lang.org" target="_blank">http://groovy-lang.org</a><br> <br>
<br>
------------------------------<u></u>------------------------------<u></u>---------<br>
 To unsubscribe from this list, please visit:<br>
<br>
   <a href="http://xircles.codehaus.org/manage_email" \
target="_blank">http://xircles.codehaus.org/<u></u>manage_email</a><br> <br>
<br>
</font></span></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic