Perl 6 - the future is here, just unevenly distributed

IRC log for #perl11, 2016-07-28

| Channels | #perl11 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:36 punter joined #perl11
00:36 willthechill joined #perl11
00:37 willthechill okay I'm back online!  :-)
00:40 punter hi
00:40 punter i discovered irccloud.com
00:40 punter your nick will always be online (even when you're not)
00:41 punter and get notifications on phone
00:41 punter $4/month
00:42 willthechill punter: okay nice, are you using it now?
00:42 karjala joined #perl11
00:42 karjala I'm using it now
00:42 punter karjala is me
00:43 willthechill ah okay gotcha
00:43 willthechill good to know
00:43 willthechill karjala == punter!
00:48 bulk88 I just VNC remote into my desktop from my laptop or my phone, so im always online except during a heatwave
00:50 willthechill bulk88: I assume it is common for windows users not to have $ENV{HOME} or $ENV{LOGDIR} set?
00:52 bulk88 correct
00:52 bulk88 http://www.sevenforums.com/performance-maintenance/136057-windows-7-environment-variables-list.html
00:52 bulk88 homepath doesn
00:52 bulk88 t have a drive letter BTW
00:53 bulk88 I do wonder if the issue came up with perl
00:53 bulk88 p5p perl on win32
00:54 bulk88 http://perl5.git.perl.org/perl.git/blob/HEAD:/pp_sys.c#l3642 errors out
00:56 bulk88 http://www.nntp.perl.org/group/perl.perl5.porters/2001/09/msg44183.html IDK if they went through with this
00:57 bulk88 egh https://rt.perl.org/Public/Bug/Display.html?id=125305 empty list is different
00:58 willthechill okay so I will just move forward with the assumption that it is perfectly acceptable to not have either of those env vars set
00:58 willthechill and thus it is okay for chdir to fail when not passed any args
01:00 bulk88 it returns 0 and EINVAL in $!
01:01 willthechill good to know
01:01 willthechill working on it now
01:02 punter joined #perl11
01:10 willthechill bulk88: I believe this fixes the issue     https://github.com/wbraswell/rperl/commit/8447b40d877843d90453756e46a8f26530d1cb42
01:14 karjala joined #perl11
01:37 bulk88 it passed
01:37 bulk88 on SP 5.20 32b
01:37 bulk88 ill do a full make test
01:39 bulk88 that test, test 25 in 09.t also started passing on a  MSVC rperl
01:41 bulk88 http://paste.scsys.co.uk/528625 MSVC build 09.t
01:52 travis-ci RPerl build passed. Will Braswell says 'Windows OS, Allow chdir To Fail When Env Vars Not Set'
01:52 travis-ci https://travis-ci.org/wbraswell/rperl/builds/147919663 https://github.com/wbraswell/rperl/compare/5df7f15f7f78...8447b40d8778
01:57 willthechill bulk88: SWEET
02:05 karjala Could RPerl have async await, like JS ES7?
02:05 karjala in the far future I mean
02:06 karjala Here's what it is, in case you don't know: http://tagtree.tv/es7-async-await
02:06 willthechill anything that can be done in C can be done in RPerl
02:06 willthechill I don't know much about JavaScript
02:07 karjala ok
02:07 karjala I mean, would you consider accepting such new features in the language?
02:08 karjala which aren't even part of perl 6 yet
02:08 willthechill it will be fine as an RPerl module
02:08 willthechill that doesn't count as a language feature
02:08 willthechill the grammar should not need to change
02:08 willthechill nor the code generation nor execution mechanisms
02:09 willthechill it can be implemented now I would assume
02:09 willthechill as long as it will work in both PERLOPS_PERLTYPES and CPPOPS_CPPTYPES, then we are fine
02:09 willthechill (and it will eventually need to work in CPPOPS_PERLTYPES too)
02:09 karjala ok
02:39 bulk88 http://paste.scsys.co.uk/528625 MSVC build 09.t willthechill how to fix these fails
02:39 bulk88 or debug them
02:49 willthechill bulk88: checking
02:51 willthechill bulk88: okay every filename under lib/RPerl/Test/ which contains the word "bad" or "Bad" is checked for a PREPROCESSOR section which contains the hard-coded errors which that test should throw
02:52 willthechill the first failing test in your paste is lib/RPerl/Test/OperatorVoid01NamedVoidExit/program_44_bad_00.pl
02:52 willthechill the preprocessor section of that file contains:
02:52 willthechill # [[[ PREPROCESSOR ]]]
02:52 willthechill # <<< EXECUTE_ERROR: 'Argument' >>>
02:52 willthechill # <<< EXECUTE_ERROR: "isn't numeric in exit" >>>
02:53 willthechill when I simply execute that file, I get the following output:
02:53 willthechill Argument "1/8" isn't numeric in exit at lib/RPerl/Test/OperatorVoid01NamedVoidExit/program_44_bad_00.pl line 20.
02:53 willthechill which matches, in order, both 'Argument' and "isn't numeric in exit"
02:53 willthechill so that test passes on my system
02:53 willthechill we need to run that "bad" test on your system and see what error message it generates
02:54 willthechill then decide what to do
02:54 willthechill so please run lib/RPerl/Test/OperatorVoid01NamedVoidExit/program_44_bad_00.pl
02:54 willthechill and give us the output
06:19 bulk88 willthechill in MSVC 09.t test fails 31-36, were because I was using MSVC 5.25.3
06:19 bulk88 I downgraded to MSVC 5.24.0 and 09.t passes
06:20 willthechill ah wow okay great
06:20 willthechill I have never tested on 5.24
06:21 willthechill can you tell me, what was the output generated?
06:21 bulk88 of?
06:21 willthechill the failed tests
06:21 willthechill can we somehow compensate when a new version of Perl is detected?
06:21 bulk88 exit() didnt warn
06:21 willthechill new == v5.24
06:21 bulk88 no warning happened
06:21 willthechill like, no warning message was generated?
06:22 bulk88 correct
06:22 willthechill ah wow okay then
06:22 willthechill that's definitely "different" behavior!
06:22 bulk88 it might be a bug in 5.25, it is the dev branch of perl after all....
06:22 willthechill oh right
06:23 willthechill well that's a bit over my head right now, although we will have to deal with it eventually
06:23 bulk88 11.t with msdvc 5.24.0 still fails
06:23 bulk88 and AFAIK 11.t is the only .t that fails on MSVC rperl now
06:23 bulk88 i havent runt he full make test against my MSVC 5.24 perl
06:23 willthechill okay then tell me what are the failures and we will debug it
06:24 willthechill and actually, is there any way you can somehow officially check if the non-warning issue with v5.25 is a bug or a feature?
06:25 willthechill because I need to know if we need to fix those tests as well
06:26 bulk88 http://paste.scsys.co.uk/528628
06:26 bulk88 MSVC 5.24.0 11.t log
06:28 willthechill holy cow you're going to have to somehow use your MS magic to help debug this one
06:29 willthechill I've never seen half those error messages before
06:30 willthechill basically we have some pre-generated C++ files which it is trying to use Inline to compile and load
06:30 willthechill not much different than all the other tests
06:30 willthechill except this time it actually has an algorithm attached, which is the sorting of that array of numbers
06:31 willthechill not ok 128 - TIVALSOBU21 RPerl::Algorithm::Sort::Bubble::integer_bubblesort([2, 2112, 42, 23, -877, -33, 1701])
06:31 willthechill it gets through TIVALSOBU21 once okay in PERLOPS_PERLTYPES mode
06:32 willthechill ah then it fails on CPPOPS_PERLTYPES
06:32 willthechill then it passes everything in CPPOPS_CPPTYPES
06:32 willthechill so this is an issue with the Perl core
06:32 willthechill as in perl.h and friends
06:33 willthechill it is definitely beyond my understanding, especially on a Windows machine
06:33 bulk88 it looks like perl stack corruption
06:33 willthechill CPPOPS_PERLTYPES mode means it is loading and utilizing the perl.h data types like SV PV AV HV RV etc
06:33 bulk88 "Bizarre copy of ARRAY in scalar assignment"
06:34 bulk88 that is perl stack corruption, an AV * was placed on perl stack where is shouldnt have been
06:34 willthechill here's the pertinent code:    https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Algorithm/Sort/Bubble.cpp.CPPOPS_DUALTYPES#L10-L115
06:34 willthechill it compiles and works fine with all the other platforms and versions of Perl
06:35 willthechill so it must be something special to your platform or OS or compiler or version of perl.h
06:35 willthechill anyway take a look at that code I just linked
06:35 willthechill it should be easy for you to understand
06:36 willthechill the AV_ELEMENT macro and friends are here:   https://github.com/wbraswell/rperl/blob/master/lib/RPerl/HelperFunctions.h#L18
06:37 bulk88 how do i run "RPerl::Algorithm::Sort::Bubble::integer_bubblesort( [ 2, 2112, 42, 23, -877, -33, 1701 ] )" just by itself?
06:37 bulk88 #define AV_ELEMENT(av,index) ((av_fetch(av,index,0)!=NULL)?*av_fetch(av,index,0):newSV(0))
06:38 bulk88 that is very inefficient, you called the getting twice, call av_fetch once, save the AV  * to a C auto, then test the C auto if its not null
06:39 willthechill this runs in PERLOPS_PERLTYPES mode:
06:39 willthechill perl -e 'use RPerl; use RPerl::Algorithm::Sort::Bubble; print Dumper(RPerl::Algorithm::Sort::Bubble::integer_bubblesort( [ 2, 2112, 42, 23, -877, -33, 1701 ] ));'
06:39 willthechill bulk88: you can help me optimize it as soon as it is not crashing.  ;-)
06:41 bulk88 I need to run it in CPPOPS_PERLTYPES mode, not PERLOPS mode, PERLOPS passes for me
06:41 bulk88 no crash
06:43 willthechill yes I know, sorry, working on it now, it requires making several symlinks which are done by the test program
06:43 willthechill just a moment
06:43 bulk88 https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Algorithm/Sort/Bubble.cpp.CPPOPS_DUALTYPES#L43 this looks like a memory leak
06:43 bulk88 you never check the type or if its an RV int he first place https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Algorithm/Sort/Bubble.cpp.CPPOPS_DUALTYPES#L41
06:44 willthechill okay first run script/demo/unlink_bubble.sh
06:44 willthechill then run script/demo/link_bubble_CPPOPS_PERLTYPES.sh
06:44 willthechill then run the same command as before
06:45 willthechill I most certainly DO check it
06:45 willthechill https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Algorithm/Sort/Bubble.cpp.CPPOPS_DUALTYPES#L39
06:45 bulk88 https://github.com/wbraswell/rperl/blob/master/lib/RPerl/HelperFunctions.h#L18 another memory leak, what owns the SV * returned by newSV()?
06:45 bulk88 its being leaked ATM
06:46 willthechill Bubble.cpp is not a memory leak
06:46 willthechill you may be right about AV_ELEMENT
06:47 willthechill I have not dug deep enough into CPPOPS_PERLTYPES mode to know
06:47 bulk88 what owns the refcnt notch? av_fetch returns an SV * owned by the outer AV, newSV reutrns an unowned SV * that must be attached to some other data structure (mortal/glob/hash/array/SV ref)
06:47 willthechill I have no idea
06:48 willthechill you can see where AV_ELEMENT is being called
06:48 willthechill beyond that, there is Perl magic going on which I don't comprehend
06:49 willthechill anyway, did you get it to run manually in CPPOPS_PERLTYPES mode by running the unlink and link scripts?
06:50 bulk88 you do realize you asked me to run a UNIX shell script on windows? I'll try to run the .sh
06:50 willthechill oh sorry
06:50 willthechill open it up to see what the links are
06:50 willthechill they are symlinks
06:50 willthechill you can just create copies of the files instead
06:51 willthechill that's what the actual test program does, it creates copies of the files not symlinks
06:51 willthechill the shell scripts use symlinks because they are just for development purposes
06:53 bulk88 http://paste.scsys.co.uk/528629
06:53 bulk88 *sigh*
06:54 willthechill never seen that one before!
06:54 willthechill oh because you actually ran the shell scripts and it made symlinks and Windows dies on symlinks?
06:55 willthechill then just copy the files by hand
06:55 willthechill not too hard
06:55 bulk88 yep
06:56 bulk88 http://paste.scsys.co.uk/528630 didnt work
06:57 bulk88 afk for the night
06:57 willthechill okay goodnight!
06:57 willthechill FYI you should have manually created 12 copied files
06:58 willthechill ln -s Algorithm.h.CPPOPS_PERLTYPES Algorithm.h
06:58 willthechill ln -s Algorithm.cpp.CPPOPS_PERLTYPES Algorithm.cpp
06:58 willthechill ln -s Algorithm.pmc.CPPOPS_DUALTYPES Algorithm.pmc
06:58 willthechill ln -s Sort.h.CPPOPS_PERLTYPES Sort.h
06:58 willthechill ln -s Sort.cpp.CPPOPS_PERLTYPES Sort.cpp
06:58 willthechill ln -s Sort.pmc.CPPOPS_DUALTYPES Sort.pmc
06:58 willthechill ln -s Inefficient.h.CPPOPS_CPPTYPES Inefficient.h
06:58 willthechill ln -s Inefficient.cpp.CPPOPS_CPPTYPES Inefficient.cpp
06:58 willthechill ln -s Inefficient.pmc.CPPOPS_DUALTYPES Inefficient.pmc
06:58 willthechill ln -s Bubble.h.CPPOPS_PERLTYPES Bubble.h
06:58 willthechill ln -s Bubble.cpp.CPPOPS_PERLTYPES Bubble.cpp
06:58 willthechill ln -s Bubble.pmc.CPPOPS_DUALTYPES Bubble.pmc
06:58 willthechill except instead of 'ln -s' you can do 'copy' or the like
06:59 willthechill and of course all the cd commands to get into the correct directories
06:59 willthechill also you will want to set the env vars RPERL_VERBOSE=1 RPERL_DEBUG=1
06:59 willthechill then run your bubblesort command again and it should give you meaningful output
07:00 travis-ci perl11/cperl#1356 (master - f4d716c : Reini Urban): The build passed. https://travis-ci.org/perl11/cperl/builds/147951843
07:06 sten joined #perl11
07:36 travis-ci perl11/cperl#1357 (maint-5.24c - 74fb25e : Reini Urban): The build passed. https://travis-ci.org/perl11/cperl/builds/147953365
08:55 karjala joined #perl11
11:16 mako joined #perl11
13:26 mako joined #perl11
15:19 sten joined #perl11
19:26 mako left #perl11
19:26 mako joined #perl11
19:53 bulk88 willthechill http://paste.scsys.co.uk/528669 line 19 is
19:54 bulk88 # [[[ OO PROPERTIES ]]]
19:54 bulk88 our hashref $properties = {
19:54 bulk88 integer_data => my integer_arrayref $TYPED_integer_data = undef,
19:54 bulk88 number_data  => my number_arrayref $TYPED_number_data   = undef<<<<<<<<<
19:54 bulk88 };
19:54 bulk88 I see a litteral hash ref, where is the subroutine?
19:54 bulk88 " number_data  => my number_arrayref $TYPED_number_data   = undef" where is the sub?
20:02 bulk88 http://paste.scsys.co.uk/528671
20:02 willthechill hold on I've got the answer coming
20:03 willthechill the error message is not referring to line 19 of Bubble.pm, it is actually talking about line 19 of Bubble.pmc
20:03 willthechill this is a bug in the Perl core, it incorrectly reports pm instead of pmc
20:03 willthechill here is the line causing a problem:   https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Algorithm/Sort/Bubble.pmc.CPPOPS_DUALTYPES#L19
20:03 willthechill remember Bubble.pmc.CPPOPS_DUALTYPES is the file you have copied in to Bubble.pmc
20:04 bulk88 okay, how do I get rperl to keep filters1132.c around?
20:05 willthechill um that's an Inline arg, hold on a sec
20:05 bulk88 RPerl__Algorithm__Sort__Bubble__integer_bubblesort is deifned in that file
20:05 willthechill it should already stay around
20:05 willthechill in _Inline/ somewhere
20:05 willthechill this is the line that tells it NOT to delete _Inline/   https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Inline.pm#L46
20:06 willthechill so just search around in _Inline/ to find the filters*.c files
20:06 willthechill oh wait...  maybe not?
20:07 willthechill I think all those filters*.c files are mashed together into the eval*.c files in _Inline/
20:07 willthechill now we are getting into some Inline magic  :P
20:07 willthechill yes everything you need should be found somewhere in _Inline
20:07 willthechill but I recommend deleting _Inline totally and the re-running your stuff
20:07 willthechill so that there is only 1 build stored in _Inline, and it is your latest build
20:07 willthechill otherwise there will be tons of old builds in _Inline/
20:09 bulk88 I need to supress the #line 1 "C:\\sources\\rperl\\_Inline\\build\\eval_518_e207\\Filters7040.c" lines or keep that .c file around
20:10 willthechill hmmm
20:10 bulk88 I can see RPerl__Algorithm__Sort__Bubble__integer_bubblesort inside eval_518_e207.c but it is unusable/uninteractiable with the C debugger because of the  #line directive
20:11 willthechill I'm looking now at Inline::Filters but not sure how to get it to keep the Filters*.c file
20:14 willthechill asked the question on #inline but prolly won't get a (timely) answer
20:15 willthechill I think once or twice in the past I also went looking for the Filters*.c files but could never figure out how to keep them around
20:15 willthechill :/
20:16 willthechill there is a small chance that ingy or rurban or davido might know the answer
20:16 willthechill but I suspect knowledge of the answer died along with Neil Watkiss leaving the Perl community
20:16 willthechill (15 years ago)
20:16 bulk88 as I said yesterday, https://github.com/wbraswell/rperl/blob/master/lib/RPerl/Algorithm/Sort/Bubble.cpp.CPPOPS_PERLTYPES#L36 is a leaking and use-after-free mess
20:17 willthechill well I'm all for debugging it but I will need your help
20:17 willthechill my expertise is PERLOPS_PERLTYPES and CPPOPS_CPPTYPES
20:17 willthechill I am not as strong on CPPOPS_PERLTYPES mode
20:20 willthechill bulk88: there is only 1 'unlink' operator in Filters.pm, on line 135
20:20 willthechill perhaps you can just comment out that line and it will keep Filters*.c for you?
20:21 willthechill that's my best guess at this point!  XD
20:21 bulk88 testing
20:21 willthechill actually, I _DO_ think that will work
20:22 bulk88 that unlink commenting out worked
20:49 willthechill sweet
20:49 willthechill I will inform #inline
21:47 mako joined #perl11
22:59 bulk88 willthechill is bubble.cpp generated code or hand written? i cant tell
23:00 willthechill the CPPOPS_CPPTYPES part is generated
23:00 willthechill the CPPOPS_PERLTYPES part is currently hand-coded
23:00 willthechill because we haven't gotten far enough yet to generate CPPOPS_PERLTYPES automatically
23:00 willthechill that will come in the next version of RPerl or two
23:00 willthechill (like in a year or so)
23:01 willthechill so for this debugging item, you only need to worry about the Bubble.cpp code itself, not some additional code generation mechanisms
23:02 willthechill we will use CPPOPS_PERLTYPES part of Bubble.cpp as the template for when we implement automatic generation of CPPOPS_PERLTYPES code in the future
23:03 willthechill but we still need all CPPOPS_PERLTYPES hand-compiled tests to pass, to ensure we don't do something to permanently break that part of the infrastructure in the mean time
23:03 willthechill the medium-magic version of RPerl may (or may not) rely on CPPOPS_PERLTYPES, but the high-magic version of RPerl will definitely need it
23:25 bulk88 willthechill how do I make smoek branch for travis, or just oush to master branch, see how it builds, then reset master back one commit and whip my commit int he process?
23:25 bulk88 and force push
23:34 willthechill create your own fork
23:34 willthechill then make your changes in a branch in your fork
23:34 willthechill then make a pull request back into the main repo
23:34 willthechill from your forked repo
23:34 willthechill and my main repo will automatically build and test on travis for every pull request
23:34 willthechill without me actually approving & merging the request
23:35 willthechill then you can simply delete the pull request when you are done
23:35 willthechill or we can merge it if needs be
23:35 willthechill do not change the main repo in any way
23:36 willthechill please  :-)

| Channels | #perl11 index | Today | | Search | Google Search | Plain-Text | summary