Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 19:58, ToddAndMargo via perl6-users wrote:

On 8/29/22 19:26, Brad Gilbert wrote:
The Raku compiler is written in Raku (to an extent) so no it can't be 
toned down. I've been out of the loop for a while, but there has been 
work to make the compiler use a better design which should be more 
optimizable.


Awesome.




I would love to hear from Larry if there is some
technical reason behind the slowness and it is
just not lack of time and/or resources on the
developers part.


Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 19:26, Brad Gilbert wrote:
The Raku compiler is written in Raku (to an extent) so no it can't be 
toned down. I've been out of the loop for a while, but there has been 
work to make the compiler use a better design which should be more 
optimizable.


Awesome.



Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread Brad Gilbert
The Raku compiler is written in Raku (to an extent) so no it can't be toned
down. I've been out of the loop for a while, but there has been work to
make the compiler use a better design which should be more optimizable.

On Mon, Aug 29, 2022, 2:01 PM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 8/29/22 11:50, Brad Gilbert wrote:
> > Actually Raku is faster to compile than Perl5. If you consider all of
> > the features it comes with.
> >
> > For example, in Raku everything is an object with meta features. If you
> > add Moose or similar to Perl5 then the compile times will often take
> > longer than the equivalent Raku times.
> >
> > That's not the only such feature that you have to add to Perl5 to get
> > feature parity.
> >
> > Then you have to also realize that the Perl5 compiler has had since 1994
> > to get faster vs. 2015 for Raku.
>
> I do adore Perl 6 (Raku).  I almost completely
> dropped Perl 5 when I got a load of P6's
> subroutines.  I program in Top Down and P5's
> subs are a nightmare.   I have one P5 program
> I support that I have not ported yet.
>
> As a beginner, my programs are rather simple.
> If P6 being feature rich is part of the
> problem, is there a way to tell P6's compiler
> to back off a bit?
>
>
>
>
>


Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/28/22 15:58, ToddAndMargo via perl6-users wrote:

Hi All,

I am thinking of using

    BEGIN {}

to fire up a splash screen (libnotify).

Question: is what happens between the brackets
isolated from the rest of the code?   If I set
variable values or declare variables, are they
wiped out, etc.?

Many thanks,
-T






My keeper on BEGIN.  That you for all the help
and tips!



Perl6: BEGIN {}


BEGIN is a special subroutine that runs at compile time.
It will see any code above it, such as variables and
imported modules, but not below it.

The idea is to run something at the start of compile before
the rest of compile completes.  A splash screen for example.

Perl 6's compile can take a very long time and users may not
realize it started and restart it several times.

