Re: string to integer?

2018-08-06 Thread Brandon Allbery
Prefix + numifies, prefix ~ stringifies.

pyanfar Z$ 6 'my Str $a = "5"; dd +$a'
5
pyanfar Z$ 6 'my Int $a = 5; dd ~$a'
"5"


On Mon, Aug 6, 2018 at 4:59 PM ToddAndMargo  wrote:

> Hi All,
>
> How do I assign a string that looks like an integer
> into an interger?
>
> $str = "601"  -- > $int = 601
>
>
> Many thanks,
> -T
>


-- 
brandon s allbery kf8nh
allber...@gmail.com


Re: Force integers in an array?

2018-08-06 Thread ToddAndMargo

On 08/06/2018 01:44 PM, Curt Tilmes wrote:


On Mon, Aug 6, 2018 at 4:40 PM ToddAndMargo > wrote:


Is there a way to force all the members of an array
to be integers and to error out is a non-integer
is written to one of its cells?


Sure, from the examples in the docs: 
https://docs.perl6.org/language/list#Typing


my Int @a = 1, 2, 3; # An Array that contains only Ints
my @b := Array[Int].new(1, 2, 3); 
# Same thing, but the variable is not typed

my @b := Array[Int](1, 2, 3); # Rakudo shortcut for the same code

@a[0] = 42; # fine
@a[0] = "foo"; # error: Type check failed in assignment




Thank you!


Re: Force integers in an array?

2018-08-06 Thread ToddAndMargo

On 08/06/2018 01:42 PM, Brad Gilbert wrote:

my Int @a;
@a[0] = '1'

Type check failed in assignment to @a; expected Int but got Str ("1")
   in block  at  line 1
On Mon, Aug 6, 2018 at 3:39 PM ToddAndMargo  wrote:


Hi All,

Is there a way to force all the members of an array
to be integers and to error out is a non-integer
is written to one of its cells?


Many thanks,
-T


Thank you!


string to integer?

2018-08-06 Thread ToddAndMargo

Hi All,

How do I assign a string that looks like an integer
into an interger?

$str = "601"  -- > $int = 601


Many thanks,
-T


Re: Force integers in an array?

2018-08-06 Thread Curt Tilmes
On Mon, Aug 6, 2018 at 4:40 PM ToddAndMargo  wrote:

> Is there a way to force all the members of an array
> to be integers and to error out is a non-integer
> is written to one of its cells?
>

Sure, from the examples in the docs:
https://docs.perl6.org/language/list#Typing

my Int @a = 1, 2, 3;  # An Array that contains only Ints
my @b := Array[Int].new(1, 2, 3); # Same thing, but the variable is not typed
my @b := Array[Int](1, 2, 3); # Rakudo shortcut for the same code

@a[0] = 42;   # fine
@a[0] = "foo";# error: Type check failed in assignment


Re: Force integers in an array?

2018-08-06 Thread Brad Gilbert
> my Int @a;
> @a[0] = '1'
Type check failed in assignment to @a; expected Int but got Str ("1")
  in block  at  line 1
On Mon, Aug 6, 2018 at 3:39 PM ToddAndMargo  wrote:
>
> Hi All,
>
> Is there a way to force all the members of an array
> to be integers and to error out is a non-integer
> is written to one of its cells?
>
>
> Many thanks,
> -T


Force integers in an array?

2018-08-06 Thread ToddAndMargo

Hi All,

Is there a way to force all the members of an array
to be integers and to error out is a non-integer
is written to one of its cells?


Many thanks,
-T


Announce: Rakudo Star Release 2018.06

2018-08-06 Thread Steve Mynott
On behalf of the Rakudo and Perl 6 development teams, I'm pleased to announce
the June 2018 release of "Rakudo Star", a useful and usable production
distribution of Rakudo Perl 6.  The tarball for this release is available from
.

Binaries for macOS and Windows (64 bit) are also available at the same
location.

