Re: Where do I need to put a pm6 file?

2016-05-02 Thread Tadeusz Sośnierz

On 02/05/16 09:22, Fernando Santagata wrote:


Nope. My fault: I didn't understand that the META* name ought to be 
either META6.json or META.info; I had it named META6.info (unhelpful 
error message, though).


Indeed, it could provide something more informational if you clearly 
give it a local directory that doesn't contain a proper project inside. 
I'll note it down and fix it for the next release, thanks :)


Re: Where do I need to put a pm6 file?

2016-05-01 Thread Tadeusz Sośnierz
Starting from the end: there's no need to use github, panda can install 
stuff just fine from a local directory :)
As for the directory layout, 
https://github.com/rakudo/rakudo/blob/nom/docs/module_management.md is 
probably the best source to learn how it works under the hood.


Hope this helps,

tadzik

On 01/05/16 15:35, Fernando Santagata wrote:


Yes, that works too. But I was just trying to understand how the 
directory layout works.


In particular I was trying to reproduce what panda does, since I 
didn't want to use github.com  just to install a 
test module.

I found no documentation about this, so I tried this mailing list.

On May 1, 2016 15:23, "Brock Wilcox" > wrote:


I recommend putting your module into a 'lib' dir near your script.
Then in your script add:

  use lib 'lib';

That way you don't have to add the -l param.

On May 1, 2016 09:21, "Fernando Santagata"
> wrote:

Hello,

I'm trying to write a module and make a program load and use it.
Since this code:

perl6 -e 'say $*REPO'

outputs:

inst#/home/nando/.perl6

I thought that putting the .pm6 file in there would be enough.
So, since my module is A::B, I put B.pm6 into ~/.perl6/A .
But when I run a test program which loads A::B, I receive this
error:

===SORRY!===
Could not find A::B at line 5 in:
/home/nando/.perl6
/home/nando/.rakudobrew/moar-2016.04/install/share/perl6/site
/home/nando/.rakudobrew/moar-2016.04/install/share/perl6/vendor
/home/nando/.rakudobrew/moar-2016.04/install/share/perl6
CompUnit::Repository::AbsolutePath<140256602878904>
CompUnit::Repository::NQP<140256602876152>
CompUnit::Repository::Perl5<140256602873560>

If I run the test program this way it works:

perl6 -I ~/.perl6 ./test.p6

Why is that? Where should I put the module file to be seen
automatically, without adding the -I option?

As a side note, if I want to precompile the module, as panda
does when installing new modules from the repository, where
should I put the .moarvm file?

Thanks!

-- 
Fernando Santagata






Re: Difficulty Installing Module on Latest Rakudo Star

2016-04-29 Thread Tadeusz Sośnierz
Right; looks like Digest isn't properly installed after all. Try 'panda 
--force install Digest'?


On 29/04/16 23:39, Joe Polanik -X (jpolanik - RESOLVIT RESOURCES LLC at 
Cisco) wrote:

Hmmm, No that gets a similar error.

$ perl6 -MDigest -e1

===SORRY!===

Could not find Digest at line 1 in:

  /Users/jpolanik/.perl6

  /Applications/Rakudo/share/perl6/site

  /Applications/Rakudo/share/perl6/vendor

  /Applications/Rakudo/share/perl6

  CompUnit::Repository::AbsolutePath<4435167512>

  CompUnit::Repository::NQP<4435164760>

  CompUnit::Repository::Perl5<4435162168>


Joe


From: Tadeusz Sośnierz <tadeusz.sosni...@onet.pl 
<mailto:tadeusz.sosni...@onet.pl>>

Date: Friday, April 29, 2016 at 5:28 PM
To: "perl6-users@perl.org <mailto:perl6-users@perl.org>" 
<perl6-users@perl.org <mailto:perl6-users@perl.org>>

Subject: Re: Difficulty Installing Module on Latest Rakudo Star

Alright. You mention Digest itself being installed, so just to be 
sure: 'perl6 -MDigest -e1' works fine?


