Re: [Pharo-dev] control flow graph

2018-02-24 Thread Stephane Ducasse
Yes I know but closing counting closing brackets are easier to do on the AST.
Now I imagine that variable reachability is easier with control flow.
A control flow is an dedicated abstraction over a program. Now people I met
want to use it to support clone detection between different language
because this is an abstraction.
And I'm curious to see what we can do if we have this kind of trees.

stef

On Sat, Feb 24, 2018 at 11:51 AM, Clément Bera  wrote:
> The control flow is just a visualisation, everything can be done without it,
> it's just way more convenient to look at.
>
> On Feb 24, 2018 09:08, "Stephane Ducasse"  wrote:
>>
>> Clement this analysis can be done without a control flow no?
>>
>>
>> On Fri, Feb 23, 2018 at 11:47 AM, Clément Bera 
>> wrote:
>> > I used that in the past on intermediate representations, I feel it is
>> > very
>> > useful to directly edit the code of methods with large control flows
>> > since
>> > when you have many closing brackets ] ] ] ] you never know where to
>> > write
>> > your code. Now it's specific to some use-cases such as algorithms where
>> > you
>> > write methods with large control flows, in most methods due to object
>> > oriented programming convention the control flow is not that big. In
>> > this
>> > context other things could be possible (Smart suggestions to move code
>> > out
>> > of loops, etc.)
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse
>> > 
>> > wrote:
>> >>
>> >> Hi
>> >>
>> >> I'm experimenting in building a control flow graph of pharo methods
>> >> and I would like to know if you have ideas about what we can do
>> >> with them to support our development environment.
>> >>
>> >> Stef
>> >>
>> >
>> >
>> >
>> > --
>> > Clément Béra
>> > Pharo consortium engineer
>> > https://clementbera.wordpress.com/
>> > Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
>>
>



Re: [Pharo-dev] control flow graph

2018-02-24 Thread Tudor Girba
What kind of visualization would you have in mind?

Doru


> On Feb 24, 2018, at 11:51 AM, Clément Bera  wrote:
> 
> The control flow is just a visualisation, everything can be done without it, 
> it's just way more convenient to look at.
> 
> On Feb 24, 2018 09:08, "Stephane Ducasse"  wrote:
> Clement this analysis can be done without a control flow no?
> 
> 
> On Fri, Feb 23, 2018 at 11:47 AM, Clément Bera  wrote:
> > I used that in the past on intermediate representations, I feel it is very
> > useful to directly edit the code of methods with large control flows since
> > when you have many closing brackets ] ] ] ] you never know where to write
> > your code. Now it's specific to some use-cases such as algorithms where you
> > write methods with large control flows, in most methods due to object
> > oriented programming convention the control flow is not that big. In this
> > context other things could be possible (Smart suggestions to move code out
> > of loops, etc.)
> >
> >
> >
> >
> >
> >
> > On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse 
> > wrote:
> >>
> >> Hi
> >>
> >> I'm experimenting in building a control flow graph of pharo methods
> >> and I would like to know if you have ideas about what we can do
> >> with them to support our development environment.
> >>
> >> Stef
> >>
> >
> >
> >
> > --
> > Clément Béra
> > Pharo consortium engineer
> > https://clementbera.wordpress.com/
> > Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
> 

--
www.tudorgirba.com
www.feenk.com

"When people care, great things can happen."







Re: [Pharo-dev] control flow graph

2018-02-24 Thread Clément Bera
The control flow is just a visualisation, everything can be done without
it, it's just way more convenient to look at.

On Feb 24, 2018 09:08, "Stephane Ducasse"  wrote:

> Clement this analysis can be done without a control flow no?
>
>
> On Fri, Feb 23, 2018 at 11:47 AM, Clément Bera 
> wrote:
> > I used that in the past on intermediate representations, I feel it is
> very
> > useful to directly edit the code of methods with large control flows
> since
> > when you have many closing brackets ] ] ] ] you never know where to write
> > your code. Now it's specific to some use-cases such as algorithms where
> you
> > write methods with large control flows, in most methods due to object
> > oriented programming convention the control flow is not that big. In this
> > context other things could be possible (Smart suggestions to move code
> out
> > of loops, etc.)
> >
> >
> >
> >
> >
> >
> > On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse <
> stepharo.s...@gmail.com>
> > wrote:
> >>
> >> Hi
> >>
> >> I'm experimenting in building a control flow graph of pharo methods
> >> and I would like to know if you have ideas about what we can do
> >> with them to support our development environment.
> >>
> >> Stef
> >>
> >
> >
> >
> > --
> > Clément Béra
> > Pharo consortium engineer
> > https://clementbera.wordpress.com/
> > Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
>
>


Re: [Pharo-dev] control flow graph

2018-02-24 Thread Stephane Ducasse
Clement this analysis can be done without a control flow no?