This is a post-Christmas (production) release of Rakudo Star and implements
Perl v6.c. It comes with support for the MoarVM backend (all module tests pass
on supported platforms).  Currently, Star is on a quarterly release cycle.

Please note that this release of Rakudo Star is not fully functional with the
JVM backend from the Rakudo compiler. Please use the MoarVM backend only.

In the Perl 6 world, we make a distinction between the language ("Perl 6") and
specific implementations of the language such as "Rakudo Perl 6".

This Star release includes [release 2018.06] of the [Rakudo Perl 6 compiler],
version 2018.06 [MoarVM], plus various modules, documentation, and other
resources collected from the Perl 6 community.

[release 2018.06]:
https://raw.githubusercontent.com/rakudo/rakudo/2018.06/docs/announce/2018.06.md
[Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo
[MoarVM]: http://moarvm.org/

The Rakudo compiler changes since the last Rakudo Star release are now listed
in "2018.05.md" and 2018.06.md" under the "rakudo/docs/announce" directory of
the source distribution.

Important Rakudo bug fixes are now listed at 

Also see Rakudo Star errata at 

Deprecation:

  * LWP::Simple is deprecated and will be removed. Please use "HTTP::UserAgent".

Notable changes in modules shipped with Rakudo Star:

  * openssl: added
  * io-socket-ssl: added
  * http-useragent: version 1.1.44
  * Terminal-ANSIColor: italic now accessible via the color() sub
  * zef: version 0.4.5

There are some key features of Perl 6 that Rakudo Star does not yet
handle appropriately, although they will appear in upcoming releases.
Some of the not-quite-there features include:

  * advanced macros
  * some bits of Synopsis 9 and 11

There is an online resource at 
that lists the known implemented and missing features of Rakudo's
backends and other Perl 6 implementations.

In many places we've tried to make Rakudo smart enough to inform the
programmer that a given feature isn't implemented, but there are many
that we've missed. Bug reports about missing and broken features are
welcomed at .

See  for links to much more information about
Perl 6, including documentation, example code, tutorials, presentations,
reference materials, design documents, and other supporting resources.
Some Perl 6 tutorials are available under the "docs" directory in
the release tarball.

The development team thanks all of the contributors and sponsors for
making Rakudo Star possible. If you would like to contribute, see
, ask on the 
mailing list, or join us on IRC \#perl6 on freenode.

-- 
Steve Mynott 
cv25519/ECF8B611205B447E091246AF959E3D6197190DD5


Re: Creating the August 2018 Perl6 survey

2018-08-06 Thread Elizabeth Mattijsen
Is there a Github repo of sorts to which people can add Pull Requests / comment 
upon?

> On 6 Aug 2018, at 03:13, Benji  wrote:
> 
> We're working on polishing up questions / adding new questions for the next 
> Perl6 user survey. If you'd like an invitation to change/add questions, hop 
> on the IRC or respond to this email.


Re: parsing in different modes

2018-08-06 Thread Theo van den Heuvel

sorry, false alarm. It does work as advertised.

Theo van den Heuvel

Theo van den Heuvel schreef op 2018-08-03 22:39:

Hi all,

My attempt at a solution below does not work. In larger examples the
decr gets called before the actions within Sum are processed. Maybe my
hunch that this would cause time order problems was correct. I need to
do some more researching. I'll post my findings.

best wishes,


Theo van den Heuvel

Theo van den Heuvel schreef op 2018-08-02 14:58:

Hi Laurent,

Here I set my example up along the lines of your second suggestion.

grammar Sum {
  token TOP { ^  $ }
  rule Sum { + %  }
  rule Expr {  | { self.incr } '[' ~ ']'   { self.decr } }
  token op { <[-+]> }
  token num { \d+ }
  token flag {  }
  method incr { self.actions.incr }
  method decr { self.actions.decr }
}
class Act {
  has Int $.nest;
  method num ($/) { say ">>> $/ at nesting level $!nest" }
  method incr { $!nest++ }
  method decr { $!nest-- }
}

This works nicely and fulfils my requirements.

Thanks,
Theo

Laurent Rosenfeld schreef op 2018-08-01 23:00:

Hi Theo,

You probably cannot use a grammar rule to change a dynamic variable
(unless you include some action code into the rule), I agree, but I
think you can use an action method attached to a rule to do it. I 
have

actually done it recently in a real $work grammar that I intend to
present at The Perl Conference in Glasgow in two weeks from now. Your
use case and mine are admittedly very different, but it seems to me
that they are syntactically very similar.

As an alternative, you could use an action object with an attribute 
(a

mutable attribute, _is rw_) for the mode. Basically, you instantiate
an object of the actions class (with the desired attribute set to the
proper initial mode at object creation), and then pass the object
instead of the class to the grammar when calling the _parse_ method.
It should be easy then to modify the attribute as needed. This is
perhaps slightly cleaner than using a dynamic variable.

I hope this helps.
Laurent.

...


Re: start up delay?

2018-08-06 Thread Steve Mynott
Are you using a 32 bit version of perl6?

If so it has no Just in Time (JIT) compiler and will be very much slower.


S
On Wed, 1 Aug 2018 at 19:15, ToddAndMargo  wrote:
>
> Hi All,
>
> Is it just me or does Perl 6 take about three times as long to
> start up as Perl 5?  I do have a very fast machine and it takes
> about seven see for some of my Perl 6 stuff to get past the
> ruminating phase and start running.
>
> Any workaround for this, or is this just growing pains for Perl 6?
>
> Many thanks,
> -T



-- 
Steve Mynott 
cv25519/ECF8B611205B447E091246AF959E3D6197190DD5


Re: start up delay?

2018-08-06 Thread Patrick Spek via perl6-users
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

If you're writing a runnable script in Perl 6, I would recommend to
*always* use a MAIN sub[1]. If you're using that, you can easily
achieve the precompilation as well, with 1 line of code less.

You'd have your code in lib/Your/Program/Main.pm6:

sub MAIN (
# You can let Perl 6 handle arguments here
) is export {
# Program code here
}

Next, the script that you actually run would be in bin/program, and
contain the following code:

use lib "./";
use Your::Program::Main;

This should give you all of the Perl 6 MAIN goodness, and a faster
program.

[1]: https://docs.perl6.org/language/functions#index-entry-MAIN

On Mon, 6 Aug 2018 10:56:43 +0100
Simon Proctor  wrote:

> So Perl6 is a lot like Python in that modules get compiled to byte
> code making them a lot faster to parse the second time around.
> 
> If you're running a 6000 line script then a lot of time is going to be
> spent parsing your script every time you run it. If you instead take
> all your script code and pop it into a module and have a script along
> the lines of :
> 
> use lib "./";
> use System;
> 
> System::start();
> 
> (Where your module code is called System.pm6 and start is the entry
> point subroutine).
> 
> I think you'd find this improves the speed of the script
> significantly.
> 
> On Mon, 6 Aug 2018 at 10:38 ToddAndMargo 
> wrote:
> 
> > On 08/06/2018 02:07 AM, ToddAndMargo wrote:  
> > > On 08/06/2018 01:02 AM, Simon Proctor wrote:  
> > >> Sorry I wrote my earlier email on my phone without a computer to
> > >> hand. Here's a quick rundown on what I'm talking about.
> > >>
> > >> --stagestats gives you the breakdown on how much time is spent
> > >> doing various steps (note that using time instead of date; date
> > >> gives you a better timing of how long something took.
> > >>
> > >> time perl6 --stagestats -e ""
> > >> Stage start  :   0.000
> > >> Stage parse  :   0.089
> > >> Stage syntaxcheck:   0.000
> > >> Stage ast:   0.000
> > >> Stage optimize   :   0.001
> > >> Stage mast   :   0.004
> > >> Stage mbc:   0.000
> > >> Stage moar   :   0.000
> > >>
> > >> real0m0.144s
> > >> user0m0.155s
> > >> sys0m0.032s
> > >>
> > >> And generally that's going to be the case for most short
> > >> programs, in these cases especially moving to having the core of
> > >> your code in modules with give you a speed boost.
> > >>
> > >> Sorry if my comments earlier were unhelpful.
> > >>
> > >> Simon
> > >>
> > >> On Mon, 6 Aug 2018 at 08:56 ToddAndMargo  > >> > wrote:
> > >>  
> > >>  >> On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen,
> > >>  >>  > >>   
> > >>  >> >> wrote:
> > >>  >>  
> > >>  >>  > On 1 Aug 2018, at 20:14, ToddAndMargo  
> > >> mailto:toddandma...@zoho.com>  
> > >>  >>  > >> >> wrote:  
> > >>  >>  > Is it just me or does Perl 6 take about three
> > >>  >>  > times as  
> > >> long to  
> > >>  >>  > start up as Perl 5?  I do have a very fast
> > >>  >>  > machine and it  
> > >> takes  
> > >>  >>  > about seven see for some of my Perl 6 stuff to
> > >>  >>  > get past  
> > >> the  
> > >>  >>  > ruminating phase and start running.  
> > >>  >>
> > >>  >> Seven seconds?  Seven?  That seems *very* long
> > >>  >> indeed.
> > >>  >>
> > >>  >> How long does it take to do:
> > >>  >>
> > >>  >> perl6 -e ‘’
> > >>  >>
> > >>  >> ?  That should be in the order of 130 msecs.  If
> > >>  >> that’s the  
> > >> case,  
> > >>  >> then you’re probably doing a lot of grammar changes
> > >>  >> to Perl  
> > >> 6.  But  
> > >>  >> without the actual code, this remains guessing.
> > >>  >>
> > >>  >>  
> > >>  >>  > Any workaround for this, or is this just growing
> > >>  >>  > pains  
> > >> for Perl 6?  
> > >>  >>
> > >>  >> Not sure  :-)
> > >>  >>
> > >>  >>
> > >>  >>
> > >>  >> Liz
> > >>  >>
> > >>  >> --
> > >>  >> Simon Proctor
> > >>  >> Cognoscite aliquid novum cotidie  
> > >>
> > >> On 08/05/2018 10:57 PM, Simon Proctor wrote:  
> > >>  > Have you tried running with --stagestats which gives you
> > >>  > a break  
> > >> down of  
> > >>  > where the time is being spent?
> > >>  >
> > >>  > On thing is if you are running large script files it came
> > >>  > take a  
> > >> while.  
> > >>  > Moving your code into modules, which get precompiled can
> > >>  > give a significant speed boost.  
> > >>
> > >> Does this tell you anything?
> > >>
> > >> $ curl --fail --head https://google.com; echo $?
> > >> 

Re: start up delay?

2018-08-06 Thread Simon Proctor
So Perl6 is a lot like Python in that modules get compiled to byte code
making them a lot faster to parse the second time around.

If you're running a 6000 line script then a lot of time is going to be
spent parsing your script every time you run it. If you instead take all
your script code and pop it into a module and have a script along the lines
of :

use lib "./";
use System;

System::start();

(Where your module code is called System.pm6 and start is the entry point
subroutine).

I think you'd find this improves the speed of the script significantly.

On Mon, 6 Aug 2018 at 10:38 ToddAndMargo  wrote:

> On 08/06/2018 02:07 AM, ToddAndMargo wrote:
> > On 08/06/2018 01:02 AM, Simon Proctor wrote:
> >> Sorry I wrote my earlier email on my phone without a computer to hand.
> >> Here's a quick rundown on what I'm talking about.
> >>
> >> --stagestats gives you the breakdown on how much time is spent doing
> >> various steps (note that using time instead of date; date gives you a
> >> better timing of how long something took.
> >>
> >> time perl6 --stagestats -e ""
> >> Stage start  :   0.000
> >> Stage parse  :   0.089
> >> Stage syntaxcheck:   0.000
> >> Stage ast:   0.000
> >> Stage optimize   :   0.001
> >> Stage mast   :   0.004
> >> Stage mbc:   0.000
> >> Stage moar   :   0.000
> >>
> >> real0m0.144s
> >> user0m0.155s
> >> sys0m0.032s
> >>
> >> And generally that's going to be the case for most short programs, in
> >> these cases especially moving to having the core of your code in
> >> modules with give you a speed boost.
> >>
> >> Sorry if my comments earlier were unhelpful.
> >>
> >> Simon
> >>
> >> On Mon, 6 Aug 2018 at 08:56 ToddAndMargo  >> > wrote:
> >>
> >>  >> On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen,  >> 
> >>  >> >> wrote:
> >>  >>
> >>  >>  > On 1 Aug 2018, at 20:14, ToddAndMargo
> >> mailto:toddandma...@zoho.com>
> >>  >>  >> >> wrote:
> >>  >>  > Is it just me or does Perl 6 take about three times as
> >> long to
> >>  >>  > start up as Perl 5?  I do have a very fast machine and it
> >> takes
> >>  >>  > about seven see for some of my Perl 6 stuff to get past
> >> the
> >>  >>  > ruminating phase and start running.
> >>  >>
> >>  >> Seven seconds?  Seven?  That seems *very* long indeed.
> >>  >>
> >>  >> How long does it take to do:
> >>  >>
> >>  >> perl6 -e ‘’
> >>  >>
> >>  >> ?  That should be in the order of 130 msecs.  If that’s the
> >> case,
> >>  >> then you’re probably doing a lot of grammar changes to Perl
> >> 6.  But
> >>  >> without the actual code, this remains guessing.
> >>  >>
> >>  >>
> >>  >>  > Any workaround for this, or is this just growing pains
> >> for Perl 6?
> >>  >>
> >>  >> Not sure  :-)
> >>  >>
> >>  >>
> >>  >>
> >>  >> Liz
> >>  >>
> >>  >> --
> >>  >> Simon Proctor
> >>  >> Cognoscite aliquid novum cotidie
> >>
> >> On 08/05/2018 10:57 PM, Simon Proctor wrote:
> >>  > Have you tried running with --stagestats which gives you a break
> >> down of
> >>  > where the time is being spent?
> >>  >
> >>  > On thing is if you are running large script files it came take a
> >> while.
> >>  > Moving your code into modules, which get precompiled can give a
> >>  > significant speed boost.
> >>
> >> Does this tell you anything?
> >>
> >> $ curl --fail --head https://google.com; echo $?
> >> HTTP/2 301
> >> location: https://www.google.com/
> >> content-type: text/html; charset=UTF-8
> >> date: Mon, 06 Aug 2018 05:19:51 GMT
> >> expires: Wed, 05 Sep 2018 05:19:51 GMT
> >> cache-control: public, max-age=2592000
> >> server: gws
> >> content-length: 220
> >> x-xss-protection: 1; mode=block
> >> x-frame-options: SAMEORIGIN
> >> alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"
> >>
> >> 0
> >>
> >> --
> >> Simon Proctor
> >> Cognoscite aliquid novum cotidie
> >
> > real0m14.580s
> > user0m13.723s
> > sys0m0.418s
>
>
> The program is 6160 line long plus a bunch of imported
> modules.
>
> The Perl 5 version of this program that starts three
> times faster is 6354 lines long plus a bunch if imported
> modules.
>
> The slow start is not a reason to go back to p5 for
> any reason.  It would just be nice if it started faster.
>
-- 
Simon Proctor
Cognoscite aliquid novum cotidie


Re: start up delay?

2018-08-06 Thread ToddAndMargo

On 08/06/2018 02:07 AM, ToddAndMargo wrote:

On 08/06/2018 01:02 AM, Simon Proctor wrote:
Sorry I wrote my earlier email on my phone without a computer to hand. 
Here's a quick rundown on what I'm talking about.


--stagestats gives you the breakdown on how much time is spent doing 
various steps (note that using time instead of date; date gives you a 
better timing of how long something took.


time perl6 --stagestats -e ""
Stage start  :   0.000
Stage parse  :   0.089
Stage syntaxcheck:   0.000
Stage ast    :   0.000
Stage optimize   :   0.001
Stage mast   :   0.004
Stage mbc    :   0.000
Stage moar   :   0.000

real    0m0.144s
user    0m0.155s
sys    0m0.032s

And generally that's going to be the case for most short programs, in 
these cases especially moving to having the core of your code in 
modules with give you a speed boost.


Sorry if my comments earlier were unhelpful.

Simon

On Mon, 6 Aug 2018 at 08:56 ToddAndMargo > wrote:


 >> On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen, mailto:l...@wenzperl.nl>
 >> >> wrote:
 >>
 >>      > On 1 Aug 2018, at 20:14, ToddAndMargo
    mailto:toddandma...@zoho.com>
 >>     >> wrote:
 >>      > Is it just me or does Perl 6 take about three times as
    long to
 >>      > start up as Perl 5?  I do have a very fast machine and it
    takes
 >>      > about seven see for some of my Perl 6 stuff to get past 
the

 >>      > ruminating phase and start running.
 >>
 >>     Seven seconds?  Seven?  That seems *very* long indeed.
 >>
 >>     How long does it take to do:
 >>
 >>         perl6 -e ‘’
 >>
 >>     ?  That should be in the order of 130 msecs.  If that’s the
    case,
 >>     then you’re probably doing a lot of grammar changes to Perl
    6.  But
 >>     without the actual code, this remains guessing.
 >>
 >>
 >>      > Any workaround for this, or is this just growing pains
    for Perl 6?
 >>
 >>     Not sure  :-)
 >>
 >>
 >>
 >>     Liz
 >>
 >> --
 >> Simon Proctor
 >> Cognoscite aliquid novum cotidie

    On 08/05/2018 10:57 PM, Simon Proctor wrote:
 > Have you tried running with --stagestats which gives you a break
    down of
 > where the time is being spent?
 >
 > On thing is if you are running large script files it came take a
    while.
 > Moving your code into modules, which get precompiled can give a
 > significant speed boost.

    Does this tell you anything?

    $ curl --fail --head https://google.com; echo $?
    HTTP/2 301
    location: https://www.google.com/
    content-type: text/html; charset=UTF-8
    date: Mon, 06 Aug 2018 05:19:51 GMT
    expires: Wed, 05 Sep 2018 05:19:51 GMT
    cache-control: public, max-age=2592000
    server: gws
    content-length: 220
    x-xss-protection: 1; mode=block
    x-frame-options: SAMEORIGIN
    alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"

    0

--
Simon Proctor
Cognoscite aliquid novum cotidie


real    0m14.580s
user    0m13.723s
sys    0m0.418s



The program is 6160 line long plus a bunch of imported
modules.

The Perl 5 version of this program that starts three
times faster is 6354 lines long plus a bunch if imported
modules.

The slow start is not a reason to go back to p5 for
any reason.  It would just be nice if it started faster.


Re: start up delay?

2018-08-06 Thread ToddAndMargo

On 08/06/2018 01:02 AM, Simon Proctor wrote:
Sorry I wrote my earlier email on my phone without a computer to hand. 
Here's a quick rundown on what I'm talking about.


--stagestats gives you the breakdown on how much time is spent doing 
various steps (note that using time instead of date; date gives you a 
better timing of how long something took.


time perl6 --stagestats -e ""
Stage start  :   0.000
Stage parse  :   0.089
Stage syntaxcheck:   0.000
Stage ast    :   0.000
Stage optimize   :   0.001
Stage mast   :   0.004
Stage mbc    :   0.000
Stage moar   :   0.000

real    0m0.144s
user    0m0.155s
sys    0m0.032s

And generally that's going to be the case for most short programs, in 
these cases especially moving to having the core of your code in modules 
with give you a speed boost.


Sorry if my comments earlier were unhelpful.

Simon

On Mon, 6 Aug 2018 at 08:56 ToddAndMargo > wrote:


 >> On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen, mailto:l...@wenzperl.nl>
 >> >> wrote:
 >>
 >>      > On 1 Aug 2018, at 20:14, ToddAndMargo
mailto:toddandma...@zoho.com>
 >>     >> wrote:
 >>      > Is it just me or does Perl 6 take about three times as
long to
 >>      > start up as Perl 5?  I do have a very fast machine and it
takes
 >>      > about seven see for some of my Perl 6 stuff to get past the
 >>      > ruminating phase and start running.
 >>
 >>     Seven seconds?  Seven?  That seems *very* long indeed.
 >>
 >>     How long does it take to do:
 >>
 >>         perl6 -e ‘’
 >>
 >>     ?  That should be in the order of 130 msecs.  If that’s the
case,
 >>     then you’re probably doing a lot of grammar changes to Perl
6.  But
 >>     without the actual code, this remains guessing.
 >>
 >>
 >>      > Any workaround for this, or is this just growing pains
for Perl 6?
 >>
 >>     Not sure  :-)
 >>
 >>
 >>
 >>     Liz
 >>
 >> --
 >> Simon Proctor
 >> Cognoscite aliquid novum cotidie

On 08/05/2018 10:57 PM, Simon Proctor wrote:
 > Have you tried running with --stagestats which gives you a break
down of
 > where the time is being spent?
 >
 > On thing is if you are running large script files it came take a
while.
 > Moving your code into modules, which get precompiled can give a
 > significant speed boost.

Does this tell you anything?

$ curl --fail --head https://google.com; echo $?
HTTP/2 301
location: https://www.google.com/
content-type: text/html; charset=UTF-8
date: Mon, 06 Aug 2018 05:19:51 GMT
expires: Wed, 05 Sep 2018 05:19:51 GMT
cache-control: public, max-age=2592000
server: gws
content-length: 220
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"

0

--
Simon Proctor
Cognoscite aliquid novum cotidie


real0m14.580s
user0m13.723s
sys 0m0.418s


Re: start up delay?

2018-08-06 Thread Simon Proctor
Sorry I wrote my earlier email on my phone without a computer to hand.
Here's a quick rundown on what I'm talking about.

--stagestats gives you the breakdown on how much time is spent doing
various steps (note that using time instead of date; date gives you a
better timing of how long something took.

time perl6 --stagestats -e ""
Stage start  :   0.000
Stage parse  :   0.089
Stage syntaxcheck:   0.000
Stage ast:   0.000
Stage optimize   :   0.001
Stage mast   :   0.004
Stage mbc:   0.000
Stage moar   :   0.000

real0m0.144s
user0m0.155s
sys0m0.032s

And generally that's going to be the case for most short programs, in these
cases especially moving to having the core of your code in modules with
give you a speed boost.

Sorry if my comments earlier were unhelpful.

Simon

On Mon, 6 Aug 2018 at 08:56 ToddAndMargo  wrote:

> >> On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen,  >> > wrote:
> >>
> >>  > On 1 Aug 2018, at 20:14, ToddAndMargo  >> > wrote:
> >>  > Is it just me or does Perl 6 take about three times as long to
> >>  > start up as Perl 5?  I do have a very fast machine and it takes
> >>  > about seven see for some of my Perl 6 stuff to get past the
> >>  > ruminating phase and start running.
> >>
> >> Seven seconds?  Seven?  That seems *very* long indeed.
> >>
> >> How long does it take to do:
> >>
> >> perl6 -e ‘’
> >>
> >> ?  That should be in the order of 130 msecs.  If that’s the case,
> >> then you’re probably doing a lot of grammar changes to Perl 6.  But
> >> without the actual code, this remains guessing.
> >>
> >>
> >>  > Any workaround for this, or is this just growing pains for Perl
> 6?
> >>
> >> Not sure  :-)
> >>
> >>
> >>
> >> Liz
> >>
> >> --
> >> Simon Proctor
> >> Cognoscite aliquid novum cotidie
>
> On 08/05/2018 10:57 PM, Simon Proctor wrote:
> > Have you tried running with --stagestats which gives you a break down of
> > where the time is being spent?
> >
> > On thing is if you are running large script files it came take a while.
> > Moving your code into modules, which get precompiled can give a
> > significant speed boost.
>
> Does this tell you anything?
>
> $ curl --fail --head https://google.com; echo $?
> HTTP/2 301
> location: https://www.google.com/
> content-type: text/html; charset=UTF-8
> date: Mon, 06 Aug 2018 05:19:51 GMT
> expires: Wed, 05 Sep 2018 05:19:51 GMT
> cache-control: public, max-age=2592000
> server: gws
> content-length: 220
> x-xss-protection: 1; mode=block
> x-frame-options: SAMEORIGIN
> alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"
>
> 0
>
-- 
Simon Proctor
Cognoscite aliquid novum cotidie


Re: start up delay?

2018-08-06 Thread ToddAndMargo
On Sun, 5 Aug 2018, 23:45 Elizabeth Mattijsen, > wrote:


 > On 1 Aug 2018, at 20:14, ToddAndMargo mailto:toddandma...@zoho.com>> wrote:
 > Is it just me or does Perl 6 take about three times as long to
 > start up as Perl 5?  I do have a very fast machine and it takes
 > about seven see for some of my Perl 6 stuff to get past the
 > ruminating phase and start running.

Seven seconds?  Seven?  That seems *very* long indeed.

How long does it take to do:

perl6 -e ‘’

?  That should be in the order of 130 msecs.  If that’s the case,
then you’re probably doing a lot of grammar changes to Perl 6.  But
without the actual code, this remains guessing.


 > Any workaround for this, or is this just growing pains for Perl 6?

Not sure  :-)