On 29/04/16 23:21, Joe Polanik -X (jpolanik - RESOLVIT RESOURCES LLC 
at Cisco) wrote:

Tadeusz,

I tried using —force because I initially thought I would be 
reinstalling Bailador.


Eliminating -—force and -—prefix had no effect. Here is the entire 
output.


$ sudo panda install Digest::HMAC

==> Fetching Digest::HMAC

==> Building Digest::HMAC

==> Testing Digest::HMAC

===SORRY!===

Could not find Digest at line 6 in:

/Users/jpolanik/Documents/myPerl6/Bailador/life/.panda-work/1461964706_1/lib

/Users/jpolanik/.perl6

/Applications/Rakudo/share/perl6/site

/Applications/Rakudo/share/perl6/vendor

/Applications/Rakudo/share/perl6

CompUnit::Repository::AbsolutePath<140471828218032>

CompUnit::Repository::NQP<140471823022992>

CompUnit::Repository::Perl5<140471823023032>

t/01-basic.t ..

Dubious, test returned 1 (wstat 256, 0x100)

No subtests run


Test Summary Report

---

t/01-basic.t (Wstat: 256 Tests: 0 Failed: 0)

  Non-zero exit status: 1

  Parse errors: No plan found in TAP output

Files=1, Tests=0,  1 wallclock secs ( 0.02 usr  0.01 sys +  1.60 
cusr  0.10 csys =  1.73 CPU)


Result: FAIL

test stage failed for Digest::HMAC: Tests failed

  in method install at 
/Applications/Rakudo/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A 
(Panda) line 157


  in method resolve at 
/Applications/Rakudo/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A 
(Panda) line 234


  in sub MAIN at 
/Applications/Rakudo/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 
line 18


  in block  at 
/Applications/Rakudo/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 
line 152




Failure Summary



Digest::HMAC(

*test stage failed for Digest::HMAC: Tests failed)


Thanks,

Joe



From: Tadeusz Sośnierz <tadeusz.sosni...@onet.pl 
<mailto:tadeusz.sosni...@onet.pl>>

Date: Friday, April 29, 2016 at 5:10 PM
To: "perl6-users@perl.org" <perl6-users@perl.org 
<mailto:perl6-users@perl.org>>

Subject: Re: Difficulty Installing Module on Latest Rakudo Star

Hey Joe,
Can you post the entire panda output? Also, does the situation change 
when you don't use --prefix, and/or is there a particular reason why 
you use --force?


On 29/04/16 23:02, Joe Polanik -X (jpolanik - RESOLVIT RESOURCES LLC 
at Cisco) wrote:
I'm trying to install Bailador on a Mac running OSX 10.11.4 with the 
Latest Rakudo Star (2016.04). The installation fails on a dependency.


Digest::HMAC can't be installed using

sudo panda --prefix=/Applications/Rakudo/share/perl6/site/bin/ 
--force install Digest::HMAC


The error message says

Could not find Digest at line 6 in:

/Applications/Rakudo/share/perl6/site

/Applications/Rakudo/share/perl6/vendor

/Applications/Rakudo/share/perl6


However, Digest itself is installed. It's visible in the file system 
browser and my .per.6/panda/state file lists it as having been 
successfully installed.


Any advice would be appreciated.

Thanks,

Joe









Re: Difficulty Installing Module on Latest Rakudo Star

2016-04-29 Thread Tadeusz Sośnierz
Alright. You mention Digest itself being installed, so just to be sure: 
'perl6 -MDigest -e1' works fine?


On 29/04/16 23:21, Joe Polanik -X (jpolanik - RESOLVIT RESOURCES LLC at 
Cisco) wrote:

Tadeusz,

I tried using —force because I initially thought I would be 
reinstalling Bailador.


Eliminating -—force and -—prefix had no effect. Here is the entire output.

$ sudo panda install Digest::HMAC

==> Fetching Digest::HMAC

==> Building Digest::HMAC

==> Testing Digest::HMAC

===SORRY!===

Could not find Digest at line 6 in:

