Professional Web Applications Themes

AW: [ann] AEditor 0.10, folding added - Ruby

> Try out AEditor and tell me if AEditor works on your > machine. Please report if there is any problems. > Ideas + Suggestions for improvements is welcome :-) > > [url]http://raa.ruby-lang.org/list.rhtml?name=aeditor[/url] No replies ? they dont mean to ignore your post intentionally, but you know, there is a really good editor distributed with ruby. SciTe. That's the reason why i haven't tried AEd. I allready got familiar with SciTe. I would also interested in your opinion guys. going to test AEditor now .... [snip] > -- > Simon Strandgaard - Henon...

  1. #1

    Default AW: [ann] AEditor 0.10, folding added

    > Try out AEditor and tell me if AEditor works on your
    > machine. Please report if there is any problems.
    > Ideas + Suggestions for improvements is welcome :-)
    >
    > [url]http://raa.ruby-lang.org/list.rhtml?name=aeditor[/url]
    No replies ?

    they dont mean to ignore your post intentionally, but
    you know, there is a really good editor distributed with ruby.

    SciTe. That's the reason why i haven't tried AEd. I allready got
    familiar with SciTe.

    I would also interested in your opinion guys.
    going to test AEditor now ....

    [snip]
    > --
    > Simon Strandgaard
    - Henon

    Recheis Meinrad Guest

  2. #2

    Default Re: AW: [ann] AEditor 0.10, folding added

    On Wed, 13 Aug 2003 02:56:48 +0900, Recheis Meinrad wrote:
    >
    >> Try out AEditor and tell me if AEditor works on your
    >> machine. Please report if there is any problems.
    >> Ideas + Suggestions for improvements is welcome :-)
    >>
    >> [url]http://raa.ruby-lang.org/list.rhtml?name=aeditor[/url]
    >
    > No replies ?
    until simon.too_many_answers?
    wait
    replies += 1
    end
    > they dont mean to ignore your post intentionally, but
    > you know, there is a really good editor distributed with ruby.
    > SciTe. That's the reason why i haven't tried AEd. I allready got
    > familiar with SciTe.
    Yes, SciTe is a decent editor. Hopefully one day AEditor can replace it.
    Internally SciTe is using the rich-edit-widget, Scintilla.
    Scintilla is unfortunatly written in C++ and has no unittesting.
    Otherwise its quite nice.

    FreeRIDE is using Scintilla as its editor-widget. I hope one day to
    entirely replace Scintilla-widget with the AEditor-widget.

    also IntelliJ-Idea has many nice features which I hope AEditor will get.
    [url]http://www.intellij.com/idea/[/url]
    examples of its features [ripped from intelliJ's feature list]:
    * rename method, The renaming functionality allows you to rename any
    package, class, method or variable and automatically finds and corrects
    all references to it.
    * Moving classes and packages with reference correction.
    * extract method, Select a block of code and invoke Extract Method to
    turn it into a method. It will automatically yze the code to
    detect which variables of the original method must be passed to the
    extracted method as parameters.
    * etc.. 30 refactoring operations ..

    If we had an IDE for Ruby with such features... wow.
    I will do my best in order to create such refactoring tools for ruby.

    > I would also interested in your opinion guys.
    > going to test AEditor now ....
    Great.. tell me what you think :-)

    --
    Simon Strandgaard
    Simon Strandgaard Guest

  3. #3

    Default Re: AW: [ann] AEditor 0.10, folding added

    > On Wed, 13 Aug 2003 02:56:48 +0900, Recheis Meinrad wrote:
    >
    > >
    > >> Try out AEditor and tell me if AEditor works on your
    > >> machine. Please report if there is any problems.
    > >> Ideas + Suggestions for improvements is welcome :-)
    > >>
    > >> [url]http://raa.ruby-lang.org/list.rhtml?name=aeditor[/url]
    > >
    > > No replies ?
    >
    > until simon.too_many_answers?
    > wait
    > replies += 1
    > end
    >
    > > they dont mean to ignore your post intentionally, but
    > > you know, there is a really good editor distributed with ruby.
    > > SciTe. That's the reason why i haven't tried AEd. I allready got
    > > familiar with SciTe.
    >
    > Yes, SciTe is a decent editor. Hopefully one day AEditor can replace it.
    > Internally SciTe is using the rich-edit-widget, Scintilla.
    > Scintilla is unfortunatly written in C++ and has no unittesting.
    > Otherwise its quite nice.
    >
    > FreeRIDE is using Scintilla as its editor-widget. I hope one day to
    > entirely replace Scintilla-widget with the AEditor-widget.
    I don't currently have the extra bandwidth to personally take a look AEditor
    (maybe later). But I don't want to be silent either. I like what you have
    done very much. Your goals are very much in line with FreeRIDE's goals and
    would very much like to see someone plug it in to FreeRIDE as a replacement
    for Scintilla.

    Curt
    > also IntelliJ-Idea has many nice features which I hope AEditor will get.
    > [url]http://www.intellij.com/idea/[/url]
    > examples of its features [ripped from intelliJ's feature list]:
    > * rename method, The renaming functionality allows you to rename any
    > package, class, method or variable and automatically finds and corrects
    > all references to it.
    > * Moving classes and packages with reference correction.
    > * extract method, Select a block of code and invoke Extract Method to
    > turn it into a method. It will automatically yze the code to
    > detect which variables of the original method must be passed to the
    > extracted method as parameters.
    > * etc.. 30 refactoring operations ..
    >
    > If we had an IDE for Ruby with such features... wow.
    > I will do my best in order to create such refactoring tools for ruby.
    >
    >
    > > I would also interested in your opinion guys.
    > > going to test AEditor now ....
    >
    > Great.. tell me what you think :-)
    >
    > --
    > Simon Strandgaard
    >
    >

    Curt Hibbs Guest

  4. #4

    Default Re: AW: [ann] AEditor 0.10, folding added

    Hello Simon,

    Tuesday, August 12, 2003, 10:44:49 PM, you wrote:

    SS> also IntelliJ-Idea has many nice features which I hope AEditor will get.
    SS> [url]http://www.intellij.com/idea/[/url]
    SS> examples of its features [ripped from intelliJ's feature list]:
    SS> * rename method, The renaming functionality allows you to rename any
    SS> package, class, method or variable and automatically finds and corrects
    SS> all references to it.
    SS> * Moving classes and packages with reference correction.
    SS> * extract method, Select a block of code and invoke Extract Method to
    SS> turn it into a method. It will automatically yze the code to
    SS> detect which variables of the original method must be passed to the
    SS> extracted method as parameters.
    SS> * etc.. 30 refactoring operations ..

    SS> If we had an IDE for Ruby with such features... wow.
    SS> I will do my best in order to create such refactoring tools for ruby.

    Have you ever spend more then a few minutes to think about the
    problems with refactoring in script languages and especially with
    ruby ?

    I guess you didn't.

    The fexibility of languages like ruby makes it impossible to ever
    write something like intellij. And it is not a pr problem. I can
    write a full ruby pr in a weekend, but this would give me no clue
    about the behaviour.


    --
    Best regards,
    Lothar mailto:mailinglistsscriptolutions.com


    Lothar Scholz Guest

  5. #5

    Default Re: AW: [ann] AEditor 0.10, folding added

    On Thu, 14 Aug 2003, Lothar Scholz wrote:
    >
    > I can write a full ruby pr in a weekend, but this would give me no clue
    > about the behaviour.
    >
    >
    Please do. We need a nice Ruby-based Ruby pr. Can we expect it by
    next Monday?

    ;)




    Chad Fowler Guest

  6. #6

    Default Re: AW: [ann] AEditor 0.10, folding added

    Lothar Scholz wrote:
    >
    > Hello Simon,
    >
    > Tuesday, August 12, 2003, 10:44:49 PM, you wrote:
    >
    > SS> also IntelliJ-Idea has many nice features which I hope
    > AEditor will get.
    > SS> [url]http://www.intellij.com/idea/[/url]
    > SS> examples of its features [ripped from intelliJ's feature list]:
    > SS> * rename method, The renaming functionality allows you to rename any
    > SS> package, class, method or variable and automatically finds
    > and corrects
    > SS> all references to it.
    > SS> * Moving classes and packages with reference correction.
    > SS> * extract method, Select a block of code and invoke Extract Method to
    > SS> turn it into a method. It will automatically yze the code to
    > SS> detect which variables of the original method must be passed to the
    > SS> extracted method as parameters.
    > SS> * etc.. 30 refactoring operations ..
    >
    > SS> If we had an IDE for Ruby with such features... wow.
    > SS> I will do my best in order to create such refactoring tools for ruby.
    >
    > Have you ever spend more then a few minutes to think about the
    > problems with refactoring in script languages and especially with
    > ruby ?
    >
    > I guess you didn't.
    >
    > The fexibility of languages like ruby makes it impossible to ever
    > write something like intellij. And it is not a pr problem. I can
    > write a full ruby pr in a weekend, but this would give me no clue
    > about the behaviour.
    The problem is harder in a dynamically typed language like Ruby, but not
    impossible. You can't take it quite as far as you can in a strongly typed
    language like Java, but you *can* implement a surprising amount of
    functionality. You only need to look as far as the existing Smalltalk
    refactoring tools to see just what can be done.

    Curt


    Curt Hibbs Guest

  7. #7

    Default Re: AW: [ann] AEditor 0.10, folding added

    On Thu, 14 Aug 2003 04:03:51 +0900, Lothar Scholz wrote:
    > Hello Simon,
    >
    > Tuesday, August 12, 2003, 10:44:49 PM, you wrote:
    >
    > SS> also IntelliJ-Idea has many nice features which I hope AEditor will get.
    > SS> [url]http://www.intellij.com/idea/[/url]
    [snip]
    > SS> * etc.. 30 refactoring operations ..
    >
    > Have you ever spend more then a few minutes to think about the
    > problems with refactoring in script languages and especially with
    > ruby ?
    >
    > I guess you didn't.
    I have thought about it for more than 5 minutes, but not done any deep
    izis of what it would take. I agree with you that there is problems
    with dynamic-typed languages.

    Is there anyone who has done some izis of what such refactoring-tool
    exactly will require ? a ruby-in-ruby pr ?

    > The fexibility of languages like ruby makes it impossible to ever
    > write something like intellij. And it is not a pr problem. I can
    > write a full ruby pr in a weekend, but this would give me no clue
    > about the behaviour.
    OK, also I look forward to a ruby-in-ruby pr on next monday :-)

    --
    Simon Strandgaard
    Simon Strandgaard Guest

  8. #8

    Default Re: AW: [ann] AEditor 0.10, folding added

    On Thu, Aug 14, 2003 at 05:27:58AM +0900, Simon Strandgaard wrote:
    > On Thu, 14 Aug 2003 04:03:51 +0900, Lothar Scholz wrote:
    > > Hello Simon,
    > > Tuesday, August 12, 2003, 10:44:49 PM, you wrote:
    > > Have you ever spend more then a few minutes to think about the
    > > problems with refactoring in script languages and especially with
    > > ruby ?
    > > I guess you didn't.
    > I have thought about it for more than 5 minutes, but not done any deep
    > izis of what it would take. I agree with you that there is
    > problems with dynamic-typed languages.
    > Is there anyone who has done some izis of what such
    > refactoring-tool exactly will require ? a ruby-in-ruby pr ?
    The pr would be the easy part (probably).

    Once you have the pr, consider renaming the method Foo#bar to
    Foo#foo():

    ------8<-----
    class Foo; def bob; end; end
    class Bar; def bob; end; def foo; Foo.new; end; end

    a = Foo.new
    b = Bar.new
    a, b = b, a

    a.bob
    b.bob
    ------8<-----

    So far, it would be relatively simple to track variable assignment and
    work out which variables are instances of Foo and then rename references
    from Foo#bob() to Foo#foo

    ------8<-----
    def bar(*args)
    args.each do |obj|
    obj.bob if obj.respond_to?(:bob)
    end
    end

    bar(a, b, a.bob)
    ------8<-----

    Here it becomes somewhat more difficult - it might be fair to
    assume that in most cases the author wishes to rename Foo#bob so that it
    isn't called by bar(), but not always. And how should the refactoring
    agent change the code if it isn't?

    def bar(*args)
    args.each do |obj|
    if obj.kind_of?(Foo)
    obj.foo if obj.respond_to?(:foo)
    else
    obj.bob if obj.respond_to?(:bob)
    end
    end
    end

    ??

    ------8<-----
    a.foo.bob
    ------8<-----

    And although in the code above, you could determine fairly easily what
    type of object will be returned by Bar#foo(), it would be very easy to
    think of situations where it wouldn't be easy and, in the case of
    compiled C extensions, not possible.

    ------8<----
    str = 'BOB'.downcase

    ...
    b.method(str).to_proc
    b.send(str.intern)
    ------8<----

    I won't comment. Or mention eval. Or instance_eval. Or module_eval.
    Or subclasses which may or may not define the same method which may or
    may not call super().


    AIUI, refactoring is supposed not to change the behaviour of the code:
    And without creating either a ruby simulator which could run a ruby
    script and determine every single variable which could possibly be an
    instance of Foo, and then take into account code which is dynamically
    generated from external sources, e.g. DRb, marshalled data, class and
    function names derived from a database/other programs. And if you end
    up treating almost every variable and function return as a potential
    instance of Foo then do you have to refactor the every possible
    reference to Foo#bob with an if obj.kind_of?(Foo) ... else ... end?

    So in answer to your question, in order to refactor Ruby code it's
    probably not possible without a divining rod, some form of mind reading
    and lashings of good luck. And even if you manage a no-side-effects
    refactor, will it really acheive the end of making the script more
    legible to the programmer?

    The problem could be partially solved by designing strict rules for
    writing a style of Ruby which could be refactored in well defined ways,
    but I don't think that it would be feasible to do for an otherwise
    unknown Ruby script.

    If, for example, all code was to be duck typed, so that the behaviour of
    instance method #foo should be the same in Foo as in Bar, then renaming
    would be simpler, because you would normally either be renaming all
    references a particular instance method name (regardless of the object
    class) or simply renaming the method definition within the class
    definition because it no longer conforms to the behaviour specified for
    the name. Even so it would require checking for literals which match
    the function name, whether symbols or strings or the contents of arrays
    so that you have a chance of catching most obj.__send__(sym). And the
    problem with changing those is then calculating the side effects.

    Of course, I have only considered renaming a method which is just one
    (relatively simple?) refactoring operation.
    > > The fexibility of languages like ruby makes it impossible to ever
    > > write something like intellij. And it is not a pr problem. I can
    > > write a full ruby pr in a weekend, but this would give me no
    > > clue about the behaviour.
    > OK, also I look forward to a ruby-in-ruby pr on next monday :-)
    Even if he did, it would only be of real use to AEditor for syntax
    highlighting and, possibly, automatic recognition of possible folds.

    And it shouldn't be hard to do - with StringScanner it should be fairly
    straight forward. Of course it depends what you mean by a 'pr'. If
    you want a function that returns an array of tokens, it shouldn't take
    long. If you want a ruby-in-ruby interpreter, it would take a bit
    longer... :)

    TTFN,


    Geoff.

    Geoff Youngs Guest

  9. #9

    Default Re: AW: [ann] AEditor 0.10, folding added

    Hello Geoff,

    Thursday, August 14, 2003, 10:52:18 AM, you wrote:

    GY> The pr would be the easy part (probably).

    Right. Stealing it from the ruby source code does not take a long time.
    The biggest problem is that no one seems to be interested in
    maintaining a precise BNF grammer of the language. With the grammer and bison
    it shouldn't take longer then a day.

    GY> Once you have the pr, consider renaming the method Foo#bar to
    GY> Foo#foo():

    GY> ------8<-----
    GY> class Foo; def bob; end; end
    GY> class Bar; def bob; end; def foo; Foo.new; end; end

    GY> a = Foo.new
    GY> b = Bar.new
    GY> a, b = b, a

    GY> a.bob
    GY> b.bob
    GY> ------8<-----

    GY> So far, it would be relatively simple to track variable assignment and
    GY> work out which variables are instances of Foo and then rename references
    GY> from Foo#bob() to Foo#foo

    tracking variable assignment becomes an O(exp n) problem if you must
    follow all paths. So its really unuseable in real world code.

    GY> And although in the code above, you could determine fairly easily what
    GY> type of object will be returned by Bar#foo(), it would be very easy to
    GY> think of situations where it wouldn't be easy and, in the case of
    GY> compiled C extensions, not possible.

    I was thinking a while about tracking the types of arguments and
    results during the runtime of testcases. But this was only to support
    more exact tooltips (code insight). It is very obvious to see that
    tracking information at runtime can only give a partial set of
    information.

    GY> AIUI, refactoring is supposed not to change the behaviour of the code:

    Right, i think that when you offer refactoring, a lot of programmers become
    more lazy in the design phase. And this is bad, because refactoring in
    Ruby/Python/PHP/Perl can't do the same as refactoring in java. They will run
    into problems very soon and much sooner if the projects are growing and
    become multi person projects where everyone has it's own coding style.

    GY> The problem could be partially solved by designing strict rules for
    GY> writing a style of Ruby which could be refactored in well defined ways,
    GY> but I don't think that it would be feasible to do for an otherwise
    GY> unknown Ruby script.

    And this would eliminate the elegance of some ruby solutions and
    eliminate quite a few reasons to use ruby. So it's not a good
    decision.

    --
    Best regards,
    Lothar mailto:mailinglistsscriptolutions.com


    Lothar Scholz Guest

  10. #10

    Default Re: AW: [ann] AEditor 0.10, folding added

    On Thu, 2003-08-14 at 07:36, Lothar Scholz wrote:> GY> So far, it would
    be relatively simple to track variable assignment and
    > GY> work out which variables are instances of Foo and then rename references
    > GY> from Foo#bob() to Foo#foo
    >
    > tracking variable assignment becomes an O(exp n) problem if you must
    > follow all paths. So its really unuseable in real world code.
    SmartEiffel does this, and does it *fast*.

    Still doesn't solve the problem of dynamically loaded/generated code,
    but should address most of the problem.
    > Right, i think that when you offer refactoring, a lot of programmers become
    > more lazy in the design phase. And this is bad, because refactoring in
    > Ruby/Python/PHP/Perl can't do the same as refactoring in java. They will run
    > into problems very soon and much sooner if the projects are growing and
    > become multi person projects where everyone has it's own coding style.
    An interesting theory ... but if you are saying undisciplined groups
    will have problems, then that is true independently of whether
    refactoring is availble or not. Hardly an argument against refactoring.

    --
    -- Jim Weirich [email]jweirichone.net[/email] [url]http://onestepback.org[/url]
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

    Jim Weirich Guest

  11. #11

    Default Re: AW: [ann] AEditor 0.10, folding added

    Go study the p.y file in the Ruby distribution. The lexer is hand
    written, and the pr is tightly bound to the Ruby runtime. If after
    study, however, you think you could generate a precise BNF grammar from
    it...please do...but I don't think its that easy ;-)

    -rich

    On Thursday, August 14, 2003, at 07:36 AM, Lothar Scholz wrote:
    > Right. Stealing it from the ruby source code does not take a long time.
    > The biggest problem is that no one seems to be interested in
    > maintaining a precise BNF grammer of the language. With the grammer
    > and bison
    > it shouldn't take longer then a day.

    Richard Kilmer Guest

Similar Threads

  1. Replies: 11
    Last Post: August 16th, 10:53 PM
  2. [ann] AEditor 0.10, folding added
    By Simon Strandgaard in forum Ruby
    Replies: 3
    Last Post: August 13th, 12:12 PM
  3. [ANN] Aeditor 0.6, feedback wanted
    By Simon Strandgaard in forum Ruby
    Replies: 4
    Last Post: July 13th, 07:26 PM
  4. [ANN] Aeditor-0.1 is unleashed
    By Simon Strandgaard in forum Ruby
    Replies: 13
    Last Post: July 2nd, 08:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139