Liz

--
Simon Proctor
Cognoscite aliquid novum cotidie


On 08/05/2018 10:57 PM, Simon Proctor wrote:
Have you tried running with --stagestats which gives you a break down of 
where the time is being spent?


On thing is if you are running large script files it came take a while. 
Moving your code into modules, which get precompiled can give a 
significant speed boost.


Does this tell you anything?

$ curl --fail --head https://google.com; echo $?
HTTP/2 301
location: https://www.google.com/
content-type: text/html; charset=UTF-8
date: Mon, 06 Aug 2018 05:19:51 GMT
expires: Wed, 05 Sep 2018 05:19:51 GMT
cache-control: public, max-age=2592000
server: gws
content-length: 220
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
alt-svc: quic=":443"; ma=2592000; v="44,43,39,35"

0


Re: start up delay?

2018-08-06 Thread ToddAndMargo

On 08/01/2018 01:15 PM, Elizabeth Mattijsen wrote:

On 1 Aug 2018, at 20:14, ToddAndMargo  wrote:
Is it just me or does Perl 6 take about three times as long to
start up as Perl 5?  I do have a very fast machine and it takes
about seven see for some of my Perl 6 stuff to get past the
ruminating phase and start running.


Seven seconds?  Seven?  That seems *very* long indeed.

How long does it take to do:

perl6 -e ‘’


$ date; p6 ''; date
Mon Aug  6 00:51:10 PDT 2018
Mon Aug  6 00:51:10 PDT 2018

$ date; p6 'say "Why is this taking so long"'; date
Mon Aug  6 00:52:17 PDT 2018
Why is this taking so long
Mon Aug  6 00:52:17 PDT 2018



?  That should be in the order of 130 msecs.  If that’s the case, then you’re 
probably doing a lot of grammar changes to Perl 6.  But without the actual 
code, this remains guessing.


What is a "gammer change" and how do I minimize them?



Any workaround for this, or is this just growing pains for Perl 6?


Not sure  :-)



Liz




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