/Users/jpolanik/Documents/myPerl6/Bailador/life/.panda-work/1461964706_1/lib

  /Users/jpolanik/.perl6

  /Applications/Rakudo/share/perl6/site

  /Applications/Rakudo/share/perl6/vendor

  /Applications/Rakudo/share/perl6

CompUnit::Repository::AbsolutePath<140471828218032>

  CompUnit::Repository::NQP<140471823022992>

  CompUnit::Repository::Perl5<140471823023032>

t/01-basic.t ..

Dubious, test returned 1 (wstat 256, 0x100)

No subtests run


Test Summary Report

---

t/01-basic.t (Wstat: 256 Tests: 0 Failed: 0)

Non-zero exit status: 1

Parse errors: No plan found in TAP output

Files=1, Tests=0,  1 wallclock secs ( 0.02 usr  0.01 sys +  1.60 cusr  
0.10 csys =  1.73 CPU)


Result: FAIL

test stage failed for Digest::HMAC: Tests failed

in method install at 
/Applications/Rakudo/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A 
(Panda) line 157


in method resolve at 
/Applications/Rakudo/share/perl6/site/sources/582CB7486602954A4601BDCE5A0EAC54B05DA58A 
(Panda) line 234


in sub MAIN at 
/Applications/Rakudo/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 
line 18


in block  at 
/Applications/Rakudo/share/perl6/site/resources/E0D978079BB5081DE986D058BB8AB08252F05CC8 
line 152




Failure Summary



Digest::HMAC(

*test stage failed for Digest::HMAC: Tests failed)


Thanks,

Joe



From: Tadeusz Sośnierz <tadeusz.sosni...@onet.pl 
<mailto:tadeusz.sosni...@onet.pl>>

Date: Friday, April 29, 2016 at 5:10 PM
To: "perl6-users@perl.org <mailto:perl6-users@perl.org>" 
<perl6-users@perl.org <mailto:perl6-users@perl.org>>

Subject: Re: Difficulty Installing Module on Latest Rakudo Star

Hey Joe,
Can you post the entire panda output? Also, does the situation change 
when you don't use --prefix, and/or is there a particular reason why 
you use --force?


On 29/04/16 23:02, Joe Polanik -X (jpolanik - RESOLVIT RESOURCES LLC 
at Cisco) wrote:
I'm trying to install Bailador on a Mac running OSX 10.11.4 with the 
Latest Rakudo Star (2016.04). The installation fails on a dependency.


Digest::HMAC can't be installed using

sudo panda --prefix=/Applications/Rakudo/share/perl6/site/bin/ 
--force install Digest::HMAC


The error message says

Could not find Digest at line 6 in:

/Applications/Rakudo/share/perl6/site

/Applications/Rakudo/share/perl6/vendor

/Applications/Rakudo/share/perl6


However, Digest itself is installed. It's visible in the file system 
browser and my .per.6/panda/state file lists it as having been 
successfully installed.


Any advice would be appreciated.

Thanks,

Joe







Re: Perl 6 pod-handling code seems widely scattered

2016-04-25 Thread Tadeusz Sośnierz

On 25/04/16 14:13, Tom Browder wrote:
I would like to hack on the pod handling code (particularly the HTML 
generation) but it seems to be quite scattered around github.  Is 
> the definitive repo location 
for that chunk?
Yes, that's the module that turns Pod AST into HTML. That's what you're 
looking for :)


Cheers,
tadzik


Adopt a module!

2016-02-02 Thread Tadeusz Sośnierz

My fellow Perl6ers,

Some of you probably recognize my (nick)name, I've been around for quite 
a while. These days, however, as you inevitably noticed if you happened 
to submit a bug or a PR to one of my modules on github, I find myself 
with less and less tuits for Perl 6 stuff; most of what I wrote for it 
was solving problems that I needed solved, and since I don't use much 
Perl 6 these days, I find little incentive to work on stuff I don't 
really use myself. This hardly matters for stuff like Acme::Meow or 
Text::T9, but has been a major pain for a while with core toolchain 
stuff like panda or rakudobrew.


