You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Etienne Gagnon <eg...@sablevm.org> on 2006/11/01 00:25:14 UTC

Re: [classlib] Preprocessor - CHECKPOINT

Tim Ellison wrote:
> IMO it's not ideal that the preprocessed source still contains all the
> streams, albeit in comments.  It wouldn't make the source very
> 'consumable' to the Mrs. SE or ME developer.

Hmmm...  It's always possible to have a special output mode that puts
empty (or advertizing, hehe) comments, instead of other stream code
(thus, preserving line numbers).

To continue on my earlier example:

Java source => "j2se end-developer"
-----------------------------------


...

//  Download Harmony[tm] from
//
//  http://the.nice.harmony.url/download
//
//  :-)

  @Processor(Not in j2me!)
  int some_field =
    some +
      initializing()
        code;

...


Or, more likely:

Java source => "j2se end-developer"
-----------------------------------


...

//  Please  ignore this comment.  It has been
//  intentionally left here to preserve line numbers
//  for bug reporting purpose.
//
//  Please report bugs to http://bugs.of.harmony.url/...

  @Processor(Not in j2me!)
  int some_field =
    some +
      initializing()
        code;

...


So, J2ME & J2SE end-developers are kept happy.

As a bonu$, you can al$o $tart a nice busine$$ $elling advertizing $pace
in $ource code.  ;-P

Etienne

-- 
Etienne M. Gagnon, Ph.D.            http://www.info2.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/

Re: [classlib] Preprocessor - CHECKPOINT

Posted by Tim Ellison <t....@gmail.com>.
Etienne Gagnon wrote:
> Tim Ellison wrote:
>> IMO it's not ideal that the preprocessed source still contains all the
>> streams, albeit in comments.  It wouldn't make the source very
>> 'consumable' to the Mrs. SE or ME developer.
> 
> Hmmm...  It's always possible to have a special output mode that puts
> empty (or advertizing, hehe) comments, instead of other stream code
> (thus, preserving line numbers).

Right, but it was the presence of the comments, not the contents of the
comments that I was objecting to.  Using padding comments would be bad
too IMO.

<snipped example>

> So, J2ME & J2SE end-developers are kept happy.

As I said before, I like the idea to be able to flip the comments
between different processor targets for the benefit of Harmony
developers.  So, for example, you can work with your SE spectacles on,
and I can work with my ME spectacles on, then we both commit to the
repository in a canonical form.  However, for the end-user (Mrs Java
developer) the processor would strip out the irrelevant streams' code
from the canonical form to produce a clean target source code.

> As a bonu$, you can al$o $tart a nice busine$$ $elling advertizing $pace
> in $ource code.  ;-P

LOL -- hey, now you are talking ;-)

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)


Re: [classlib] Preprocessor - CHECKPOINT

Posted by "Geir Magnusson Jr." <ge...@pobox.com>.

Etienne Gagnon wrote:
> Tim Ellison wrote:
>> IMO it's not ideal that the preprocessed source still contains all the
>> streams, albeit in comments.  It wouldn't make the source very
>> 'consumable' to the Mrs. SE or ME developer.
> 
> Hmmm...  It's always possible to have a special output mode that puts
> empty (or advertizing, hehe) comments, instead of other stream code
> (thus, preserving line numbers).
> 
> To continue on my earlier example:
> 
> Java source => "j2se end-developer"
> -----------------------------------
> 
> 
> ...
> 
> //  Download Harmony[tm] from
> //
> //  http://the.nice.harmony.url/download
> //
> //  :-)
> 
>   @Processor(Not in j2me!)
>   int some_field =
>     some +
>       initializing()
>         code;
> 
> ...
> 
> 
> Or, more likely:
> 
> Java source => "j2se end-developer"
> -----------------------------------
> 
> 
> ...
> 
> //  Please  ignore this comment.  It has been
> //  intentionally left here to preserve line numbers
> //  for bug reporting purpose.
> //
> //  Please report bugs to http://bugs.of.harmony.url/...
> 
>   @Processor(Not in j2me!)
>   int some_field =
>     some +
>       initializing()
>         code;
> 
> ...
> 
> 
> So, J2ME & J2SE end-developers are kept happy.

I'm still not quite getting the importance of preserving the line 
numbers like that if we have some minimal tooling to let us work with it 
in eclipse or IDEA invisibly....  users would report bug at line X, and 
we'd either look at the transformed code that they are actually using, 
and translate backwards, or have a plugin that lets us "A/B" between 
transformed and original.

The key is to play with some examples, I guess.

> 
> As a bonu$, you can al$o $tart a nice busine$$ $elling advertizing $pace
> in $ource code.  ;-P

It's our idea - you run with it.  let us know how that works out.  (I 
bet if you could convince some investor that it was a web2.0 thing, you 
could get it funded....)


> 
> Etienne
>