Re: Perl6 -> Raku? whats the scope?

2019-10-16 Thread Kaare Rasmussen

Den 15-10-2019 kl. 17:49 skrev Andrew Shitov:

To my opinion, should be done before this year's Christmas. At least 
everything that can be done by the "Perl 6 team"



But after lunch.

/kaare


Re: Startup performance on OS X

2016-10-03 Thread Kaare Rasmussen

On 2016-10-03 12:14, Elizabeth Mattijsen wrote:
Wrt to Pm’s timing of perl 5 with Moose: if you actually want to have 
most of Perl 6’s capabilities in Perl 5 with Moose, you will need to 
load quite a few MooseX:: classes as well. Which cannot have a 
positive effect on load time. 



Right. But that's not too impressive, as one of the major criticisms of 
Moose is exactly the startup overhead it introduces. Mainly explained 
with the compile time of large modules. With Perl 6's compile 
development, I hope we'll end up in a completely other ballpark, eventually.


/kaare



Re: Observations from a C++/Python developer that never used Perl5

2016-09-07 Thread Kaare Rasmussen

Hi Joseph

Welcome, and I hope you'll stick around.

Now, I haven't had the time to dig into Perl 6 myself, only to poke at 
it from time to time. But, while waiting for people who know something 
to respond, I'll ask you to be a little concise in certain areas.
* I can find no concise easy-to-understand explanation for how to 
define what other languages would call constructors. Instead there is 
a mess of bless, magic inside Mu, new, BUILD, BUILDALL... It's not 
clear when you should prefer to override BUILD or new or both. I also 
assume there are some benefits to teasing apart object construction 
this way, but right now I don't know what they are. This is also an 
area where I think there are older blog posts confusing the situation 
because they discuss semantics from an older version of Perl6.


I wonder what you miss from https://docs.perl6.org/language/classtut. To 
me, it explains the hows and whys very thoroughly. Now, I now people 
have been hard at work improving the documentation, so if you can point 
to what's missing or unclear, I'm sure it will help a lot.


* It would be nice for people coming from Python for a tutorial that 
explained the basic module importing, the scope of things imported, 
and how name collisions are avoided when importing from two modules 
that have the same sub. The official documentation is trying to 
distinguish a bunch of subtle and presumably useful for advanced users 
distinctions that are completely lost on a newcomer. I just want to 
know what is the equivalent of import, from foo import bar, and import 
foo as bar.


It sounds like "arh, do it yourself", but I'd like to say that, coming 
from a Python background, you'd be the perfect person to do just that. 
At least take notes and post them, so it can go into a tutorial of some 
kind.


* Coming from almost any other language the => operator is dark magic 
because of its implicit quoting of the left hand side. Likewise the 
implicit quoting done by . Some explanation of why this is done, 
and how you could write a sub or operator that does the same thing 
would probably go a long way towards making it less confusing.


The pair operator is explained here 
https://docs.perl6.org/language/operators#index-entry-pair_constructor 
and word quoting here 
https://docs.perl6.org/language/quoting#Word_quoting:_qw - perhaps 
they're more Perl 5-like, but both are very handy features. Perhaps you 
can expand a little as to what you'd like explained. Coming from Perl 5, 
I'm certainly damaged in that respect.


* I haven't been able to find any guidance on when I should be using a 
role and when I should be using a class. The former seem to give you 
better error messages when you forget to define a method from a base 
role... So never use classes? I suspect it's more complicated than that.


I guess this is something everybody can have an opinion about. There are 
a number of reasons to go one or the other way. Isn't it a topic for all 
modern languages?


* Types feel like second-class citizens. Without knowing the details 
of the implementation it feels like the errors that Perl can 
statically detect is chosen at random. It's generally useful


I think your wording is misleading. The things that Perl 6 can detect 
when compiling shouldn't be a matter of choice, but of what's possible. 
Perhaps you can give some examples, I'm sure there are perfectly good 
reasons for the way things are. If not, it may be a bug, and the 
compiler can be improved.


argument constructors, are all pretty sweet as well. Macros look 
pretty promising although again I had trouble finding good tutorials.


As I recall it, macros where left out of the initial implementation. So 
you have to wait for another Christmas Present :-)


/kaare



Re: Graphical Toolkits

2016-08-26 Thread Kaare Rasmussen

On 2016-08-26 03:14, Timo Paulssen wrote:
with Inline::Python you can use at least one of the Qt bindings python 


The Inline::* options are mostly interesting when porting or binding to 
existing applications, IMHO. But it's a valid point. Doesn't Perl 5 have 
some implementations as well?



The KDE project has something called "SMOKE" that has almost zero
documentation, but it'd allow us to build a full binding for Qt with
relatively low effort - once someone has SMOKE figured out.


Yeah, I saw that too. It seems rather easy, as a way of doing this, but 
binding to a full toolkit is of course a massive task.

