Closed p5pRT closed 9 years ago
Need #. attached CSV shows reductions of .text section of core xs dlls after this patch. I tracked down the bizzare increase in size of perl521.dll to be that somehow the "before" blead was compiled to not be git aware\, so -V/Internals::Minus doesn't list "registered patches"\, the after lists "registered patches". The patch obviously takes priority of the readability of the generated .c file over simpleness in parsexs since there wasn't a yes or no answer in the ML thread.
patch attached
On Sat\, 22 Nov 2014 17:04:02:
The patch obviously takes priority of the readability of the generated .c file over simpleness in parsexs since there wasn't a yes or no answer in the ML thread.
Both responses indicated that both should remain readable\, I thought.
http://www.nntp.perl.org/group/perl.perl5.porters/2014/11/msg222342.html
That said\, I think you haven't obfuscated either with this patch.
On Sat Nov 22 14:14:23 2014\, bulk88 wrote:
patch attached
I like this patch\, though I see one thing that might be improvable\, you have a comment:
+ #dont do "RETVALSV = boolSV(RETVAL); ST(0) = RETVALSV;"\, it is visual clutter + print $indent."$orig_arg = RETVAL".($use_RETVALSV ? 'SV':'').";\n" + if $do_mortal || $do_setmagic || $do_copy_tmp;
but you're producing code like:
#line 5512 "APItest.c" RETVAL = sv_2mortal(RETVAL); ST(0) = RETVAL;
and:
RETVALSV = sv_2mortal(RETVALSV); ST(0) = RETVALSV;
but fixing this might make ParseXS too confusing.
I'll apply this in a few days\, unless someone objects.
Tony
The RT System itself - Status changed from 'new' to 'open'
On Sun Nov 23 16:38:51 2014\, tonyc wrote:
On Sat\, 22 Nov 2014 17:04:02:
The patch obviously takes priority of the readability of the generated .c file over simpleness in parsexs since there wasn't a yes or no answer in the ML thread.
Both responses indicated that both should remain readable\, I thought.
I was looking for a yes or not answer. Saying both means no opinion. If the answer was PXS must be cleaner\, RETVALSV and the new scope would always exist. var $indent wouldn't exist\, no s/// RETVALSV to SV* RETVAL\, etc
I like this patch\, though I see one thing that might be improvable\, you have a comment:
+ #dont do "RETVALSV = boolSV(RETVAL); ST(0) = RETVALSV;"\, it is visual clutter + print $indent."$orig_arg = RETVAL".($use_RETVALSV ? 'SV':'').";\n" + if $do_mortal || $do_setmagic || $do_copy_tmp;
but you're producing code like:
#line 5512 "APItest.c" RETVAL = sv_2mortal(RETVAL); ST(0) = RETVAL;
and:
RETVALSV = sv_2mortal(RETVALSV); ST(0) = RETVALSV;
but fixing this might make ParseXS too confusing.
Yes too confusing. To fix that would mean creating a new sub that takes a stack/@ of hashes/entries\, with placeholders in each expr the has for LVALUE/OUT RVALUE/IN and looking if any future entries exist\, and the sub looks at how many remaining entries elements exist for emitting\, it also adds the final assignment to ST(0)/$orig_arg/$arg/w/e if last expr in the last has no LVALUE in it. ParseXS is a "preprocessor"\, not a "compiler"\, I am not turning it into a "compiler" or a C compiler or teaching it to emit RTL then send it through a "C back end"\, atleast not yet.
PS\, is there any demand for written XS in Fortran or Pascal? Both have linking compatibility with C object code. Should regen.pl make proto.pas and proto.f?
http://gcc.gnu.org/onlinedocs/gfortran/Interoperable-Subroutines-and-Functions.html
I kid I kid.
-- bulk88 ~ bulk88 at hotmail.com
On Sat Nov 22 14:14:23 2014\, bulk88 wrote:
patch attached
Not a few days\, thanks\, applied as d9bb50d52d1ca3a07a2e812ec55d1165ea82d6d6.
Tony
@tonycoz - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#123278 (status was 'resolved')
Searchable as RT123278$