In December 2015, I was rather looking forward to the release of Perl 6. I went ahead and tried to see if it would build with Microsoft’s tools on Windows. I immediately ran into some issues which I detailed in that post. One of the issues was a discrepancy between the specifications and the specification tests that only arose on Windows (bug report, pull request). Later, digging deeper into other test failures I had seen, I noticed that Perl 6 was breaking well-established ways of treating cross-platform EOL conventions. The behavior was eventually fixed before the release.
Of course, my intention was not to spend hours tracking down elusive bugs. I was eager to try things out. I was enthusiastic. But, I did end up spending time on those issues. Then I ran out of time. Time is the ultimate scarce resource, after all.
My enthusiasm for Perl 6 flared up again when brian starting writing Learning Perl 6. I decided to build Rakudo Star release from source following instructions available on their web site. I built everything, installed panda as was recommended at the time and then proceeded with panda install Task::Star
. I ran into a problem with one of the modules Task::Star
wanted to install.
In response to my question, I was told panda
was no longer recommended, and I should have used zef
, but, of course that would not have fixed the problem I was having with building the module (which, keep in mind, is only being installed because Task::Star
requires it). My question prompted the build bug to be fixed. I proceeded, got my perl6
and jumped into the REPL to be greeted by this:
When I tweeted about this, I was told Your “adventures” will be much smoother if you use the user distribution instead of building the dev branch.
Well, that’s more than a little passive aggressive: The reason I am building from the dev branch is so I am not re-discovering bugs that have already been fixed: I am trying to be helpful by pointing out what the devs are missing.
So, what are some of the problems illustrated in the screenshot above?
First, and foremost, the module was just built in front of my eyes, passed its tests, yet it can’t be used. There is clearly something missing from the tests.
Second, failure to load a module for supporting tab completions etc is not a big deal. There is no need to make so much noise every time I get in the REPL. Just a gentle reminder would be enough. Keep the noise optional.
Third, in fact, I do have basic line editor functionality, just no tab completion.
Fourth, the REPL tells me I can exit using CTRL-D which does not work. Neither does the corresponding Windows keypress, CTRL-Z. The resulting error message is weird.
In response to above, I was told CTRL-D works when
perl6
is built with MinGW … That’s also incorrect behavior. On Windows, EOF is signalled with CTRL-Z. I am in a CMD shell. Not in Cygwin bash or anything else. Besides, I am trying to see howperl6
works when built with Microsoft’s tools. So, what works with MinGW is not relevant.
Given the non-cooperative response from that leading Perl 6 developer, I decided to suspend my tinkering and wait for the next release that was due soon.
A few days ago, Rakudo Star 2017.01 was released. I immediately downloaded the source (note that the downloads are over http and no checksums are given, so do download at your own risk), and proceeded to follow the instructions. This time, thankfully, I did not have to wait long to run into a problem:
It turns out the fix is easy … But, that condescending remark about sticking with user releases rather than playing with dev branches for a smooth experience … well, I am just going to say that this bug would probably have been discovered sooner had I kept playing with the dev branch.
So, I deleted the offending line and proceeded to build. When I typed nmake test
, I got this:
What is the problem? Well, where are those pesky directory separators?
Exactly!
Anyway, I ran all of those tests. There were some failures. Some failures went away when I issued chcp 65001
before running them. Honestly, at this point, I am losing steam: My only interest in Perl 6 is as an enthusiast who wants it to succeed mostly because it is related to Perl and it is a Larry Wall project and a good friend is writing a book about it. All sentimental. There is no problem I can solve with Perl 6 I can’t already solve with either Perl or C++ or SAS or Stata or SQL. If tomorrow Perl 6 ceased to exist, it would make no difference in my life or the satisfaction I derive from tinkering with other things.
Lest you think I think I am “all that”, I am not. If Perl 6 is ever going to grow outside of the tight knit group who are all high fiving each other feverishly every time a new emoji is minted, it is going to have to attract enhusiasts in significant numbers who are going to carry the language forward. Take a look at the way we write Perl now: Does that bear any relation to the way Larry Wall wrote Perl? In fact, the only reason I fell in love with Perl is because I started with 5.6, not any of the earlier versions.
If Perl 6 is going to grow, it is going to grow among people who will use it and write it in ways the people who built it did not anticipate. For that to happen, a lot of friction needs to go away so that one does not run into some kind of problem every time one starts tinkering.
In any case, I finally had my fresh perl6
binary. As I was familiarizing myself with regex stuff, I was running a number of one-liners. Some of those one liners repeatedly read stuff from STDIN
and carried out some string manipulation and printed output in a loop. The usual way to get out of such loops whether you are in fish
or cmd.exe
is to signal EOF via the keyboard: On Unix-like OSes, this is CTRL-D. In the DOS/Windows world, CTRL-Z has carried that role since time eternal. But, it seemed like it was not working. I have a faint memory of it working at some point, but I may be wrong. In any case, I kept tinkering with my one liners, until I was pretty sure it wasn’t my fault that CTRL-Z wasn’t working. To illustrate the problem, I posted a screenshot on Twitter.
And, of course, I should have done something else:
I don’t get the errors
@sinan_unur
see’s (sic) in the REPL… but I installed using .msi installer, which is how most people should.
Well … No, I am not going to do that. These setup programs have their own ideas of where things should go etc. Not interested. It is not productive to say “do it some other way” every time I run into a problem while following published instructions.
And, of course, it is not helpful to point out “Perl 6 one can be done with .say for lines
.” Who cares? Does using .say for lines
magically make perl6
terminate the loop? No. My screenshot had perl6 -e "for $*IN.lines -> $x { say $x }"
because the one liner I had started from was embarassingly long and I kept taking things out trying to figure out what was going on. I didn’t say, “oh, let me write the shortest single line echo
”.
Then we come to the
As for
^Z
, I question whether@rakudoperl
should treat\x1A
asEOF
in this age.
Well, how do you propose to signal EOF
from the command line then? Clearly, CTRL-D did not work. And, if I have to CTRL-C to terminate terminal input, well, that has the presumably not so desirable side effect of terminating the program as well. So, what do you propose?
That’s a rhetorical question. The answer will probably be “Don’t build from source using Visual Studio. Stick with MinGW.”
I am a fan of gcc
, but using MinGW is not always the right answer.
There will probably be responses to this post along the usual lines, “get on IRC”, “submit bug reports”, “submit pull requests” etc. I am not interested. Apparently, trying to make Perl 6 better by exploring problematic corners and publicly discussing issues is considered “trashing Perl 6” among the regulars of #perl6.
Apparently, publicly announcing my support for Learning Perl 6 makes me “brian’s pet”. Why the insult? I have only ever made logical arguments without calling anyone names even when expressing my frustrations.
Now I find out that people are casually trying to marginalize me by resorting to name calling with absolutely no reaction from other participants in #perl6
, especially Larry Wall whom I hold in very high esteem.
It has been almost five years since schwern made a bunch of us stand up so he could try to shame us for our “privilege”. I resented then being lumped into one homogenous group and being told I am the cause of lack of diversity at YAPC::NA 2012 just because of my skin color. And, I resent now the attitude that somehow advocating for a project I believe in makes me someone’s pet. I wonder if people would be just as comfortable with this language if my name were “Pete”? Do they think I should just know my place and not voice my opinion? Do they think my opinions could not possibly have been mine? For what reason other than blind prejudice?
I am still interested in Perl 6. It is an intriguing and promising language, even though they still can’t get some of the basics right. Try running this:
use v6;
use Test;
1;
plan
my $p = shell('false', :out);
$p.exitcode, 0, 'exit code of false should not be 0'; isnt
Going forward, I am going to occasionally try it out and, of course, write about my experiences because I enjoy trying things out and writing about my experiences. But, until Perl 6 developers accept input from people who are not members of their tribe more gracefully, I will stay away.
In the mean time, enjoy inserting emoji in your programs, but good luck if you need to capture output and test an exit code.