Other than that, we have a native Electron binding, which is the thing
that powers the Atom Editor if i'm not mistaken.

Didn't know about this one.


Hope that helps!


Certainly did, thanks.

/kaare


Graphical Toolkits

2016-08-25 Thread Kaare Rasmussen

Hi

ISTM that right now the only option if you want to develop a graphical 
desktop application is GTK. At least it seems to be the only one on the 
modules list. You may very well correct me if I'm wrong.


I'm thinking if anybody has any knowledge of other projects, perhaps 
Qt5, Wx, or any other on or off this list: 
https://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits .


Note: I'm not saying that GTK is bad, or there's anything wrong with it. 
Just looking for alternatives, with a not-too-short horizon.


/kaare



Re: Perl 6 adoption

2016-06-29 Thread Kaare Rasmussen

On 2016-06-29 12:26, webmind wrote:

On 28/06/16 05:26, Kaare Rasmussen wrote:


In that vein, I'm surprised how easy it is to bind to C libraries. This
could very well be a killer feature for Perl 6 compared to other high
level languages. The resource usage has to come down to a reasonable
level for that to be interesting, though.

Can you perhaps recommend a tutorial or something on how this works?



I don't really know of any tutorial. I just wanted to implement 
listen/notify support for PostgreSQL in DBIish 
(https://github.com/perl6/DBIish), so I looked at PostgreSQL's excellent 
documentation and at the existing native bindings in DBIish.


I think this https://docs.perl6.org/language/nativecall has been updated 
since, so perhaps it's a good place to start. Otherwise take a look at 
the modules list, there are plenty of modules linking to native 
libraries, incl gtk, misc compression and sound libraries, etc.


There's even a module to generate a stub class to start with, 
https://github.com/Skarsnik/gptrixie


I think that for more advanced interfaces, these helpers might come in 
handy:


https://github.com/jonathanstowe/NativeHelpers-Array
https://github.com/salortiz/NativeHelpers-Blob

But things may have changed or may change in the future, I haven't 
looked at it for several months now. Which is equivalent to years in 
normal Internet life :-)



/kaare


poll (3) (WAS select (3))

2016-04-30 Thread Kaare Rasmussen

Den 30-04-2016 kl. 19:14 skrev Kaare Rasmussen:


select(3) is an abysmal API. There's a reason most OSes replaced 
select(2) with a backward compatibility select(3) and moved on to 
something poll-like (look for poll(2) or epoll(2)).




Well, it's not that I fare better with poll. This segfaults on the line 
containing 'note $a.perl;'


I'll put it away for now. Time's up.

/kaare

#!/usr/bin/env perl6

use NativeCall;

class Pollfd is repr('CStruct') {
has int32 $.fd;
has int16 $.events;
has int16 $.revents;
}

constant POLLIN= 0x001;
constant POLLPRI= 0x002;
constant POLLOUT= 0x004;

constant POLLRDNORM= 0x040;
constant POLLRDBAND= 0x080;
constant POLLWRNORM= 0x100;
constant POLLWRBAND= 0x200;

constant POLLMSG= 0x400;
constant POLLREMOVE= 0x1000;
constant POLLRDHUP= 0x2000;

constant POLLERR= 0x008;
constant POLLHUP= 0x010;
constant POLLNVAL= 0x020;

sub poll(CArray[Pollfd], uint64, uint32) returns int32 is native { * }

my $timeout = 5000;
my @readfd := CArray[Pollfd].new(
Pollfd.new(fd => 1, events => POLLIN, revents => 0),
);

note @readfd.WHERE;
note poll(@readfd, @readfd.elems, $timeout);
note @readfd.WHERE;
note 'xx';
my $a = @readfd[0];
note 'xy';
note $a.WHAT;
note $a.perl;




Re: select (3)

2016-04-30 Thread Kaare Rasmussen

Den 30-04-2016 kl. 10:35 skrev Kaare Rasmussen:


Variations over [2] give inconclusive results, so I know I'm doing 
something (probably very basic) wrong. But what?


The current incancation tries to dup the STDIN fd to 14, which should 
be the second last bit in the 2nd uint8. But I've tried to mask in 
many other ways, with no better result.


Anyone who can spot the obvious?



I should probably tell that both dup, dup2 and select apparently work as 
far as they call their respective system calls. Using dup and dup2, I 
see a new fd in the list, and select waits for the given amount of 
seconds and returns 0, or returns sooner and returns 1. The result just 
isn't corresponding to the bit values I use when calling, and I can't 
seem to find a pattern.


/kaare


Re: Google Summer of Code and Google Code In

2016-02-21 Thread Kaare Rasmussen

On 2016-02-20 10:54, Vytautas D wrote:


Its a real shame. Thanks to all volunteers. But please do speak up 
earlier. I shouted on #soc-perl irc channel. Saw other people asking 
questions here and there. But not even a single reply or shout for help.