Note that a space is required between `BEGIN and the `{}`


BEGIN {
   # Splash Screen

 ( my $ProgramName   = $?FILE ) ~~ s|.*"/"||;
   my Str $NotifyStr = "\nStarting $ProgramName\n";
   my Str $Icon  = "/home/linuxutil/Images/Info.png";
   my Str $Title = "$ProgramName Splash Screen";
   my Str $Timeout   = "8";   # zenity = seconds

   # Note: zenity seems to not detach when run without a shell
   shell "zenity --info --title \"$Title\" --text \"$NotifyStr\" 
--width=220 --timeout=$Timeout &";

}



Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 13:03, ToddAndMargo via perl6-users wrote:

On 8/28/22 15:58, ToddAndMargo via perl6-users wrote:

Hi All,

I am thinking of using

    BEGIN {}

to fire up a splash screen (libnotify).

Question: is what happens between the brackets
isolated from the rest of the code?   If I set
variable values or declare variables, are they
wiped out, etc.?

Many thanks,
-T


Follow up:

Thank you all for the help!

My splash screen pops up whilst the
rest of the program compiles.

Here is my BEGIN code.   If you are
wondering why all the variables when
I could just write it in the run line,
it is becasue the names of the variables
and the comments next to them tell me what
the parameters of notify-send are and
how to use them.  Much easier to maintain.



#!/usr/bin/env perl6

use RunNoShellLib :RunNoShell, :RunNoShellCode, :RunNoShellErr;

BEGIN {
    # Splash Screen

  ( my $ProgramName   = $?FILE ) ~~ s|.*"/"||;
    my Str $NotifyStr = "\nStarting $ProgramName\n";
    my Str $Icon  = "/home/linuxutil/Images/Info.png";
    my Str $Title = "$ProgramName Splash Screen";
    my Str $Timeout   = "8000";  # milliseconds

    RunNoShell( "notify-send -u normal -t \"$Timeout\" -i \"$Icon\" 
\"$Title\" \"$NotifyStr\"" );

}



:-)

Love Raku!

-T



I changed my BEGIN a bit.  Send-notify open on the right under the last 
notification.


Zenity allow me to open up right in the middle to the
screen.

And I had to switch from run to shell to get zenity
to detach.  Otherwise the compiler stops until
zenity returns


BEGIN {
   # Splash Screen

 ( my $ProgramName   = $?FILE ) ~~ s|.*"/"||;
   my Str $NotifyStr = "\nStarting $ProgramName\n";
   my Str $Icon  = "/home/linuxutil/Images/Info.png";
   my Str $Title = "$ProgramName Splash Screen";
   # my Str $Timeout   = "8000";  # notify-send = milliseconds
   my Str $Timeout   = "8";   # zenity = seconds

   # Note: zenity seems to not detach when run without a shell
   # RunNoShell( "zenity --info --title \"$Title\" --text 
\"$NotifyStr\" --width=220 --timeout=$Timeout" );
   shell "zenity --info --title \"$Title\" --text \"$NotifyStr\" 
--width=220 --timeout=$Timeout &";

}


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


Re: detach?

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 17:59, ToddAndMargo via perl6-users wrote:

Hi All,

How do I trigger and detach and external program from
inside Raku?  I want the program to go off on its
own and I do not want any results back from it.

Many thanks,
-T



Figured it out with `shell` but not `run`
(I want both for my notes.)

shell "zenity --info --title \"$Title\" --text \"$NotifyStr\" 
--width=220 --timeout=$Timeout &";


detach?

2022-08-29 Thread ToddAndMargo via perl6-users

Hi All,

How do I trigger and detach and external program from
inside Raku?  I want the program to go off on its
own and I do not want any results back from it.

Many thanks,
-T


Reno 911 || AIDS not HIV. TV/TB. Please help I need a healer.

2022-08-29 Thread Maneesh D. Sud
Well, my habit of asking "url?" had not changed a bit; descriptions of objects 
cannot be resolved into real ideas without a pointer, and URL is a very good 
and precise way to motivate people putting their ideas into resolvable entities.

I may not have internet access when I need a lifesaver. I need a 1-800 number 
that is super easy to remember. I signed a contract for a drug company to test 
drugs on me in Long Beach, CA. I left California. Please someone talk to me. 
FCC License? Capacity Hearing? Sonic the Hedgehog: Robotnik turning the animals 
into robots.

(Summer of 2020) They gave me twenty dollars for participation. I used the 
money to buy cigars and soda pop. I tried to put myself under hypnosis soon 
after. I wanted to receive coded messages and started leaving a bread crumb 
here and there. Years ago I had heard beeps and clicks in jail coming from 
intercom and television.

Self Talk, Conversations with self about identity, needs and likes, planning. 
The voices asked me questions others would not ask. I have no proof of friend 
nor the belief that the same scientists are listening. I do not know how old I 
am but no one doubts that I am an adult. Scenarios, profiles and commands.

I agreed for 10 years of voices. I think the voices told me to write ten years 
on the contract. There was a place for me to write an expiration date. I do not 
know the name of the drug company nor am I absolutely sure if I am having 
conversations with apes. I have hearing loss from Radio Shack Kits. I am psyche 
patient that has had many eye injuries and scolding hot water thrown into my 
ear. I do not remember sides. Scripts. Language.

I was told tracking number exists for HIPA (Health Information Privacy 
Agreement) and Motorolla. Motorolla sent me silicon and Ge transistors after I 
spoke with someone when I was in High School. Distributor not corporate. FedEx. 
They could not deliver for their customers including Apple. Nintendo Gun. Duck 
Hunt. Doctor with Ketchup.

Breaking and Entering. A few days later trespassing. Prediction: Vehicular 
Manslaughter.

Evidence: my mother was with me when we bought a card reader when I was 
emancipated. Do ATM/Credit Point of Sale Terminals have cassette heads. Some 
plastic molding and any chance of learning responsibility were gone. HSC 
Specialty. Manager. Out of business in Carmichael, CA.

I know for certain if I had an MRI they would not tell me if I had hearing AIDS 
or implants. I would draw circuit diagrams and have discussions with anyone 
willing to listen. I did build a one chip FM receiver I bought on Amazon at 
Christmas a few years ago.

I am using drugs for social and reproduction.

Sent with [Proton Mail](https://proton.me/) secure email.

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/28/22 15:58, ToddAndMargo via perl6-users wrote:

Hi All,

I am thinking of using

    BEGIN {}

to fire up a splash screen (libnotify).

Question: is what happens between the brackets
isolated from the rest of the code?   If I set
variable values or declare variables, are they
wiped out, etc.?

Many thanks,
-T


Follow up:

Thank you all for the help!

My splash screen pops up whilst the
rest of the program compiles.

Here is my BEGIN code.   If you are
wondering why all the variables when
I could just write it in the run line,
it is becasue the names of the variables
and the comments next to them tell me what
the parameters of notify-send are and
how to use them.  Much easier to maintain.



#!/usr/bin/env perl6

use RunNoShellLib :RunNoShell, :RunNoShellCode, :RunNoShellErr;

BEGIN {
   # Splash Screen

 ( my $ProgramName   = $?FILE ) ~~ s|.*"/"||;
   my Str $NotifyStr = "\nStarting $ProgramName\n";
   my Str $Icon  = "/home/linuxutil/Images/Info.png";
   my Str $Title = "$ProgramName Splash Screen";
   my Str $Timeout   = "8000";  # milliseconds

   RunNoShell( "notify-send -u normal -t \"$Timeout\" -i \"$Icon\" 
\"$Title\" \"$NotifyStr\"" );

}



:-)

Love Raku!

-T


Re: exe?

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/28/22 09:21, ToddAndMargo via perl6-users wrote:

Hi All,

Is there a way to convert a Windows Raku program to
to an executable (.exe) file?

Many thanks,
-T




My target is to create a diaglog box
with GLADE that allow for certain
Windows registry settings to be set
by the users with a GUI.

Having an exe would get me around 1)
installing and maintaining Raku, 2) installing
and maintaining Git (needed for zef to work),
and the delay problems compiling the program
(the .precomp workaround should work as there
would not be a lot of maintencnce)


Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 11:50, Brad Gilbert wrote:
Actually Raku is faster to compile than Perl5. If you consider all of 
the features it comes with.


For example, in Raku everything is an object with meta features. If you 
add Moose or similar to Perl5 then the compile times will often take 
longer than the equivalent Raku times.


That's not the only such feature that you have to add to Perl5 to get 
feature parity.


Then you have to also realize that the Perl5 compiler has had since 1994 
to get faster vs. 2015 for Raku.


I do adore Perl 6 (Raku).  I almost completely
dropped Perl 5 when I got a load of P6's
subroutines.  I program in Top Down and P5's
subs are a nightmare.   I have one P5 program
I support that I have not ported yet.

As a beginner, my programs are rather simple.
If P6 being feature rich is part of the
problem, is there a way to tell P6's compiler
to back off a bit?






Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 10:45, Tom Browder wrote:

On Mon, Aug 29, 2022 at 12:31 PM ToddAndMargo via perl6-users
 wrote:

On 8/29/22 08:41, Tom Browder wrote:

...

And I think you may be surprised how much speedup you may get by using
the precompiled-module "trick" for most of your 11,000-line program.

...

Hi Tom,
The .precomp workaround was never in question!
But there are tines when it is impractical.

...

So lots and lots of compiling that .precomp does not
help me with.

...

More information that you wanted.  Sorry.


No reason to apologize, Todd. I had forgotten how much you were
actually doing with your Raku code--a textbook example for sure!

But I apologize for my impatient replies.  :-)

Blessings,

-Tom


Hi Tom,

You are a force of nature.  I always love
your replies.  I was in no way offended.

:-)

I got long winded because a lot of folks keep
telling me about the .precomp workaround.  I did
not want them to think I was summarily
disregarding their advice (including you).
I wanted to expound on why it is not always
practicle.

-T


Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread Brad Gilbert
Actually Raku is faster to compile than Perl5. If you consider all of the
features it comes with.

For example, in Raku everything is an object with meta features. If you add
Moose or similar to Perl5 then the compile times will often take longer
than the equivalent Raku times.

That's not the only such feature that you have to add to Perl5 to get
feature parity.

Then you have to also realize that the Perl5 compiler has had since 1994 to
get faster vs. 2015 for Raku.

On Mon, Aug 29, 2022, 10:48 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> Dear Larry Wall,
>
> Sorry for writing you directly, but I know you
> sometimes answer questions on this mailing list.
> And those answers are uniquely easy for a beginner
> to understand.
>
> The compile times of Perl5 and Perl6 are dramatically
> different.  Perl 5 is literally 100 times or more
> faster than Perl6.  It is professionally embarrassing
> to turn over a program to customer that takes up to
> 20 seconds to start.
>
> I have reported the issue over on:
>
>https://github.com/perl-foundation-outreach/gsoc-2021-ideas/issues/4
>
>  From the bug report, I compared a program I ported from
> Perl 5 to Perl 6.
>
>$ raku -c --stagestats GetUpdates.pl6
>Stage start : 0.000
>Stage parse : 17.851
>Stage syntaxcheck: Syntax OK
>
>$ time perl -c GetUpdates.pl
>GetUpdates.pl syntax OK
>real 0m0.305s
>user 0m0.243s
>sys 0m0.029s
>
>
> 17.851 versus 0.75 seconds.   Or 238 times slower.
>
> Since you wrote both Perl 5 and Perl 6, is there some
> reason beyond my limited understanding of how these
> things work as to why your Perl 5 is so much faster to
> compile that your Perl 6?
>
> And is wishing for the situation to be corrected
> not a reasonable request?
>
> Also, am I stuck with the .precomp work around, which
> is not helpful when you have to run a lot of
> iterations to debug things such are regex's?
> 17 seconds to see if I goofed a regex is killing me!
>
> Many thanks,
> -T
>
>


Re: BEGIN {} question

2022-08-29 Thread Tom Browder
On Mon, Aug 29, 2022 at 12:31 PM ToddAndMargo via perl6-users
 wrote:
> On 8/29/22 08:41, Tom Browder wrote:
...
> > And I think you may be surprised how much speedup you may get by using
> > the precompiled-module "trick" for most of your 11,000-line program.
...
> Hi Tom,
> The .precomp workaround was never in question!
> But there are tines when it is impractical.
...
> So lots and lots of compiling that .precomp does not
> help me with.
...
> More information that you wanted.  Sorry.

No reason to apologize, Todd. I had forgotten how much you were
actually doing with your Raku code--a textbook example for sure!

But I apologize for my impatient replies.  :-)

Blessings,

-Tom


Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 08:41, Tom Browder wrote:
On Mon, Aug 29, 2022 at 10:29 AM ToddAndMargo via perl6-users 
mailto:perl6-users@perl.org>> wrote:

...
 > Does the compiler make a full pass through
 > the code before firing off the BEGIN routine

NO.

And I think you may be surprised how much speedup you may get by using 
the precompiled-module "trick" for most of your 11,000-line program.


-Tom




Hi Tom,

The .precomp workaround was never in question!

But there are tines when it is impractical.

Most of the programs I have written for customers
run in the background (rakuw) or at night when
no one cares how long they take to start.

Other programs are to remove mistakes from barcode
data when routed to a bar code program.  The
customer inputs data into their Point of Sale
software that freaks out the bar code printing
program, so I correct it on the fly.  It
is a lot easier than going through their entire
database and having the remote `'` for feet and
`"` for inches in a CSV file sent to the
barcode program (comma-separated value).  Not
to mention it is impossible to get the users
to stop making those mistakes

