Re: per 5 converter?

2017-02-13 Thread ToddAndMargo

On 02/13/2017 02:23 PM, ToddAndMargo wrote:

naming and commending

oopscommenting

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: per 5 converter?

2017-02-13 Thread ToddAndMargo

On 02/13/2017 12:55 PM, Darren Duncan wrote:


I think the important thing is having choice.  Declaring parameters in 
terms of named variables is normal and important, but when one does 
that it would still be ideal to get a single extra variable that has 
all the arguments in it as components, for when it is useful. -- 
Darren Duncan 


Hi Darren,

Agreed.  It is having a choice to fit your particular needs.

In my experience (I am by no means a programming expert), the
"writing" of the code is far easier than the "maintaining" of the code.
The extra time one spends on the initial write to make it 8nderstandable,
save me 10 to 20 fold down the road.  I am a YUUUGE fan of Top Down.

In P5, I spend great amount of time naming and commending the
sub variables to make them understandable.  I even use the ($$)
business to make sure I call them correctly.  In P6, the sub variable
naming serves both the name and the comment.  Easy to figure
out at a glance.

-T

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: per 5 converter?

2017-02-13 Thread Shlomi Fish
On Mon, 13 Feb 2017 09:40:32 -0500
Parrot Raiser <1parr...@gmail.com> wrote:

> On 2/12/17, Brandon Allbery  wrote:
> >
> > Translators are infamous for producing gobbledygook no self-respecting
> > programmer would write
> >  
> 
> But unfortunately, far too many programmers do. :-)*

“
Trading was mentioned in the brochure.  The main trade that was carried out
was in the skins of the NowWhattian boghog but it wasn't a very successful
one because no one in their right minds would want to buy a NowWhattian
boghog  skin.   The  trade  only  hung  on  by  its  fingernails  because
there  was always  a  significant  number  of  people  in  the  Galaxy  who
were  not  in  their right minds.
”

From https://en.wikipedia.org/wiki/Mostly_Harmless .

;-)

Regards,

Shlomi Fish


Re: per 5 converter?

2017-02-13 Thread Parrot Raiser
On 2/12/17, Brandon Allbery  wrote:
>
> Translators are infamous for producing gobbledygook no self-respecting 
> programmer would
> write
>

But unfortunately, far too many programmers do. :-)*


Re: per 5 converter?

2017-02-13 Thread Shlomi Fish
[Resending because the email did not arrive to the list. E-mail has sadly
become unreliable.]

Hi T,

On Sat, 11 Feb 2017 22:47:10 -0800
ToddAndMargo  wrote:

> Hi All,
> 
> I know I asked this once before and I had though I'd written it
> down, but do you have any favorite Perl5 to Per6 converters?
> 

There's https://github.com/fglock/Perlito but it's incomplete, and may not
generate idiomatic or too performant code. I recall trying to use it to compile
Perl 5 to JavaScript and after I went to a lot of effort in either fixing
Perlito itself or adapting my code for it to be more compatible with it, it was
executed slower by Node.js than the Perl 5 original.

Regards,

Shlomi Fish

> Many thanks,
> -T
> 


Re: per 5 converter?

2017-02-13 Thread Tom Browder
On Sun, Feb 12, 2017 at 00:47 ToddAndMargo  wrote:

> Hi All,


Todd, I'm with you. I have lots of p5 code I would like to switch to p6 and
see a translator useful to save the grunt work of initial conversion.  I
much prefer cleaning up workable code than manually starting from scratch.

Just my two cents.

Best regards,

-Tom


Re: per 5 converter?

2017-02-12 Thread Darren Duncan

On 2017-02-12 5:08 PM, ToddAndMargo wrote:

I presume my eyes would tell where I made the boo-boo.  Lets hope!
I am real tired of Perl 5's stone age subs declarations.  @_, oh brother.


In principle there is nothing wrong with @_ at least from the perspective that 
it is quite useful to be able to have a single variable or keyword to represent 
the entire argument list as a single value.  Logically, a single value is what 
an entire argument list is anyway, with individual arguments being components of 
that. -- Darren Duncan


Re: per 5 converter?

2017-02-12 Thread ToddAndMargo

  
  
On 02/12/2017 05:02 PM, Brandon Allbery
  wrote:


  

  On Sun, Feb 12, 2017 at 7:48 PM,
ToddAndMargo 
wrote:

  The case
is, if I can't figure out the syntax in Perl 6, white a
quickie in Perl 5, translate it and see what I did
wrong.

  
  
  Translators are infamous for producing gobbledygook no
  self-respecting programmer would write
  
  

  


I presume my eyes would tell where I made the boo-boo. 
  Lets hope!
  I am real tired of Perl 5's stone age subs declarations.  @_, oh
  brother.

-- 
~~~
Having been erased,
The document you're seeking
Must now be retyped.
~~~
  



Re: per 5 converter?

2017-02-12 Thread ToddAndMargo

On 02/12/2017 05:00 PM, yary wrote:
There's Rosetta Code to compare short programs in different languages. 
Not as handy as what you are asking for, still it is educational


To try it out I started at http://rosettacode.org/wiki/Category:Perl_6 
to find all the pages that have P6 examples. I chose "String Case" and 
then clicked on Perl, which got me to the P5 example, and right after 
it was the Perl 6 since each page is alphabetical by language!


(That site is screaming to be fed into a 
machine-learning-code-translator!)


Thank you!

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: per 5 converter?

2017-02-12 Thread yary
There's Rosetta Code to compare short programs in different languages. Not
as handy as what you are asking for, still it is educational

To try it out I started at http://rosettacode.org/wiki/Category:Perl_6 to
find all the pages that have P6 examples. I chose "String Case" and then
clicked on Perl, which got me to the P5 example, and right after it was the
Perl 6 since each page is alphabetical by language!

(That site is screaming to be fed into a machine-learning-code-translator!)


Re: per 5 converter?

2017-02-12 Thread ToddAndMargo

On 02/12/2017 06:34 AM, Moritz Lenz wrote:

Hi,

What's the use case for converting Perl 5 to Perl 6 automatically?

If you want to use Perl 5 code from within your Perl 6 code, you can do
that through Inline::Perl5.

But automatic translation (if it works at all) typically doesn't produce
good or idiomatic code, so you should try to stay away from it.

Cheers,
Moritz


The case is, if I can't figure out the syntax in Perl 6, white a
quickie in Perl 5, translate it and see what I did wrong.

:-)

--
~~
Computers are like air conditioners.
They malfunction when you open windows
~~


Re: per 5 converter?

2017-02-12 Thread Moritz Lenz
Hi,

What's the use case for converting Perl 5 to Perl 6 automatically?

If you want to use Perl 5 code from within your Perl 6 code, you can do
that through Inline::Perl5.

But automatic translation (if it works at all) typically doesn't produce
good or idiomatic code, so you should try to stay away from it.

Cheers,
Moritz

On 12.02.2017 07:47, ToddAndMargo wrote:
> Hi All,
> 
> I know I asked this once before and I had though I'd written it
> down, but do you have any favorite Perl5 to Per6 converters?
> 
> Many thanks,
> -T
> 

-- 
Moritz Lenz
https://deploybook.com/ -- https://perlgeek.de/ -- https://perl6.org/