Re: Nested `whenever` (was Re: Help with bug)
On 2021-01-05 David Emanuel da Costa Santiago wrote: > > so the inner ``whenever`` really sets up a separate tap every time > > it's executed. > Is this behaviour expected? It kinda looks weird to me, specially > when looking to the output... Well, it's what *I* expected: a ``whenever`` sets up a tap (or a "then", or a "receive"…), so if you run it multiple times, you get multiple taps. And on a Supply, each tap receives a copy of each emitted value, hence that output. > > (If I change ``$outer`` to a Supplier/Supply pair… the program > > hangs without printing anything, because there's a race between > > the main process and the ``start``ed one, so all the > > ``$outer.emit`` happen > Don't you mean the $outer.send ? ``.send`` is for channels, ``.emit`` is for suppliers > > before the ``react / whenever`` can tap, and ``$done-with-outer`` > > never gets kept. Using ``Supplier::Preserving`` fixes that) > > So IO::Socket::Async::SSL needs to use it, instead of a normal > Supply? No, the problem we saw with the socket were primarily what Liz noticed, that we were deadlocking between ``await $conn.print`` and ``whenever $conn.Supply``. There *might* be a buffering issue somewhere too, but it's harder to trigger, and not related to the use of a Supply, anyway. -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88
Re: Nested `whenever` (was Re: Help with bug)
Às 13:25 de 05/01/21, Gianni Ceccarelli escreveu: > >received outer 0 >received outer 1 >received outer 2 >received outer 3 >received inner 0 for outer 0 >received inner 0 for outer 1 >received inner 0 for outer 2 >received inner 0 for outer 3 >received inner 1 for outer 0 >received inner 1 for outer 1 >received inner 1 for outer 2 >received inner 1 for outer 3 >received inner 2 for outer 0 >received inner 2 for outer 1 >received inner 2 for outer 2 >received inner 2 for outer 3 >received inner 3 for outer 0 >received inner 3 for outer 1 >received inner 3 for outer 2 >received inner 3 for outer 3 > > so the inner ``whenever`` really sets up a separate tap every time > it's executed. Is this behaviour expected? It kinda looks weird to me, specially when looking to the output... > > If I change ``$inner`` to be a Channel, we only get 4 "received inner" > lines, as expected, because values in a channel are received exactly > once. > > (If I change ``$outer`` to a Supplier/Supply pair… the program hangs > without printing anything, because there's a race between the main > process and the ``start``ed one, so all the ``$outer.emit`` happen Don't you mean the $outer.send ? > before the ``react / whenever`` can tap, and ``$done-with-outer`` > never gets kept. Using ``Supplier::Preserving`` fixes that) > So IO::Socket::Async::SSL needs to use it, instead of a normal Supply? Regards, David Santiago
Re: LTA documentation page
Can you try 'mkdir' manually beforehand to create the desired '/usr/share/perl6/site/doc' directory, then run 'zef install p6doc' ? Just wondering... . I note your other comments with great interest. Best, Bill. On Tue, Jan 5, 2021 at 9:02 AM Gianni Ceccarelli wrote: > On 2021-01-05 William Michels via perl6-users > wrote: > > Raiph's suggestion works for me (on rakudo-2020.10). I mean, p6doc > > installs > > Oh, that points to new, different, problems. > > https://modules.raku.org/search/?q=p6doc links to > https://github.com/Raku/doc which does not contain a ``p6doc`` script, > which means that what I get with ``zef install p6doc`` is not the same > thing (this is a general problem with pointing at repositories instead > of distribution artifacts, it's not specific to p6doc) > > Then, ``zef install p6doc`` fails here, because:: > > Failed to create directory '/usr/share/perl6/site/doc' with mode > '0o777': Failed to mkdir: Permission denied > > AIUI, distributions should install to the CompUnit::Repository in my > home directory, not into the system-wide one. > > -- > Dakkar - > GPG public key fingerprint = A071 E618 DD2C 5901 9574 > 6FE2 40EA 9883 7519 3F88 > key id = 0x75193F88 > >
Re: LTA documentation page
Yep, there are a couple of (known) issues here: https://github.com/Raku/problem-solving/issues/252 which request to remove it from the ecosystem (and I'll probably do it when I finish this email), and this one https://github.com/Raku/doc/issues/2896 Build.pm does not really work now, to it should probably be removed. And if it is, there's actually nothing to "install" so it should be removed. Maybe we should work first on releasing rakudoc. Let me see if we can do that soon-ish or it requires a lot of work. And in any case we will probably encourage people to use the online version of the documentation (or to build it themselves via Documentable) Thanks anyways for the checks, cheers El mar, 5 ene 2021 a las 18:02, Gianni Ceccarelli () escribió: > On 2021-01-05 William Michels via perl6-users > wrote: > > Raiph's suggestion works for me (on rakudo-2020.10). I mean, p6doc > > installs > > Oh, that points to new, different, problems. > > https://modules.raku.org/search/?q=p6doc links to > https://github.com/Raku/doc which does not contain a ``p6doc`` script, > which means that what I get with ``zef install p6doc`` is not the same > thing (this is a general problem with pointing at repositories instead > of distribution artifacts, it's not specific to p6doc) > > Then, ``zef install p6doc`` fails here, because:: > > Failed to create directory '/usr/share/perl6/site/doc' with mode > '0o777': Failed to mkdir: Permission denied > > AIUI, distributions should install to the CompUnit::Repository in my > home directory, not into the system-wide one. > > -- > Dakkar - > GPG public key fingerprint = A071 E618 DD2C 5901 9574 > 6FE2 40EA 9883 7519 3F88 > key id = 0x75193F88 > > -- JJ
Re: LTA documentation page
On 2021-01-05 William Michels via perl6-users wrote: > Raiph's suggestion works for me (on rakudo-2020.10). I mean, p6doc > installs Oh, that points to new, different, problems. https://modules.raku.org/search/?q=p6doc links to https://github.com/Raku/doc which does not contain a ``p6doc`` script, which means that what I get with ``zef install p6doc`` is not the same thing (this is a general problem with pointing at repositories instead of distribution artifacts, it's not specific to p6doc) Then, ``zef install p6doc`` fails here, because:: Failed to create directory '/usr/share/perl6/site/doc' with mode '0o777': Failed to mkdir: Permission denied AIUI, distributions should install to the CompUnit::Repository in my home directory, not into the system-wide one. -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88
Re: surprise with start
They are tested for compilation, not that they generate the desired results (though this is a wishlist item in the docs backlog) On Tue, Jan 5, 2021 at 9:59 AM Ralph Mellor wrote: > > Sounds to me like it's time to raise a doc issue. > > Also, does anyone know if doc examples are tested? > > Not just when first published, but as part of blinning? > > On Tue, Jan 5, 2021 at 1:30 PM Theo van den Heuvel > wrote: > > > > Hi gurus, > > > > The first example in the documentation on the start control flow does > > not seem to work as promised. > > Here is the code: > > > > start { sleep 1; say "done" } > > say "working"; > > # working, done > > > > Both 2020.1 and the 2020.12 version under Ubuntu yield only "working". > > Am I missing something? > > > > -- > > Theo van den Heuvel
Re: LTA documentation page
On Tue, Jan 5, 2021 at 5:10 AM Ralph Mellor wrote: > > I googled rakudoc and that led to: > > https://github.com/Raku/rakudoc > > which says it's forked from: > > https://github.com/noisegul/perl6-p6doc > > So I tried that in m.r.o and it's listed: > > https://modules.raku.org/search/?q=p6doc > > So, perhaps you can zef install p6doc? > > Maybe the doc you read mentioning rakudoc > is ahead of the situation in rakudo versions, or > at least yours, as well as being ahead of the > ecosystem? > > love, raiph Raiph's suggestion works for me (on rakudo-2020.10). I mean, p6doc installs: Last login: Tue Jan 5 08:23:11 on ttys023 user@mbook:~$ ~/rakudo/rakudo-2020.10/zef/bin/zef install p6doc ===> Searching for: p6doc ===> Updating cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json ===> Updating p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json ===> Updated p6c mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json ===> Updated cpan mirror: https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json ===> Searching for missing dependencies: Pod::To::BigPage:ver<0.5.1+> ===> Searching for missing dependencies: HTTP::UserAgent, Test::When ===> Building: p6doc:ver<1.002001> ===> Building [OK] for p6doc:ver<1.002001> ===> Testing: HTTP::UserAgent:ver<1.1.51>:auth [HTTP::UserAgent] # NETWORK_TESTING was not set [HTTP::UserAgent] # NETWORK_TESTING was not set [HTTP::UserAgent] # NETWORK_TESTING was not set [HTTP::UserAgent] # NETWORK_TESTING was not set [HTTP::UserAgent] # NETWORK_TESTING was not set [HTTP::UserAgent] # NETWORK_TESTING was not set ===> Testing [OK] for HTTP::UserAgent:ver<1.1.51>:auth ===> Testing: Test::When:ver<1.001008> ===> Testing [OK] for Test::When:ver<1.001008> ===> Testing: Pod::To::BigPage:ver<0.5.2>:auth ===> Testing [OK] for Pod::To::BigPage:ver<0.5.2>:auth ===> Testing: p6doc:ver<1.002001> ===> Testing [OK] for p6doc:ver<1.002001> ===> Installing: HTTP::UserAgent:ver<1.1.51>:auth ===> Installing: Test::When:ver<1.001008> ===> Installing: Pod::To::BigPage:ver<0.5.2>:auth ===> Installing: p6doc:ver<1.002001> 2 bin/ scripts [pod2onepage p6doc] installed to: /Users/me/rakudo/rakudo-2020.10/install/share/perl6/site/bin user@mbook:~$ HTH, Bill.
Re: LTA documentation page
And here it comes again, the common mess about Raku and Rakudo. :) The point is that Rakudo doesn't come bundled with documentation about Raku because the former just implements the latter. It's not like it is with perl where `perl` binary and `Perl` are the same and `perl -v` is your current version of Perl. From this point of view, one would have to know the difference between 6.d and 6.l version of Raku because these differences might be overwhelming. Even now it'd be good to know about the differences in role behavior between 6.c/6.d and 6.e. Contrary, one is better not care about the differences between Rakudo 2019.10 and 2020.12 for as long as they both implement same Raku versions. Apparently, I'm not talking about bug compatibility here. So, for as long as one's code always starts with `use v6.d` they really may not be worried about any upcoming Raku language version up until their compiler starts deprecation cycle for 6.d. The task of the online documentation is to allow one to find out what version of Raku introduced a requested feature. We'll most certainly need a section related to versioning and have it pinned at some easy to spot location. And it will be there when our resources allow which must be read as: when somebody find time to do it. Any help is welcome! :) Best regards, Vadim Belman > On Jan 5, 2021, at 9:48 AM, Gianni Ceccarelli wrote: > > On 2021-01-05 Brad Gilbert wrote: >> There really shouldn't be that much difference between what the >> documentation says and how your version works. > > I've worked on machines stuck with perl 5.8 when the online > documentation was for 5.26 > > I'd like to live in a world where: > > * raku is popular and widespread enough that you find old versions it > on old machines > * I won't have to struggle to remember the differences between 6.d and > 6.l > > For now, yes, the online docs are "good enough" (when I have network > connectivity, at least!) > >> Even if rakudoc did install, it would just copy the most recent docs >> as of the time you installed it. > > rakudoc != p6doc > > rakudoc looks at the POD6 in installed distributions / modules > > -- > Dakkar - > GPG public key fingerprint = A071 E618 DD2C 5901 9574 >6FE2 40EA 9883 7519 3F88 > key id = 0x75193F88 >
Re: surprise with start
Sounds to me like it's time to raise a doc issue. Also, does anyone know if doc examples are tested? Not just when first published, but as part of blinning? On Tue, Jan 5, 2021 at 1:30 PM Theo van den Heuvel wrote: > > Hi gurus, > > The first example in the documentation on the start control flow does > not seem to work as promised. > Here is the code: > > start { sleep 1; say "done" } > say "working"; > # working, done > > Both 2020.1 and the 2020.12 version under Ubuntu yield only "working". > Am I missing something? > > -- > Theo van den Heuvel
Re: LTA documentation page
On 2021-01-05 Brad Gilbert wrote: > There really shouldn't be that much difference between what the > documentation says and how your version works. I've worked on machines stuck with perl 5.8 when the online documentation was for 5.26 I'd like to live in a world where: * raku is popular and widespread enough that you find old versions it on old machines * I won't have to struggle to remember the differences between 6.d and 6.l For now, yes, the online docs are "good enough" (when I have network connectivity, at least!) > Even if rakudoc did install, it would just copy the most recent docs > as of the time you installed it. rakudoc != p6doc rakudoc looks at the POD6 in installed distributions / modules -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88
Re: LTA documentation page
There really shouldn't be that much difference between what the documentation says and how your version works. The biggest thing would be new functions that you don't have yet. (Which you could just copy the code from the sources into your program if you need them.) Even if rakudoc did install, it would just copy the most recent docs as of the time you installed it. It's not like the Perl docs which are in the same repository as the code. The Raku docs aren't even controlled by the same organization on GitHub, let alone being in the same repository. (There are different requirements to being in the different projects.) On Tue, Jan 5, 2021 at 7:31 AM Gianni Ceccarelli wrote: > On 2021-01-05 JJ Merelo wrote: > > Gianni is basically right. rakudoc has not really been released yet > > into the ecosystem, and p6doc will get you the documentation itself, > > which you will have to build then. So LTA is true, and there's some > > work to be done. There's probably an issue already created, but it > > will pop up if you create another one, so please do raise the issue > > and focus it on the documentation part if it does not. > > https://github.com/Raku/doc/issues/3769 > > > We really encourage people to peruse the documentation online, though. > > https://docs.raku.org > > Why? The online documentation will not, in the general case, match the > rakudo version I have installed. > > -- > Dakkar - > GPG public key fingerprint = A071 E618 DD2C 5901 9574 > 6FE2 40EA 9883 7519 3F88 > key id = 0x75193F88 > >
Re: surprise with start
What is happening is that the `start` happens on another thread. That thread is not the main thread. The program exits when the main thread is done. Since the main thread doesn't have anything else to do it exits before that `sleep` is done. The more correct way to handle it would be to wait for the `start` to finish. my $p = start { sleep 1; say "done" } say "working"; await $p; On Tue, Jan 5, 2021 at 7:41 AM Theo van den Heuvel wrote: > thanks. That helps. > > Elizabeth Mattijsen schreef op 2021-01-05 14:37: > > If those are the only lines in your program, the program will have > > exited before the sleep in the start has actually passed. If you > > change the program to: > > > > start { sleep 1; say "done"; exit } > > say "working"; > > sleep; > > > > you should also see the "done". > > > >> On 5 Jan 2021, at 14:15, Theo van den Heuvel > >> wrote: > >> > >> Hi gurus, > >> > >> The first example in the documentation on the start control flow does > >> not seem to work as promised. > >> Here is the code: > >> > >> start { sleep 1; say "done" } > >> say "working"; > >> # working, done > >> > >> Both 2020.1 and the 2020.12 version under Ubuntu yield only "working". > >> Am I missing something? > >> > >> -- > >> Theo van den Heuvel > > -- > Theo van den Heuvel > Van den Heuvel HLT Consultancy >
Re: surprise with start
thanks. That helps. Elizabeth Mattijsen schreef op 2021-01-05 14:37: If those are the only lines in your program, the program will have exited before the sleep in the start has actually passed. If you change the program to: start { sleep 1; say "done"; exit } say "working"; sleep; you should also see the "done". On 5 Jan 2021, at 14:15, Theo van den Heuvel wrote: Hi gurus, The first example in the documentation on the start control flow does not seem to work as promised. Here is the code: start { sleep 1; say "done" } say "working"; # working, done Both 2020.1 and the 2020.12 version under Ubuntu yield only "working". Am I missing something? -- Theo van den Heuvel -- Theo van den Heuvel Van den Heuvel HLT Consultancy
Re: surprise with start
If those are the only lines in your program, the program will have exited before the sleep in the start has actually passed. If you change the program to: start { sleep 1; say "done"; exit } say "working"; sleep; you should also see the "done". > On 5 Jan 2021, at 14:15, Theo van den Heuvel wrote: > > Hi gurus, > > The first example in the documentation on the start control flow does not > seem to work as promised. > Here is the code: > > start { sleep 1; say "done" } > say "working"; > # working, done > > Both 2020.1 and the 2020.12 version under Ubuntu yield only "working". Am I > missing something? > > -- > Theo van den Heuvel
Re: LTA documentation page
On 2021-01-05 JJ Merelo wrote: > Gianni is basically right. rakudoc has not really been released yet > into the ecosystem, and p6doc will get you the documentation itself, > which you will have to build then. So LTA is true, and there's some > work to be done. There's probably an issue already created, but it > will pop up if you create another one, so please do raise the issue > and focus it on the documentation part if it does not. https://github.com/Raku/doc/issues/3769 > We really encourage people to peruse the documentation online, though. > https://docs.raku.org Why? The online documentation will not, in the general case, match the rakudo version I have installed. -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88
surprise with start
Hi gurus, The first example in the documentation on the start control flow does not seem to work as promised. Here is the code: start { sleep 1; say "done" } say "working"; # working, done Both 2020.1 and the 2020.12 version under Ubuntu yield only "working". Am I missing something? -- Theo van den Heuvel
Re: LTA documentation page
Gianni is basically right. rakudoc has not really been released yet into the ecosystem, and p6doc will get you the documentation itself, which you will have to build then. So LTA is true, and there's some work to be done. There's probably an issue already created, but it will pop up if you create another one, so please do raise the issue and focus it on the documentation part if it does not. We really encourage people to peruse the documentation online, though. https://docs.raku.org. If what you want is to check out the documentation of installed modules... Well, as said above, work needs to be done. El mar, 5 ene 2021 a las 14:10, Ralph Mellor () escribió: > I googled rakudoc and that led to: > > https://github.com/Raku/rakudoc > > which says it's forked from: > > https://github.com/noisegul/perl6-p6doc > > So I tried that in m.r.o and it's listed: > > https://modules.raku.org/search/?q=p6doc > > So, perhaps you can zef install p6doc? > > Maybe the doc you read mentioning rakudoc > is ahead of the situation in rakudo versions, or > at least yours, as well as being ahead of the > ecosystem? > > love, raiph > -- JJ
Re: LTA documentation page
I googled rakudoc and that led to: https://github.com/Raku/rakudoc which says it's forked from: https://github.com/noisegul/perl6-p6doc So I tried that in m.r.o and it's listed: https://modules.raku.org/search/?q=p6doc So, perhaps you can zef install p6doc? Maybe the doc you read mentioning rakudoc is ahead of the situation in rakudo versions, or at least yours, as well as being ahead of the ecosystem? love, raiph
Nested `whenever` (was Re: Help with bug)
On 2020-12-30 Gianni Ceccarelli wrote: > Also, my understanding of ``whenever`` is that it's adding a hook into > the event loop, and only leaving the surrounding ``react`` (or > ``supply``) will remove that hook (people who understand this better > than I do: please correct me!). If that's true, adding a hook many > times on the same condition looks wrong to me… My understanding seems to be mostly correct:: use v6.d; my Channel $outer .=new; my Supplier $inner .=new; my $inner-s = $inner.Supply; my Promise $done-with-outer .=new; my $receiver = start { react { whenever $outer -> $outer-value { say "received outer $outer-value"; whenever $inner-s -> $inner-value { say "received inner $inner-value for outer $outer-value"; done if $inner-value >= 3 && $outer-value >= 3; } $done-with-outer.keep() if $outer-value >= 3; } } } $outer.send($_) for ^4; await $done-with-outer; $inner.emit($_) for ^4; await $receiver; prints:: received outer 0 received outer 1 received outer 2 received outer 3 received inner 0 for outer 0 received inner 0 for outer 1 received inner 0 for outer 2 received inner 0 for outer 3 received inner 1 for outer 0 received inner 1 for outer 1 received inner 1 for outer 2 received inner 1 for outer 3 received inner 2 for outer 0 received inner 2 for outer 1 received inner 2 for outer 2 received inner 2 for outer 3 received inner 3 for outer 0 received inner 3 for outer 1 received inner 3 for outer 2 received inner 3 for outer 3 so the inner ``whenever`` really sets up a separate tap every time it's executed. If I change ``$inner`` to be a Channel, we only get 4 "received inner" lines, as expected, because values in a channel are received exactly once. (If I change ``$outer`` to a Supplier/Supply pair… the program hangs without printing anything, because there's a race between the main process and the ``start``ed one, so all the ``$outer.emit`` happen before the ``react / whenever`` can tap, and ``$done-with-outer`` never gets kept. Using ``Supplier::Preserving`` fixes that) -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88
LTA documentation page
https://docs.raku.org/programs/02-reading-docs says to use ``rakudoc`` to read the documentation of installed modules. I don't have it installed:: $ rakudoc -bash: rakudoc: command not found Not a problem, that same page says to use zef:: $ $ zef install rakudoc ===> Searching for: rakudoc No candidates found matching identity: rakudoc Ok, this is not great. https://modules.raku.org/search/?q=rakudoc also doesn't know anything about that distribution. What happened? -- Dakkar - GPG public key fingerprint = A071 E618 DD2C 5901 9574 6FE2 40EA 9883 7519 3F88 key id = 0x75193F88