I also have written my own Dynamic DNS (Domain
Name Server) work around for folks that I
have installed RDP (remote Desktop Protocol) on
and that are using floating WAN (Wide Area
Network) addresses.  But it is pretty simple
and starts quick enough.

Now for where .precomp is not practical.  It is
those projects were the saying "the software is
never finished" applies.   Where I am loath to
start/recommend projects that the customer
expects a reasonable response time to start.
So far, I have been lucky.

For those programs that do not require a lot of
maintenance, the .precomp work around is reasonable.

Primarily where the response time drives me INSANE
is my software updates program.   This program goes
out and checks for new updates for programs I support.
If a new one exists, it downloads.  I carry these
programs with me to customer sites on a read only
flash drive so as to not transfer viruses between
customers.  So far it is about 70 programs.

Because Web Developers are always working on their
sites, I am constantly having to figure out
what is wrong.  "The software is never finished".
So .precomp does not help.

What I have done though is to configure the program
such that if I put the sub name of the target program
on the run line, my program will only run that section
rather that waiting 5 minutes to go through them all.
And if my program finds something on the run line it,
it also triggers my extensive debugging.

And it does take a lot of iterations to debug my regex's.
And the wait time (17 seconds) drives me NUTS.
Sometimes, the "source" code on Firefox's development
tools dos not show hidden character in their pages and
that creates a nightmare too.  I spurt the web page
to a file and then see what the heck is wrong.
I am getting pretty good at it though.  "Git" and
"Brave" (Browser) are interesting to download from.