With that in mind, I decided to transfer my modules to people who'll 
take good care of them. The obvious place for these is 
https://github.com/perl6-community-modules, which is where I'll be 
putting them in some foreseeable future. However, if you'd like to 
become the new owner of any of my stuff, please contact me either via 
email, IRC (I'm tadzik, constantly online on freenode) or at 
@tadzik:matrix.org if you're into the new exciting IM stuff. I already 
found a new happy father for JSON::Unmarshal, but I haven't been asking 
around for the rest of the things, so if you'd like some of this 
burden-glory hybrid, please get in touch. Bonus points if you've been 
contributing to any of them before :)


Best regards,
tadzik


Re: panda: Should it have an 'uninstall' option?

2015-04-07 Thread Tadeusz Sośnierz

Oh joy, of course I sent it to Tom only instead of everyone. Classic me.


 Forwarded Message 
Subject: Re: panda: Should it have an 'uninstall' option?
Date: Tue, 07 Apr 2015 13:34:15 +0200
From: Tadeusz Sośnierz tadeusz.sosni...@onet.pl
To: Tom Browder tom.brow...@gmail.com

On 07.04.2015 12:54, Tom Browder wrote:

Wouldn't an uninstall option be a good thing for panda?

I don't know how insulated a Perl 6 package is from the rest of the
installed packages, but I remember on more than one occasion wishing
CPAN and Perl 5 packages had an uninstall option when an installation
somehow got corrupted.

Best regards,

~Tom



It's planned: https://github.com/tadzik/panda/issues/99
Planned for a while though, patiently waiting for someone to take a
closer look at it :) But the way panda stores keeps the state of
installed packages is designed in such a way that it should be able to
automatically clean the unneeded dependencies after it uninstalls a
package. So: panda can't do it yet, but it's been my intention all along
for it to be able to.

boost::regards,
tadzik




Re: Is passing excess parameters while creating object legal?

2014-05-27 Thread Tadeusz Sośnierz

On 05/25/2014 09:50 AM, Kamil Kułaga wrote:

Hi,

My question is about passing parameters to .new method that do not
correspond to any field in class. This example;

use v6;

class PersonalId{
 has Int $.number;
 has Str $.full_name;
}

my Hash $p; #just because i'm scared of pair conversions
$p{number} = 13123123123;
$p{full_name} = John Doe;
$p{age}=64;
$p{shoesize}=44;

say PersonalId.new(|%($p)).perl;
# PersonalId.new(number = 13123123123, full_name = John Doe)

Works perfectly fine but I don't know whether I can rely on that. S12
speaks only about type objects: (It is allowed to pass type objects
that don't correspond to any parent class.)


Hello Kamil,
Why the behaviour above is correct and documented, you may find it 
bug-prone or inconvenient. To address that, I've ported 
MooseX::StrictConstructor to Perl 6[1]. Here's example usage 
demonstrated on a piece of code similar to yours:


use v6;
use ClassX::StrictConstructor;

class PersonalId does ClassX::StrictConstructor {
has Int $.number;
has Str $.full_name;
}

PersonalId.new(number = 7,
   full_name = Edgar Poe,
   yada = 'yada');
# Output:
# The following attributes are not declared for type PersonalId: yada
#  in method new at /yada/yada/StrictConstructor.pm:32
#  in block  at test.pl:9

It may come to your liking :)

Best regards,
Tadeusz Sośnierz


[1] https://github.com/tadzik/ClassX-StrictConstructor


[Announce] Rakudo Star 2014.01

2014-01-31 Thread Tadeusz Sośnierz

# Announce: Rakudo Star Release 2014.01

## A useful, usable, early adopter distribution of Perl 6

On behalf of the Rakudo and Perl 6 development teams, I'm happy to
announce the January 2014 release of Rakudo Star, a useful and usable
distribution of Perl 6. The tarball for the January 2014 release is
available from http://rakudo.org/downloads/star/. A Windows .MSI
version of Rakudo star will usually appear in the downloads area
shortly after the tarball release.