Yeah, feels like a big opportunity for Perl 6 lost here. Well, hopefully 
next year.


/kaare


Re: Most wanted module: Net::SMTP

2016-02-21 Thread Kaare Rasmussen

On 2016-02-20 20:50, Tom Browder wrote:

I notice that module Net::SMTP is on the most wanted list and shown as
a WIP. However, on a lark I decided to try:
I guess you refer to 
https://github.com/perl6/perl6-most-wanted/blob/master/most-wanted/modules.md 
which seems to be a compilation of wishes for Perl 6.  Nobody can decide 
what gets worked on in Perl 6; I think this is just a collection of 
ideas for someone to pick up if they have time.



1. Why is Net::SMTP available in the ecosystem if it is still a WIP
(and doesn't pass testing)?
You put emphasis on the WIP part. Please don't. And I think a lot of the 
modules will fail installation from time to time, and across different 
platforms. No different than Perl 5. Or any other advanced ecosystem.


It's probably there because it, or some of it, worked at some point. And 
the author might get to fix the problems with the tests. It's public so 
you, or somebody else, can look at it at help out.


/kaare


Re: Google Summer of Code and Google Code In

2016-02-18 Thread Kaare Rasmussen
> I have not seen the schedule for signup for this year. I expect that 
we will participate again.


Apparantly, deadline is very close for organizations now: 
https://summerofcode.withgoogle.com/


I hope the People In Power knows and has it under control.

/kaare


Re: Perl 6 Module and Program File Extension Conventions?

2016-01-13 Thread Kaare Rasmussen
But I don't know why they still suggest to use any specific suffix. It's 
of now interest or value to the user in which language the program is 
written.


/kaare


Looking at the documentation, http://doc.perl6.org/language/modules
see "Basic structure".

On 1/12/16, Parrot Raiser <1parr...@gmail.com> wrote:

For *nix, don't use a suffix. #! does the job.

For Windows, you'll want to leave .pl and .pm for Perl 5.

On 1/12/16, Tom Browder  wrote:

In Perl 5 it seems the prevailing convention (in my experience) is to
use ".pl" for Perl programs and ".pm" as file suffixes for Perl
modules.

In Perl 6 I have seen in the various repos, blogs, and doc both ".pl",
".p6", and ".pl6" for programs and both ".pm" and ".pm6" for modules.

Is there any consensus or preferred set of file extensions for Perl 6
in use among the heavy-hitter developers?

I try not to be overly concerned about such matters, but consistency
does help IMHO, and I would like to use community best practices when
I can

Thanks.

Best regards,

-Tom





Re: Recalling previous commands

2016-01-01 Thread Kaare Rasmussen

Hi

Try Out Linenoise
https://github.com/hoelzro/p6-linenoise/
panda install Linenoise


Command history is essential to the user experience of a REPL. I wonder 
why Linenoise just isn't included in Task::Star (?)


/kaare


Re: release?

2015-12-29 Thread Kaare Rasmussen

Hi Darren
On that note, are there going to be Perl 6 versions 6.x.y where {x,y} 
are integers?  Will 6.0.0 be the first such one? -- Darren Duncan


The next Perl 6 release will be called 6.d. Hopefully it will take a 
while before that happens.


I hope there will be a lot of Rakudo releases in the meantime. I guess 
the next is called 2016.1 ?


/kaare



On 2015-12-29 12:51 AM, Tobias Leich wrote:
Hi, the first official Perl 6 (the language) release is not called 
6.0.0, it is

called 6.c.
And this is what has been shipped with the Rakudo compiler release 
2015.12.


Cheers, Tobias

Am 27.12.2015 um 20:33 schrieb webmind:

Hiya,

I'm a bit confused, there is a major release for Perl 6, but I know
wonder if this is the 6.0.0 release or when this will be?

Thanks

web










Re: release?

2015-12-27 Thread Kaare Rasmussen

Hi webmind

I'm a bit confused, there is a major release for Perl 6, but I know
wonder if this is the 6.0.0 release or when this will be?



I understand your confusion.

Most people would expect something downloadable, and there is actually a 
Rakudo release to go. But 6.c is really the promise that the specs will 
not change overnight, that it's possible to write a program, or a 
module, to a spec.


The rakudo release is at 
http://rakudo.org/downloads/rakudo/rakudo-2015.12.tar.gz


/kaare


Re: Missing documentation

2015-10-28 Thread Kaare Rasmussen

On 10/28/2015 08:31 PM, Parrot Raiser wrote:

This Perl 5 to 6 Translation guide http://doc.perl6.org/language/5to6
is mentioned in several places, but returns a 404.  Is it obsolete, or
just misplaced?
This one you're looking for? 
http://doc.perl6.org/language/5to6-nutshell.html