So lots and lots of compiling that .precomp does not
help me with.

More information that your wanted.  Sorry.

-T


Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread Elizabeth Mattijsen
> Since you wrote both Perl 5 and Perl 6, is there some
> reason beyond my limited understanding of how these
> things work as to why your Perl 5 is so much faster to
> compile that your Perl 6?

You clearly understand the situation!

What can I say?


Ah, I know.  *PLONK*


Liz


Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users

Dear Larry Wall,

Sorry for writing you directly, but I know you
sometimes answer questions on this mailing list.
And those answers are uniquely easy for a beginner
to understand.

The compile times of Perl5 and Perl6 are dramatically
different.  Perl 5 is literally 100 times or more
faster than Perl6.  It is professionally embarrassing
to turn over a program to customer that takes up to
20 seconds to start.

I have reported the issue over on:

  https://github.com/perl-foundation-outreach/gsoc-2021-ideas/issues/4

From the bug report, I compared a program I ported from
Perl 5 to Perl 6.

  $ raku -c --stagestats GetUpdates.pl6
  Stage start : 0.000
  Stage parse : 17.851
  Stage syntaxcheck: Syntax OK

  $ time perl -c GetUpdates.pl
  GetUpdates.pl syntax OK
  real 0m0.305s
  user 0m0.243s
  sys 0m0.029s