In the Perl 6 world, we make a distinction between the language
(Perl 6) and specific implementations of the language such as
Rakudo Perl. This Star release includes [release 2014.01] of the
[Rakudo Perl 6 compiler], version 5.9.0 of the [Parrot Virtual
Machine], plus various modules, documentation, and other resources
collected from the Perl 6 community.

[release 2014.01]:
https://github.com/rakudo/rakudo/blob/nom/docs/announce/2014.01.md
[Rakudo Perl 6 compiler]: http://github.com/rakudo/rakudo
[Parrot Virtual Machine]: http://parrot.org

Some of the new features added to this release include:

+ The eval sub and method are now spelled EVAL
+ Numeric.narrow to coerce to narrowest type possible
+ Can now supply blocks with multiple arguments as sequence endpoints
+ Method calls and hash/list access on Nil give Nil

This release also contains a range of bug fixes, improvements to error
reporting and better failure modes.

Please note that this release of Rakudo Star does not support the JVM
nor the MoarVM backends from the Rakudo compiler. While the other backends
mostly implement the same features as the Parrot backend, many bits are
still missing, most prominently the native call interface.
We hope to provide a JVM-based and MoarVM-based Rakudo Star releases soon.

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
  * threads and concurrency (in work for the JVM backend)
  * Unicode strings at levels other than codepoints
  * interactive readline that understands Unicode
  * non-blocking I/O
  * much of Synopsis 9 and 11

There is an online resource at http://perl6.org/compilers/features
that lists the known implemented and missing features of Rakudo 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 rakudo...@perl.org.

See http://perl6.org/ for links to much more information about
Perl 6, including documentation, example code, tutorials, reference
materials, specification documents, and other supporting resources. A
draft of a Perl 6 book is available as docs/UsingPerl6-draft.pdf 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
http://rakudo.org/how-to-help, ask on the perl6-compi...@perl.org
mailing list, or join us on IRC #perl6 on freenode.


Re: Production Ready Perl 6?

2011-11-22 Thread Tadeusz Sośnierz
On Tuesday, November 22, 2011 16:59:52 Wendell Hatcher wrote:
 Are there people using Perl 6 in production at this time? Is Perl 6
 production ready?

http://ttjjss.wordpress.com/2011/08/24/what-is-production-ready/
Kind regards,
-- 
Tadeusz Sośnierz


News from the modules' world

2011-04-16 Thread Tadeusz Sośnierz
Hello Perlists and Zebras,

Today was quite a big day for the module ecosystem, and as not everyone
lives on the IRC I feel obliged to announce the changes to the wider
world.

First of all, my fork of the ecosystem repo is now merged into
perl6/ecosystem. What changes does it introduce? If you look closely,
the modules list is now not a list of names and urls, but a list of urls
to some json files. Those, called META.info are now the officia^Wmain,
and modern way of publishing your module to a Perl 6 community. It has
been around for a while now, but mostly as an experimental thing: now it
becomes The Way To Publish Your Modules. Don't hide your excitement!

Of course the http://modules.perl6.org website has been updated to use
the META.list too. If you look closely, you will see that some of the
modules have a nice-looking names now, like Foo::Bar rather than
perl6-Foo-Bar. That's just a side effect of the new infrastructure.

Worried that you haven't touched your project for ages, and it is no
gone forever? No worries: every module which still haven't been updated
to the new spec now lives in a so called SHELTER [1] - every sad module
which doesn't yet have a META.info has been given one: for free! It's
far from perfect, but keeps your module from being forgotten.

Why should you care then? If the Proper Module Name doesn't seem
attractive enough, look at modules.perl6.org again. See the badges? At
the moment of writing this, there are probably three of them. But you
may alredy notice four, or at least four slots. That's right, a new
badge! Everyone who makes his/her module conformant to the new specs [2]
will be awarded with a Cute Panda [3] badge. Panda as in panda, the
module manager [4]. Panda badge means your module is panda-friendly, and
everyone using it to install Perl 6 modules (I don't think there is any
other way at the moment) will be able to fully experience and appreciate
your work. Go for it!