On Fri, Feb 23, 2018 at 11:47 AM, Clément Bera  wrote:
> I used that in the past on intermediate representations, I feel it is very
> useful to directly edit the code of methods with large control flows since
> when you have many closing brackets ] ] ] ] you never know where to write
> your code. Now it's specific to some use-cases such as algorithms where you
> write methods with large control flows, in most methods due to object
> oriented programming convention the control flow is not that big. In this
> context other things could be possible (Smart suggestions to move code out
> of loops, etc.)
>
>
>
>
>
>
> On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse 
> wrote:
>>
>> Hi
>>
>> I'm experimenting in building a control flow graph of pharo methods
>> and I would like to know if you have ideas about what we can do
>> with them to support our development environment.
>>
>> Stef
>>
>
>
>
> --
> Clément Béra
> Pharo consortium engineer
> https://clementbera.wordpress.com/
> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq



Re: [Pharo-dev] control flow graph

2018-02-24 Thread Stephane Ducasse
Tx. I was thinking about

x = 3
  ifTrue: [^ 66]
  ifFalse: [^ 88].
^ 666

kind of analysis.
Anyway for now I just continue to do it and we will see



On Fri, Feb 23, 2018 at 2:27 PM, Peter Uhnák  wrote:
> It would be cool to have the graph for a method as a Calypso tool, so you
> can see them side by side :)
>
> On Fri, Feb 23, 2018 at 11:47 AM, Clément Bera 
> wrote:
>>
>> I used that in the past on intermediate representations, I feel it is very
>> useful to directly edit the code of methods with large control flows since
>> when you have many closing brackets ] ] ] ] you never know where to write
>> your code. Now it's specific to some use-cases such as algorithms where you
>> write methods with large control flows, in most methods due to object
>> oriented programming convention the control flow is not that big. In this
>> context other things could be possible (Smart suggestions to move code out
>> of loops, etc.)
>>
>>
>>
>>
>>
>>
>> On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse
>>  wrote:
>>>
>>> Hi
>>>
>>> I'm experimenting in building a control flow graph of pharo methods
>>> and I would like to know if you have ideas about what we can do
>>> with them to support our development environment.
>>>
>>> Stef
>>>
>>
>>
>>
>> --
>> Clément Béra
>> Pharo consortium engineer
>> https://clementbera.wordpress.com/
>> Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq
>
>



Re: [Pharo-dev] control flow graph

2018-02-23 Thread Peter Uhnák
It would be cool to have the graph for a method as a Calypso tool, so you
can see them side by side :)

On Fri, Feb 23, 2018 at 11:47 AM, Clément Bera 
wrote:

> I used that in the past on intermediate representations, I feel it is very
> useful to directly edit the code of methods with large control flows since
> when you have many closing brackets ] ] ] ] you never know where to write
> your code. Now it's specific to some use-cases such as algorithms where you
> write methods with large control flows, in most methods due to object
> oriented programming convention the control flow is not that big. In this
> context other things could be possible (Smart suggestions to move code out
> of loops, etc.)
>
>
>
>
>
>
> On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse <
> stepharo.s...@gmail.com> wrote:
>
>> Hi
>>
>> I'm experimenting in building a control flow graph of pharo methods
>> and I would like to know if you have ideas about what we can do
>> with them to support our development environment.
>>
>> Stef
>>
>>
>
>
> --
> Clément Béra
> Pharo consortium engineer
> https://clementbera.wordpress.com/
> Bâtiment B 40, avenue Halley 59650
> Villeneuve
> d
> 
> 'Ascq
> 
>


Re: [Pharo-dev] control flow graph

2018-02-23 Thread Clément Bera
I used that in the past on intermediate representations, I feel it is very
useful to directly edit the code of methods with large control flows since
when you have many closing brackets ] ] ] ] you never know where to write
your code. Now it's specific to some use-cases such as algorithms where you
write methods with large control flows, in most methods due to object
oriented programming convention the control flow is not that big. In this
context other things could be possible (Smart suggestions to move code out
of loops, etc.)






On Fri, Feb 23, 2018 at 11:37 AM, Stephane Ducasse 
wrote:

> Hi
>
> I'm experimenting in building a control flow graph of pharo methods
> and I would like to know if you have ideas about what we can do
> with them to support our development environment.
>
> Stef
>
>


-- 
Clément Béra
Pharo consortium engineer
https://clementbera.wordpress.com/
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq


Re: [Pharo-dev] Control Flow Graph for Smalltalk

2015-07-06 Thread Nicolai Hess
2015-07-06 13:21 GMT+02:00 Nevena Milojkovic nev...@iam.unibe.ch:

 Hi all,

 Can anybody point me towards some tool/paper with the possibility to
 construct Control Flow Graph for Smalltalk?


There was a tool called compass. AFAIR it is a debugger that stores the
execution path.
(don't know where this is, I read in a paper about it flow-centric
debugging).



 Cheers,
 Nevena

 
 Nevena Milojkovic
 Research assistant
 Software Composition Group
 Institute of Computer Science and Applied Mathematics
 University of Bern

 email: nev...@iam.unibe.ch
 office phone: +41 (0)31 511 7639
 webpage: http://scg.unibe.ch/staff/Milojkovic









Re: [Pharo-dev] Control Flow Graph for Smalltalk