17.851 versus 0.75 seconds.   Or 238 times slower.

Since you wrote both Perl 5 and Perl 6, is there some
reason beyond my limited understanding of how these
things work as to why your Perl 5 is so much faster to
compile that your Perl 6?

And is wishing for the situation to be corrected
not a reasonable request?

Also, am I stuck with the .precomp work around, which
is not helpful when you have to run a lot of
iterations to debug things such are regex's?
17 seconds to see if I goofed a regex is killing me!

Many thanks,
-T



Re: BEGIN {} question

2022-08-29 Thread Tom Browder
On Mon, Aug 29, 2022 at 10:29 AM ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:
...
> Does the compiler make a full pass through
> the code before firing off the BEGIN routine

NO.

And I think you may be surprised how much speedup you may get by using the
precompiled-module "trick" for most of your 11,000-line program.

-Tom


Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users

On 8/29/22 00:44, Elizabeth Mattijsen wrote:

Question, would BEGIN go at the top or the bottom
of my code?  Seems the compiler would hit it first
at the top, but I do not know if it makes a full
pass of everything before firing off the BEGIN.


BEGIN runs at *compile* time.

This means that anything before the BEGIN statement in the code, is compiled 
and known and can be referenced in the BEGIN block.

Anything *after* the BEGIN statement is still unknown to the compiler and can 
therefore *not* be referenced.


Liz



Hi Liz,

Excellent explanation.  Thank you!

Does the compiler make a full pass through
the code before firing off the BEGIN routine
or does it fire it off as soon as it finds it?

-T


Re: BEGIN {} question

2022-08-29 Thread Elizabeth Mattijsen
> Question, would BEGIN go at the top or the bottom
> of my code?  Seems the compiler would hit it first
> at the top, but I do not know if it makes a full
> pass of everything before firing off the BEGIN.

BEGIN runs at *compile* time.

This means that anything before the BEGIN statement in the code, is compiled 
and known and can be referenced in the BEGIN block.

Anything *after* the BEGIN statement is still unknown to the compiler and can 
therefore *not* be referenced.


Liz