pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
meppl good night 00:14
moritz_ there are cases where you can use either $_ or a self-declared implicit parameter like $^n 06:23
masak hm, $obj.HOW.can($obj, "bark") ? 08:38
usually, I consider Perl to follow the philosophy of DWIM quite well, but this...
moritz_ $obj.can('bark') ?
masak yes, I hope that still works
maybe I misunderstood the syn change 08:39
yes, that's probably it: the latter delegates to the former under-the-hood
ruoso @tell pmurias libjit is a possibility, yes. llvm is also a good one. nothingmuch was sorting out how to work with llvm in p5. This would make it even easier to integrate the smop runloop with p5. 09:13
lambdabot Consider it noted.
moritz_ ... at least if somebody manages to get XS modules working with llvm 09:14
ruoso @tell pmurias I'm not sure how a file can be pure sm0p, since sm0p doesn't support nested blocks, and since you need initialization in C for sm0p blocks. 09:15
lambdabot Consider it noted.
masak perl6: my $b; { my $x=1; sub get_x() { return $x }; sub foo() { return &get_x }; $b = foo() } say $b() 12:44
p6eval elf 21329: OUTPUT[Parse error in: /tmp/TDZpl37m9C␤panic at line 1 column 7 (pos 7): Can't understand next input--giving up␤WHERE: my $b; { my $x=1; sub get_x() { retur␤WHERE: /\<-- HERE␤ STD_red/prelude.rb:99:in `panic'␤ STD_red/std.rb:76:in `scan_unitstopper'␤ STD_red/std.rb:224:in
..`comp...
..pugs: OUTPUT[*** ␤ Unexpected "say"␤ expecting operator␤ at /tmp/1dqB6ctABO line 1, column 88␤]
..rakudo 29426: OUTPUT[Statement not terminated properly at line 1, near "say $b()"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤]
masak pugs: my $b; { my $x=1; sub get_x() { return $x }; sub foo() { return &get_x }; $b = foo() }; say $b() 12:45
p6eval pugs: OUTPUT[1␤]
masak rakudo: my $b; { my $x=1; sub get_x() { return $x }; sub foo() { return &get_x }; $b = foo() }; say $b()
p6eval rakudo 29426: OUTPUT[␤]
masak offhand, I'd say pugs has this one right.
pugs++ 12:46
zamanfou can someone explain me something about perl6.. perl will become a programming language? 12:47
masak zamanfou: Perl is a programming language. Perl 5 and Perl 6 are the two latest versions 12:49
Perl 5 is very stable, Perl 6 is under development
zamanfou masak, isnt perl 5 a scripting language?
masak zamanfou: what do you consider the difference between a scripting language and a programming language to be? 12:50
zamanfou masak, you tell me :P 12:52
masak zamanfou:
according to me, very little
use.perl.org/~Ovid/journal/30565
lambdabot Title: Journal of Ovid (2709)
masak even more so, use.perl.org/~chromatic/journal/35804 12:54
lambdabot Title: Journal of chromatic (983)
masak the latter was the one I was actually looking for
zamanfou: in summary, the programming/scripting difference is hazy at best. unless you find something important to separate them, you might as well consider scripting languages programming languages :) 12:56
zamanfou masak, I read lot of things about perl6, but I didnt understand what's the significant advantage. and the syntax is quite different than perl 5. 12:59
which will force me to learn the new syntax/functions/way of coding if I want to continue use perl.
masak zamanfou: you don't have to switch 13:00
perl 5 will be around for a long time
but -- I have to add -- perl 6 is way cool, it's just not implemented yet
zamanfou but as an outdated version of perl
masak zamanfou: perl 5 is hardly outdated. 5.10 was released a few months ago 13:01
perl 6 is just a sort of clean-slate upgrade incorporating backwards incompatible lessons learned since 1987 13:03
zamanfou masak, so, is perl6 a low or high level programming language? :) 13:04
masak zamanfou: I'd say it's on the higher end of the scale 13:05
it sports closures, currying, lazy data structures and threading
zamanfou I heard from people, perl is better than C. but I dont get why... I can code in perl ( I am quite good ) 13:06
masak (among other things, most of which escape me now)
zamanfou: the sentence "Perl is better than C" is only meaningful if you also supply a context
such as, which problem are you trying to solve
without a context, the sentence is neither true nor false 13:07
zamanfou I see, I just heard it from other coders , is not my personal opinion. Btw, my problem is, should I learn a new programming language or perl can do everything?
this question sounds "stupid" but I really need an answer 13:08
masak ok. I'll try to provide an answer. hold on 13:08
zamanfou thank you
masak when delving into Perl (5), you will find that many problems have already been solved for you
fullermd thinks the answer is "yes".
masak zamanfou: have you heard of CPAN? 13:09
zamanfou masak, I know almost every function in perl, using references, etc
I am not newbiew
masak zamanfou: have you heard of CPAN?
zamanfou yep
masak and do you use it when coding in Perl?
zamanfou hmm well, only when I need to install modules
masak that was what I meant 13:10
zamanfou I use CPAN's shell mostly
masak so what is it then that you fear that Perl cannot do?
zamanfou masak, I heard some things about "client hooking" , detours, ...
masak doesn't know about that 13:11
zamanfou hmm
en.wikipedia.org/wiki/Dynamic_linker 13:12
lambdabot Title: Dynamic linker - Wikipedia, the free encyclopedia
zamanfou In C you can write libs and load them using LD_PRELOAD
the above link will explain it a bit
masak zamanfou: I see. loading stuff into a program at runtime?
zamanfou yes 13:13
masak I haven't done much of that in Perl
maybe you should ask around on #perl
both here at freenode and over at irc.perl.org
zamanfou mm how can I be specific for this question? 13:14
masak zamanfou: ask "is it possible to load things dynamically in Perl, like with C'S LD_PRELOAD?" 13:17
zamanfou knows how to c&p :P 13:18
moritz_ perldoc DynaLoader # that stuff?
zamanfou hmm 13:19
masak zamanfou: the reply you just got at #perl is because they think you are not yet aware about modules/CPAN 13:23
...and it might actually be the answer you're looking for, I don't know
zamanfou masak, I am trying to get some informations to help them understand me
masak, www.nixcoders.org/forum/index.php?s...;#entry372 this is what I am talking about 13:24
lambdabot Title: [C/C++] LD_PRELOAD tutorial #1 - *C Board, tinyurl.com/6ddefl
masak zamanfou: it feels like a very specific thing you want to do. I'm afraid I don't know enough C to understand exactly what it is you need. however, I'm pretty sure that Perl can load things at runtime, since runtime and compile time can be mixed through verious mechanisms 13:26
zamanfou masak, then could you tell me, if its possible to "override" some of the functions of the program I wish to run? (some C program) 13:28
pugs_svn r21330 | bacek++ | [spec] Fix fudging for rakudo
masak zamanfou: I'm not sure I understand the question. but if it's a C question, you've now proceeded to become off-topic to the second degree :) you should try a C forum 13:29
zamanfou: I'd like to help you, but I'm simply not qualified. people on the right forum might be able to help you. 13:30
zamanfou you already helped me:) 13:31
thank you
masak np
and good luck
pugs_svn r21331 | moritz++ | [spec] remove bogus try{} in S29-num/trig.t 13:43
r21332 | moritz++ | [spec] continued to remove bogus try {} 13:46
pmurias zamanfou: do you want to load perl things into your perl program or c things into your perl program? 13:48
lambdabot pmurias: You have 2 new messages. '/msg lambdabot @messages' to read them.
pugs_svn r21333 | moritz++ | [t] added 'try' usage to deprecated-syntax.pod, bacek++ pmichaud++ 13:52
pmurias zamanfou: loading perl functions into a c program is possible but it would require you embedding a perl interpreter in the program you want to modify
zamanfou pmurias, I want to override C functions before the program loads using perl. I also want to access a process at runtime. 13:54
pmurias why do you want to use perl? 13:57
zamanfou cause is the only programming language im good :-) 13:58
pmurias you'll have to be good in c to use perl for that
moritz_ good reason ;)
zamanfou "good" is relative. compared to you guys, I am still newbie. but w/e...
moritz_ zamanfou: if you don't know it already: www.perlmonks.org/ 13:59
lambdabot Title: PerlMonks - The Monastery Gates
pmurias dosn't know all perl functios for sure ;)
masak Perl is build to take into account the fact that people will not learn everything about it 14:00
moritz_ very well stated, masak ;) 14:00
masak it's a diagonal language, not an orthogonal one :)
pmurias masak: aren't most languages like that? 14:01
masak pmurias: to some degree, I guess
but I'd say Perl makes a... thing out of it
you can write FORTRAN in any language, but Perl encourages C style writing, Pascal style, Haskell style etc 14:02
moritz_ Perl actually encourages lisp-like writing, only the docs don't do it ;-)
pmurias dosn't know FORTRAN ;) 14:03
masak moritz_: I thought we weren't supposed to mention the Perl/Lisp conspiracy... :P
pmurias: those who don't know FORTRAN are doomed to reinvent it, poorly :) 14:04
masak doesn't either, actually
pmurias hopes sm0p dosn't turn into fortran any time soon 14:05
moritz_ pmurias: FOORTRAN perhaps, OO Fortran ;-) 14:05
masak oO 14:07
pmichaud pugs: my $a = foo(); { my $x = 1; sub get_x() { return $x; }; sub foo() { return &get_x; }; }; say $a(); 14:20
p6eval pugs: OUTPUT[1␤]
pmichaud pugs: my $a = foo(); { my $x = 1; sub get_x() { return $x; }; sub foo() { return &get_x; }; }; say $a(); say foo()();
p6eval pugs: OUTPUT[1␤1␤]
pmichaud pugs: my @array; for 1..3 -> $x { sub get_x() { return $x; }; push @array, &get_x; }; for @array -> $f { say $f(); }; 14:22
p6eval pugs: OUTPUT[␤␤␤]
pmichaud pugs: my @array; for 1..3 -> $x { my sub get_x() { return $x; }; push @array, &get_x; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[␤␤␤]
pmichaud pugs: my @array; for 1..3 -> $x { push @array, { return $x; }; }; for @array -> $f { say $f(); };
p6eval pugs: No output (you need to produce output to STDOUT)
moritz_ pugs doesn't seem to do lexical subs 14:23
pmichaud nor closures (from that last example, unless I'm misunderstanding something)
moritz_ pugs: { my $x ; sub foo { return ++$x }}; foo(); foo(); 14:24
p6eval pugs: RESULT[2]
moritz_ pugs: { my $x ; sub foo { say ++$x }}; foo(); foo();
p6eval pugs: OUTPUT[1␤2␤]
moritz_ closures are implemented
pmichaud that doesn't really demonstrate cloning a closure, though.
moritz_ but it doesn't seem to close over the new lexical pad in a loop 14:25
pmichaud that just shows lexical scoping is working to some degree
pmichaud pugs: my @array; for 1..3 -> $x { my $s = { return $x; }; push @array, $s; }; for @array -> $f { say $f(); }; 14:26
p6eval pugs: No output (you need to produce output to STDOUT)
masak pugs: my @array; for 1..3 -> $x { my $s = { return $x; }; push @array, $s; say $_() for @array 14:28
p6eval pugs: OUTPUT[*** ␤ Unexpected end of input␤ expecting operator or "}"␤ at /tmp/SX9Mw6qkth line 2, column 1␤]
masak pugs: my @array; for 1..3 -> $x { my $s = { return $x; }; push @array, $s; }; say $_() for @array
p6eval pugs: No output (you need to produce output to STDOUT)
masak hm
pmurias pugs: sub foo {my $x=0;-> {++$x}};say foo.();say foo.(); 14:32
p6eval pugs: OUTPUT[<SubPointy(<anon>)>␤<SubPointy(<anon>)>␤] 14:33
pmurias pugs: sub foo {my $x=0;-> {++$x}};say foo().();say foo().();
p6eval pugs: OUTPUT[1␤1␤]
masak pugs: my @array; for 1..3 -> $x { my $s = { say $x; }; push @array, $s; }; $_() for @array 14:33
p6eval pugs: OUTPUT[1␤2␤3␤]
masak there you go. 14:34
pmichaud pugs: my @array; for 1..3 -> $x { my $s = { return $x; }; push @array, $s; say 'x'; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[x␤x␤x␤]
pmichaud oops, wrong line
my @array; for 1..3 -> $x { my $s = { say $x; }; push @array, $s; say 'x'; }; $_() for @array
pugs: my @array; for 1..3 -> $x { my $s = { say $x; }; push @array, $s; say 'x'; }; $_() for @array 14:35
p6eval pugs: OUTPUT[x␤x␤x␤1␤2␤3␤]
masak also good.
pmichaud oh, 'return' in a { ... } isn't quite right
because { ... } isn't a sub
so
pugs: my @array; for 1..3 -> $x { my $s = sub { return $x; }; push @array, $s; say 'x'; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[x␤x␤x␤1␤2␤3␤]
masak aha!
pugs++ 14:36
pmichaud pugs: my @array; for 1..3 -> $x { sub foo() { return $x; }; push @array, &foo; say 'x'; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[x␤x␤x␤␤␤␤]
pmichaud pugs: my @array; for 1..3 -> $x { my sub foo() { return $x; }; push @array, &foo; say 'x'; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[x␤x␤x␤␤␤␤]
masak not so good... 14:37
pmichaud pugs: my @array; for 1..3 -> $x { my $s = { $x; }; push @array, $s; say 'x'; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[x␤x␤x␤1␤2␤3␤]
pmichaud pugs: my @array; for 1..3 -> $x { push @array, { $x; }; }; for @array -> $f { say $f(); };
p6eval pugs: OUTPUT[1␤2␤3␤]
pmichaud okay, those are better. it's just the 'sub foo' case that has trouble (which, of course, is the case I'm interested in at the moment). 14:38
masak yes.
pmurias no 14:41
;)
misunderstood :(
pmurias masak: re Perl is build to take into account, are there technical implications of that approach? 15:06
besides it being used as an excuse for having System V shared memory routines in the core? 15:07
masak I see now I meant s/build/built/, a slight typo
pmurias: I'm not too well versed in System V, so I can't say anything about that 15:08
by 'technical implications', do you mean things that affect different implementations?
pmurias masak: neither am i 15:09
just looked at perlfunc to see what functions i don't know ;) 15:10
masak :)
pmurias masak: i mean how does it actually affect the languager 15:11
masak pmurias: I wasn't mainly talking about cross-platformness when I mentioned the diagonality thing
I was talking about the fact that there are often several language primitives to help reach the same goal 15:12
...to, prehaps, a greater extent than in other languages
pmurias s/languager/language 15:13
typoes--
masak yes :/
pmurias: "If I'm in one corner of a park and the restrooms are in the opposite corner of the park, I don't walk due east and then due north. I go northeast -- unless there's a pond in the way or something." -- Larry Wall 15:16
www.techgnosis.com/wall1.html
lambdabot Title: Larry Wall Interview, by Erik Davis
nothingmuch pmurias: IMAP on my server is dead right now, if you were using that you can use imap.gmail.com. mail *delivery* is not affected 15:19
pmurias nothingmuch: hi 15:21
nothingmuch: is mail forwarding affected? 15:22
nothingmuch nope 15:24
if you were using pasta.woobling.org for IMAP then that's shot now
i'm still debating as to whether or not it's worth fixing now that gmail has IMAP
if you used forwarding from gmail directly then that server has nothing to do with you
if you used forwarding on that server then it should be working
(using procmail presumably? i dunno) 15:25
pmurias nothingmuch: i think i used gmail 15:27
nothingmuch: what did you attempt with llvm and perl5? 15:29
and what did you achive? ;) 15:31
nothingmuch so far I achieved a clean compile of the perl tree with llvm-gcc to llvm bytecode 15:33
what I hope to achieve is to use the opcode definitions that are now available as llvm bytecode
at runtime
the idea is to generate llvm bytecode that for perl subroutines 15:34
that makes calls to the opcode definitions by symbol instead of by function pointer when pp_addr is not changed
and that would allow llvm to do its famous interprocedural optimizations
but too much $real_work is in the way so far 15:35
and I'm kinda burnt out recently
pmurias does llvm have a nice c interface or is it just llvm assembly manipulation? 15:38
s/is it just/does it require/
masak speaking of assembly (and slightly OT): I read canonical.org/~kragen/strlen-utf8.html with delight, and now I'm curious as to what generates output like the one in the second listing 15:40
lambdabot Title: Counting Characters in UTF-8 Strings Is Fast
masak i.e., given a binary, I want to show its assembly instructions 15:41
nothingmuch it has very good C integration in the sense that it can call to C code, compile C code (with llvm-gcc), be embedded in C (it's in C++ but there are C headers and a C api to call link with the C++), etc
masak I tried toying around with gdb, but didn't get very far
nothingmuch that said generating LLVM assembly is probably much easier than generating C 15:43
there's a very nice tutorial I followed
i think it covers all my needs for compiling optrees dynamically at runtime
pmurias moritz_: what's was the box you have me a shell account on called, and can i use it to test if my webserver is accessbile from outside my LAN? 15:46
moritz_ pmurias: timtowtdi.org
pmurias: and you 15:47
're welcome to to do anything that's not harmful
and doesn't suck up resources like hell ;)
pmurias nothingmuch: thanks, looked at the tutorial and it answered my questions 15:52
pmurias hates system administration 16:11
rpag will perl6 ever be released? 17:00
moritz_ sure
but don't ask when ;-)
armagad When?
moritz_ on christmas
rpag this year? 17:01
moritz_ not necessarily
but once it's released every day will feel like christmas
pmurias rpag: pugs had many releases 17:21
masak actually, I think pugs and rakudo have enough features to make every day feel a little bit like christmas already
moritz_ parrot (+ rakudo) is going to have one tomorrow ;-)
masak it can only get better for christmas :) 17:22
moritz_ masak: they have nice features, but both aren't suitable for every day programming
pmurias usability for every day programmin is a lot less than full perl6ness 17:29
moritz_ aye
pmurias aye = yes? 17:30
moritz_ but for example modifiers in regexes are crucial for me 17:31
s/in/on/
aye = yes, aye ;-)
pmurias you are refering to pugs? 17:33
pmurias moritz_: elf has them in a twisted and evil way 17:49
pugs_svn r21334 | pmurias++ | [smop] 18:24
r21334 | pmurias++ | method calls and strings in s1p, variables are translated to c variables as we don't have namespaces yet
r21334 | pmurias++ | test 13_io is moved to perl6 as traditional it memory leaks
pmurias moritz_: you have a c compiler in the evalbot?
pmurias * do you 18:34
rakudo_svn r29443 | pmichaud++ | [rakudo]: spectest-progress.csv update: 95 test files, 1691 passing tests 19:12
moritz_ pmurias: yes 20:34
pmurias: re modifiers, rakudo and pugs
pmurias moritz_: it might make sense too put s1p in the evalbot soon 20:35
moritz_ pmurias: no objections from me 20:36
moritz_ decides that security is overrated :/
pmurias fake security is definitly overrated 20:37
s1p is a perl6 implemenation, so it *might* get a safe mode in the far future 20:38
it's an elf variant to be exact 20:39
moritz_: you need regex modifier for perl5 regexes? 20:40
you could use the (?flag...) syntax
moritz_ pmurias: no. The discussion was if perl6 feels like christmas today, and I just mentioned that for me it's not yet, because such crucial features are regex modifiers are missing from both pugs and rakudo - that's all 20:41
pmurias wonder how many people would actually like eternal christmas 20:42
* wonders 20:43
pmurias what would be a good syntax for none \w+ constant identifiers? 20:48
moritz_ pmurias: what for? 20:49
pmurias moritz_: sm0p 20:52
moritz_ q:identifier[...] ? 20:53
or $MY::('identifier with spaces') - I guess that's even valid Perl 6 20:54
or something along these lines
pmurias i was considering idconst.new("...")? 20:56
pmurias the second syntax issue is how should variables taken from the c namespace (?) be marked in perl6 code 21:00
pmurias how is the place c identifiers are stored? 21:04
s/?/ called ?/ 21:05
spinclad pugs: my @array; for 1..3 -> $x { push @array, sub { return $x; }; }; for @array -> &f { say f; }; 21:26
p6eval pugs: OUTPUT[1␤2␤3␤]
spinclad pugs: my @array; for 1..3 -> $x { unshift @array, sub { return $x; }; }; for @array -> &f { say f; };
p6eval pugs: OUTPUT[3␤2␤1␤]
spinclad pugs: my @array; for 1..3 -> $x { my sub f { return $x; }; push @array, &f; }; for @array -> &f { say f; }; 21:27
p6eval pugs: OUTPUT[␤␤␤]
spinclad pugs: my @array; for 1..3 -> $x { my &f = sub { return $x; }; push @array, &f; }; for @array -> &f { say f; }; 21:28
p6eval pugs: OUTPUT[*** Can't modify constant item: VStr "MkCode {isMulti = True, subName = \"&\", subType = SubPrim, subOuterPads = [], subInnerPad = MkPad (padToList []), subPackage = , subAssoc = AIrrelevantToParsing, subParams = [], subBindings = [], subSlurpLimit = [], subReturns = (mkType \"An...
spinclad pugs: my @array; for 1..3 -> $x { my $f = sub { return $x; }; push @array, $f; }; for @array -> &f { say f; };
p6eval pugs: OUTPUT[1␤2␤3␤]