Please look through the new spec [2] and see how do you like it. It's
pretty far from the previous philosophy (whatever you make module
managers will install), but I believe the changes are for the better. If
you disagree, or have some awesome idea, please contribute. Constructive
criticism is very welcome.

TL;DR:
 * There is a new spec for Perl 6 modules [2]
 * Make your module spec-compatibile to achieve fame, glory and
   cheezburgers

Have an appropriate amount of fun!

[1] https://github.com/perl6/ecosystem/tree/master/SHELTER
[2] https://github.com/perl6/ecosystem/blob/master/spec.pod
[3] http://en.wikipedia.org/wiki/File:Panda_Cub_from_Wolong,_Sichuan,_China.JPG
[4] https://github.com/tadzik/Pies

-- 
Tadeusz Sośnierz


Re: Q: Is there a reason why I can't do this?

2010-12-27 Thread Tadeusz Sośnierz
On 27-12-2010 21:46:05, Daniel Carrera wrote:
 Hello,
 
 Looking at the first example in Using Perl6, I have:
 
 if $r1  $r2 {
 %matches{$p1}++;
 } else {
 %matches{$p2}++;
 }
 
 I was thinking that it should be possible to make this more compact, but the
 two ideas I tried didn't work:
 
 # Idea 1 gives: Unable to parse postcircumfix:sym{ }, couldn't find final
 '}'
 %matches{  $r1  $r2 ? $p1 : $p2 }++;
 
 # Idea 2 gives: Unable to parse blockoid, couldn't find final '}'
 $r1  $r2 ? { %matches{$p1}++ } : { %matches{$p2}++ };
 
 
 Is there a way to make something along these lines work?
Yes. In Perl 6 (a ? b : c) became (a ?? b !! c)

Regards,
Ted


New Perl 6 Advent Calendar: call for ideas

2010-11-06 Thread Tadeusz Sośnierz
Hello,
As I accidentally volunteered for managing a list of topics and writers
for this year's Advent Calendar [1], I started to collect some ideas of
things it'd be nice to write about. There's a gist [2] with the list of
things from the top of my head. If you have any ideas, please post them,
bonus points if you could write about it.

Regards,
Ted

[1] http://perl6advent.wordpress.com/
[2] https://gist.github.com/664348


The case of modules

2010-08-06 Thread Tadeusz Sośnierz
Hello,
While writing neutro (a working module installer, while waiting for
proto/pls, see [1]), and wandering around modules listed on
proto.perl6.org, I started wondering about a universal way to handle
installing them. For now, there are a few different approaches:

  - some modules just supply a lib/ (and sometimes t/) directories
  - some supply a makefile
  - some give Configure.pl and Makefile.in

I'm thinking if there's some one, right way [tm] to do stuff, and if
maybe it should be specified. I'm personally for the first approach.
It does not have any external dependencies, and the only needed things
is handling module files and tests. But I started wondering, is this
everything? Besides dependencies (deps.proto seems fine to me) is
anything else actually needed? Could we specify some one, right way, to
prepare modules and to install them?

Kind regards,
Ted


Compiling Perl6 code to bytecode

2010-01-29 Thread Tadeusz Sośnierz
Hello,
I recently got interested in Perl 6, installed Parrot 2.0.0 and Rakudo
2010-01. Running the code works fine:

$ cat hello.pl 
say Hello, world!
$ parrot /usr/lib/parrot/2.0.0/languages/perl6/perl6.pbc hello.pl
Hello, world!

However, compiling the code for later use makes problems:

$ perl6 --target=pir hello.pl  hello.pir
$ parrot /usr/lib/parrot/2.0.0/languages/perl6/perl6.pbc hello.pir
Confused at line 2, near \perl6\\n\n.
in Main (file unknown, line unknown)

I tried to ask for help on #perl6 on freenode, and the following seems
to work with rakudo compiled with --gen-parrot. Is this some known case
of separately used Parrot? Am I doing something wrong?

Kind regards,
Ted