2015-07-06 Thread Clément Bera
I don't think there is such a tool or paper.

I built such a tool for a compiler IR but I don't think it will fit your
needs as I show strange IR nodes with compiler related information (it
doesn't look like the original smalltalk code at all). The visualization is
done with Roassal.

I think if you get the Smalltalk AST with the semantic analysis done, you
can easily detect which messageNode will be inlined to control flow
operations, and therefore have a control flow graph. You can then display
it with Roassal. However, Roassal is bad at handling graph cycles so I'd
recommend that you show the control flow graph but back edges.

Good luck

Clément

2015-07-06 13:21 GMT+02:00 Nevena Milojkovic nev...@iam.unibe.ch:

 Hi all,

 Can anybody point me towards some tool/paper with the possibility to
 construct Control Flow Graph for Smalltalk?

 Cheers,
 Nevena

 
 Nevena Milojkovic
 Research assistant
 Software Composition Group
 Institute of Computer Science and Applied Mathematics
 University of Bern

 email: nev...@iam.unibe.ch
 office phone: +41 (0)31 511 7639
 webpage: http://scg.unibe.ch/staff/Milojkovic









Re: [Pharo-dev] Control Flow Graph for Smalltalk

2015-07-06 Thread Francisco Garau
Hi Nevena

To compute the control flow graph you would need to do concrete type inference. 

Search for Ole Agesen PhD thesis to have an idea what's that about.

I've started a smalltalk implementation of his ideas in 2001 but never got 
beyond the proof of concept stage. I can forward the presentation slides later 
tonight.

Cheers
- Francisco


 On 6 Jul 2015, at 12:21, Nevena Milojkovic nev...@iam.unibe.ch wrote:
 
 Hi all,
 
 Can anybody point me towards some tool/paper with the possibility to 
 construct Control Flow Graph for Smalltalk?
 
 Cheers,
 Nevena
 
 
 Nevena Milojkovic
 Research assistant
 Software Composition Group 
 Institute of Computer Science and Applied Mathematics 
 University of Bern 
 
 email: nev...@iam.unibe.ch 
 office phone: +41 (0)31 511 7639  
 webpage: http://scg.unibe.ch/staff/Milojkovic 
 
 
 
 
 
 



Re: [Pharo-dev] Control Flow Graph for Smalltalk

2015-07-06 Thread Frank Shearar
Olin Shivers' k-CFA stuff also computes call flow graphs (and can
infer types, and can determine when garbage can be released).

A starting point might be here:
http://matt.might.net/articles/implementation-of-kcfa-and-0cfa/

frank

On 6 July 2015 at 14:30, Francisco Garau francisco.ga...@gmail.com wrote:
 Hi Nevena

 To compute the control flow graph you would need to do concrete type 
 inference.

 Search for Ole Agesen PhD thesis to have an idea what's that about.

 I've started a smalltalk implementation of his ideas in 2001 but never got 
 beyond the proof of concept stage. I can forward the presentation slides 
 later tonight.

 Cheers
 - Francisco


 On 6 Jul 2015, at 12:21, Nevena Milojkovic nev...@iam.unibe.ch wrote:

 Hi all,

 Can anybody point me towards some tool/paper with the possibility to 
 construct Control Flow Graph for Smalltalk?

 Cheers,
 Nevena

 
 Nevena Milojkovic
 Research assistant
 Software Composition Group
 Institute of Computer Science and Applied Mathematics
 University of Bern

 email: nev...@iam.unibe.ch
 office phone: +41 (0)31 511 7639
 webpage: http://scg.unibe.ch/staff/Milojkovic










Re: [Pharo-dev] Control Flow Graph for Smalltalk

2015-07-06 Thread stepharo

I have the code of lex spoon (chuck) based on Olin stuff.
If you are interested to see what you can do tiwh it.

Le 6/7/15 17:42, Frank Shearar a écrit :

Olin Shivers' k-CFA stuff also computes call flow graphs (and can
infer types, and can determine when garbage can be released).

A starting point might be here:
http://matt.might.net/articles/implementation-of-kcfa-and-0cfa/

frank

On 6 July 2015 at 14:30, Francisco Garau francisco.ga...@gmail.com wrote:

Hi Nevena

To compute the control flow graph you would need to do concrete type inference.

Search for Ole Agesen PhD thesis to have an idea what's that about.

I've started a smalltalk implementation of his ideas in 2001 but never got 
beyond the proof of concept stage. I can forward the presentation slides later 
tonight.

Cheers
- Francisco



On 6 Jul 2015, at 12:21, Nevena Milojkovic nev...@iam.unibe.ch wrote:

Hi all,

Can anybody point me towards some tool/paper with the possibility to construct 
Control Flow Graph for Smalltalk?

Cheers,
Nevena


Nevena Milojkovic
Research assistant
Software Composition Group
Institute of Computer Science and Applied Mathematics
University of Bern

email: nev...@iam.unibe.ch
office phone: +41 (0)31 511 7639
webpage: http://scg.unibe.ch/staff/Milojkovic