Tip: if you are chasing ghosts...

2020-04-01 Thread ToddAndMargo via perl6-users

all around the Windows version of Raku and are about
to pull all your hair out and have run out of
swear words (not an admission that I cuss), add

   --optimize=0

to your run string:

   raku --optimize=0 FileAttributes.pl6


Re: Tip: if you are chasing ghosts...

2020-04-01 Thread Tessa Plum

On 2020/4/1 4:09 下午, ToddAndMargo via perl6-users wrote:

    raku --optimize=0 FileAttributes.pl6


I never used this argument. what does it bring to us?

Thanks.


Re: Tip: if you are chasing ghosts...

2020-04-01 Thread ToddAndMargo via perl6-users

On 2020-04-01 04:37, Tessa Plum wrote:

On 2020/4/1 4:09 下午, ToddAndMargo via perl6-users wrote:

    raku --optimize=0 FileAttributes.pl6


I never used this argument. what does it bring to us?

Thanks.


Hi Tessa,

I am not exactly sure what it does.  "Optimize"
typically works at the lower level parts of
the resulting code, usually the assembly
code level.  It is looking for faster ways of
doing what you want.  For exactly what is going
on here, one of the developers would need to
chime in.

And, it does do wonders.  But, since it does not
know your reason for asking for what you are asking,
sometimes it comes up with 2+2=3, but faster.

So, If what you are asking just does not seems to
be what you are getting and it does not match
your one line modules. Try turning off the optimizer.

Back "in the day" when I programmed exclusively in
Module 2, I had to disable the optimizer on a
permanent basis.  I got a lot of 2+2=5's if
I did not.

With the project I am working on now, setting the
optimizer to zero helped "somewhat".  There were
other problems as well.

One of the more obvious problems it did help with
was "sleep 10". Because my code takes over 10
seconds to compile, it included the compile time
as part of the wait.  So the first sleep 10 got
blasted past, but the rest of my sleep/s got
honored, so long as there was other code between
them.

Oh and
   sleep 1; sleep 10
got optimized into one single
   sleep 0

So, if you are chasing ghosts, try turning off
the optimizer.

-T


Re: Tip: if you are chasing ghosts...

2020-04-01 Thread ToddAndMargo via perl6-users

On 2020-04-01 17:24, ToddAndMargo via perl6-users wrote:

It is looking for faster ways of
doing what you want.


An example would be

   jump 2
   jump 4
   jump 6

optimized into

   jump 12


Re: Tip: if you are chasing ghosts...

2020-04-01 Thread ToddAndMargo via perl6-users
On Wed, Apr 1, 2020 at 4:09 AM ToddAndMargo via perl6-users 
mailto:perl6-us...@perl.org>> wrote:


all around the Windows version of Raku and are about
to pull all your hair out and have run out of
swear words (not an admission that I cuss), add

 --optimize=0

to your run string:

 raku --optimize=0 FileAttributes.pl6



On 2020-04-01 05:30, yary wrote:
Sounds like a bug report is in order- with the FileAttributes.pl6, and 
how it behaves differently with / without --optimize=0


-y


Hi Yary,

FileAttributes.pl6 is a Windows utility I wrote to
show the attributes or files and/or directories.
"Encrypted" directories show up like a soar thumb.

Being the masochist I am, I put a "--SetReg" switch
in it to automatically set up the Registry to
allow FileAttributes to use Windows Explorer's
(not IE) context menu.  I have a WinReg.pm6 modules
that does several registry functions.

FileAttribures makes six calls to

nf-winreg-regopenkeyexw
nf-winreg-regcreatekeyexw
nf-winreg-regflushkey
nf-winreg-regclosekey

Three calls to
nf-winreg-regsetvalueexw

Flushing helped, but did not cure the issue.

And, joy of joy's, writing to the registry works,
but only the first time.  After that, if you want
to change value, it will process partially and
randomly exit the program at random points without
an error message. If you manually erase all
the registry entries, it will proceed to finish
again.

Changing the optimizer setting helped "somewhat".
The program would still exit at random places
without an error, but would get further into
the program before doing such.

Now is this a Windows issue?  Most probably.
Windows is an awful operating system.  It
is what it is and as long as 95% of my customer
are using it, I have to support it, regardless
of how much I adobe Fedora.  Windows put a lot
of food on my table.

Is it a Raku problem?  Probably only a little.
Raku is still pretty young and still takes
over 10 seconds to compile large programs.
And I adore Raku so much, going elsewhere is
not going to happen.

Is it a NativeCall problem?  Most certainly.
The dying always occurs in one of its calls.

Now how to report this bug?  It does not reproduce
with simple one liners.  I would require the
developers to sift though literally hundreds of
lines of code over multiple modules.  I don't
see that happening.

I have been chasing ghosts.

-T


$FileName.IO.e.Bool and hidden files

2020-04-01 Thread ToddAndMargo via perl6-users

Hi All,

In Windows, is there a way to get

   $FileName.IO.e.Bool

to show hidden files?

attrib  C:\pagefile.sys
A  SH  C:\pagefile.sys

raku -e "say 'c:\\pagefile.sys'.IO.e.Bool;"
False

raku -e "say 'c:\pagefile.sys'.IO.e.Bool;"
False

Many thanks,
-T