pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, elf: etc.) (or perl6: for all) | irclog: irc.pugscode.org/
Set by Tene on 29 July 2008.
00:01 SamB joined 00:24 hercynium joined 00:28 alester joined 00:34 ruoso joined
ruoso Arathorn, re thread: the basic idea is that a thread is a high-level entity and that you wouldn't be executing code from one "continuation (even if using different runtimes)" from different threads 00:37
Arathorn, if you're in one thread and you swith over the execution to another runtime interpreter, that continuation must still be in the same thread 00:39
Arathorn, but in fact... the threading model wasn't very much stressed beyound the use of pthreads...
Arathorn, if you're interested, you could start sketching conceptual exercises so we can stress this issue... 00:40
00:44 bacek joined
Arathorn tries to wrap his head 'round that 00:48
ruoso Arathorn, think of threads as "continuations" instead of os threads... the relationship between them may or may not be 1..1 00:50
Arathorn right, i think I get that 00:51
does that mean that the smop runloop itself is always single threaded, then - relying on the native runtimes to marshal/unmarshal object invocations/messages to the right thread? 00:53
or you just swap between the continuations which relate to the current native-runtime threads of execution within the main smop runloop 00:54
which again makes it sound as if everything gets flattened down to single-threadedness
ruoso Arathorn, kind of... yes...
00:54 sail0r left
ruoso but eventually the runtime can decide that this "group of threads" will be handled by a different process 00:55
the basic idea is something I steal from Erlang and IO (a language called IO, yes)...
which is to hide the concept of a OS thread from the user
letting the runtime decide when to open a new os thread or not... 00:56
Arathorn nods
ruoso most of the time you don't really need a thread
Arathorn right - so smop would essentially be providing a pthreads implementation for the runtimes running on it, which is implemented by continuations (which may in turn be shared between concurrent smop runloops)?
ruoso exactly
Arathorn interesting, and rather cool :)
ruoso like bringing POE to the runloop
Arathorn nods 00:57
ruoso except that it can be preemptive... because p6 supports continuations, while p5 doesn't
Arathorn in terms of how you'd program it from p6, i guess so 00:59
Arathorn gets confused about the fact that whilst p5 doesn't support continuations, one could still snapshot the stack of its runtime in order to run it within the smop event loop
01:01 MeGaMiC joined
ruoso Arathorn, it could be done if p5 was completely stackless.. but unfortunally that's not the case 01:01
nothingmuch was planning to work on making p5 stackless, which would make it even easier to integrate smop and p5
Arathorn nods 01:02
ruoso that's actually one step in the secret plan of including smop as part of p5 ;) 01:03
like adding smop dispatch as one of the p5 ops
but that's for the future, and only a supposition at this moment...
ruoso sleep & 01:04
ruoso will backlog, as usual...
Arathorn night :) 01:05
ruoso ;)
Arathorn and thanks for the clarification
Arathorn reads up on stackless VMs
ruoso Arathorn, the stackless python project was a very interesting reading
#stackless at this network
but the python people don't think continuations are a good feature, so the patches never made into the official python 01:06
Arathorn that's what i'm reading :)
ruoso really sleep &
Arathorn (well, the ML thread on it from 2002)
01:37 sri_work left 01:49 seanstickle joined 01:58 seanstickle left 02:11 penk joined 02:17 wknight8111 left 02:22 broquaint joined
awwaiid in the meantime, Coro seems to work for doing cooroutines, aka "one could still snapshot the stack of its runtime..." (Aratorn) 02:24
er, Arathorn
02:29 MeGaMiC left
Arathorn mm 02:39
Arathorn looks into Coro
hm, i don't understand whether that's implementing coroutines on top of the p5 vm, or somehow messing with p5-internals to swap stacks around 02:43
...probably because it's getting on for 4am
Arathorn sleep & # thanks for the pointer :) 02:44
02:53 penk left 02:57 Chillance left
awwaiid messing with p5-internals 03:01
and all sorts of horrbile things 03:02
Arathorn yeah
Arathorn was just rummaging in its XS
awwaiid but it works! sometimes
Arathorn really sleep, anyway
03:02 Arathorn left
awwaiid cya :) 03:02
03:19 kanru left 03:37 fridim_ joined 03:49 kanru joined 04:19 bacek_ joined 04:28 bacek left 04:32 AzureStone_ joined 04:34 Alias__ left 04:49 AzureStone joined, AzureStone_ left 05:23 hercynium left 05:30 fridim__ joined 05:31 xinming joined 05:41 c1sung joined 05:42 Psyche^ joined 05:43 fridim_ left 05:44 fridim_ joined 05:52 fridim__ left 05:59 Psyche^ is now known as Patterner 06:18 allbery_b joined
pugs_svn r21758 | pmichaud++ | S29-str/substr.t: mark a #?rakudo skip for substr as lvalue 06:22
06:28 ilogger2 joined 06:34 ashizawa joined 06:55 Lunchy_ joined, Lunchy left 06:56 masak joined 06:58 MeGaMiC joined 07:32 luqui joined
pugs_svn r21759 | moritz++ | [t/spec] unfudge and s/skip/todo/ some tests for rakudo 07:45
07:45 justatheory joined
masak moritz_: welcome back :) 07:51
moritz_ masak: I just went to parents to get some internet access.... real vacations start von wednesday ;) 07:52
masak: btw I identified the weird failures that I had with tools/test_summary.pl
masak: it was my PERL6LIB env variable which pointed to pugs' Test.pm 07:53
masak ah. 08:02
moritz_: are you coming to YAPC::EU?
moritz_ so now I filed a bug report to report the file name in which the syntax error occured
masak: no :(
masak moritz_: good about the bug report, too bad about YAPC::EU 08:03
moritz_ yes, indeed
masak looking forward to meeting you someday.
moritz_ me too 08:06
08:16 pmurias joined
pmurias masak: i'm assuming you will be at YAPC::Europe 08:18
masak pmurias: aye
...with the main goal of being as helpful to rakudo/Perl 6 as possible while I'm there 08:19
pugs_svn r21760 | audreyt++ | * Add dependencies from hackage for offline install. 08:28
r21761 | audreyt++ | * Update cabal-install to our severely hacked version that should hopefully 08:31
r21761 | audreyt++ | be merged with cabal-install 0.5.3.
08:31 zamanfou joined
pugs_svn r21762 | audreyt++ | * Add local repos cabal-install support. 08:32
r21763 | lwall++ | s/q:code/quasi/ plus various t/ buglets 08:39
r21764 | audreyt++ | * Add 00-index.tar that only includes Pugs dependencies. 08:43
r21765 | audreyt++ | * Add the missing InstallSymlink.hs 08:58
r21766 | moritz++ | [t/spec] a few passing tests for rakudo in S03-operators/assign.t 09:00
pmurias the perl6 wiki link on pugscode.org is broken
moritz_ should it point to www.perlfoundation.org/perl6/index.cgi ? 09:01
lambdabot Title: Perl 6 / Perl 6
pugs_svn r21767 | audreyt++ | * directory cleanup 09:04
pmurias moritz_: guess so 09:10
pugs_svn r21768 | moritz++ | [docs/feather] fixed wiki link on homepage, pmurias++ 09:26
r21769 | moritz++ | [STD] new make target testt for running all of t/, not just t/spec/ 09:28
r21770 | audreyt++ | * Makefile.PL: Install prerequisites automatically without connecting to hackage.haskell.org. 09:30
moritz_ (that was probably not the link pmurias meant... dammit)
pugs_svn r21771 | moritz++ | [t] fixed test in builtins/math/complex_powers.t 09:33
moritz_ wanders off...
pugs_svn r21772 | audreyt++ | * Offline installation completed; it now works on a vanilla GHC 6.8. 09:36
pmurias moritz_: i meant the Perl6 Wiki one 09:41
masak: i can show you how smop works at the yapc 09:44
masak pmurias: that'd be much appreciated
so far I've only read a wiki page on it 09:45
zamanfou is now away: In the rain my tears are forever lost. 09:46
pugs_svn r21773 | audreyt++ | * Explicitly add stm to depends 09:47
masak zamanfou: your tears are forever lost in the rain quite often on this channel, methinks 09:50
09:56 smtms joined 09:57 elmex joined 10:02 ashizawa_ joined, ashizawa_ left 10:03 ashizawa left 10:10 fridim__ joined
ruoso later & 10:21
10:34 fridim__ left 10:45 wknight8111 joined 11:10 ruoso joined 11:11 icwiener joined 11:22 pmurias left, pmurias joined
ruoso hi pmurias! 11:23
11:25 pmurias_ joined, pmurias_ left 11:26 pmurias left, pmurias joined
pmurias ruoso: hi! 11:26
ruoso eat something & 11:27
pmurias, Mold is very cool... I'm looking forward to see it replacing slime asap
ruoso brb &
11:41 wknight8111 left
masak pmurias: you could start now by explaining how smop fits into the big Perl 6 picture 11:43
pmurias smop is a runtime for Perl 6 to run on 11:45
it's similiar to parrot in it's part in the picture but makes very different choices for most things 11:48
s/most/some/
ruoso pmurias, we could talk with the organizers of yapc::eu for you to replace me in the smop talk... 11:50
what do you think?
pmurias i could try to give it 11:51
ruoso you can change the slides if you want ot
s/ot/to
and they are out-of-date atm... 11:52
pmurias, do you want the original openoffice file for the slides? 11:53
11:54 BinGOs joined
pmurias ruoso: i think so, editing a pdf might be hard 11:56
ruoso heh
Grrrr ruoso, pmurias: shall I change the "owner" of the talk now? 11:57
ruoso Grrrr, that's fine by me... 11:58
Grrrr pmurias? 11:59
pmurias yes
ruoso pmurias, the slides are on the way to your inbox 12:00
masak pmurias: what can I do in smop today? what makes it attractive to hack on rather than, say, rakudo?
ruoso masak, take a look at test/22
audreyt pmurias: are there some sample inputs to .m0ld?
ruoso masak, that's an example of one of the cool things we're doing already 12:01
pmurias audreyt: the code on the wiki is what i use for testing the parser
audreyt pmurias: except it doesn't yet parse?
Grrrr pmurias: ok, now if you login to Act you should be able to see it as your talk and edit it as you see fit; do you want a refund for your registration?
masak ruoso: where? the pugs repo contains neither a 22 nor a 22.t file
ruoso masak, v6/smop/test/ 12:02
audreyt masak: v6/smop/test/22_smop_s1p_attribute.sm0p
masak ah, thx
pmurias audreyt: wait
audreyt seems it doesn't handle string constants 12:03
k
ruoso masak, we have a somewhat clear roadmap in the wiki page
pugs_svn r21774 | pmurias++ | [m0ld] codes and arguments
masak ruoso: URL?
ruoso www.perlfoundation.org/perl6/index.cgi?smop
lambdabot Title: SMOP / Perl 6
masak ruoso: thank-you
pmurias audreyt: Mold/m0ld is under development, i hoped to finish in a few days and show it to you for review ;) 12:04
audreyt pmurias: ok, meaning I better not hack on it prematurely :)
because it's trivial to take Pugs.CodeGen and make it generate m0ld, you know :)
ruoso trivial is good :) 12:05
pmurias i'll get back to hacking on it as soon as i get my wifi working 12:07
ruoso pmurias, on files that use m0ld blocks (when they replace sm0p), we need an initialization placeholder, right? so the Mold can be initialized....
zamanfou is now away: In the rain my tears are forever lost.
ruoso zamanfou please remove this f** away message
12:07 luqui left
masak @slap zamanfou 12:08
lambdabot why on earth would I slap zamanfou ?
masak true, he being away and all... :/
s/he/him/
12:10 MeGaMiC left
audreyt sorry for the very basic question, but how should one go about adding inheritance to smop? 12:10
12:10 Jedai joined
pmurias ruoso: m0ld dosn't emitting anything yet 12:11
but Mold shouldn't need much initalization just create a Mold and make Mold__Frames using it
wifi and wifi using mobile phone installation& 12:12
ruoso yes... and we want to create the mold during smop_init, don't we?
for the objects that are initialized in that phase, of course...
audreyt, we need a metaclass 12:13
pmurias ruoso: it's already done
ruoso audreyt, p6opaque currently delegates all calls to .^dispatch
audreyt, that's already working... we just need a metaclass that implements the inheritance
pmurias, sorry... I got confused, what is already done? 12:14
audreyt, take a look at test/14
audreyt ok 12:15
I was looking at v6/smop/src-s1p/P6Meta.pm 12:16
ruoso that's the start of it, yes... but we still need the dispatch code
and we also need to compile that to C+m0ld
(this compiler being the thing I've been calling s1p) 12:17
and obviously, we need all the operators we use in that code...
audreyt by "the dispatch code" you mean the code that does delegation to parent classes
right?
ruoso not only that... but the entire dispatch... including multi and stuff 12:18
p6opaque delegates all calls (except for REPR calls) to the metaclass instance
audreyt why is that? does src-s1p uses multis?
ruoso audreyt, www.perlfoundation.org/perl6/index....mop_oo_api 12:19
lambdabot Title: SMOP OO API / Perl 6
ruoso audreyt, no... I mean... the thing that will support multis when someone uses it is the metaclass instance
audreyt oh. that makes more sense. thanks
(and yes I've read through the available docs :)) 12:20
ruoso :)
audreyt, you're actually one of the qualified people to write the dispatcher :)
ruoso doesn't consider itself one 12:21
audreyt that what I'm pondering doing, yes.
that, or the s1p compiler
ruoso s/itself/himself/
audreyt, you could take both ;) ;) ;)
considering you'll need the compiler to test the metaclass
;)
audreyt fair point 12:22
pugs_svn r21775 | moritz++ | [t] some updates to README, and fixed all but one smartlink in t/spec/ 12:24
12:27 pmurias left
ruoso wonders if yapc::eu will have video records of the talks for people who can't go there... 12:32
audreyt, but... from what you've seen in src-s1p/P6Meta.pm... do you think it's sane? 12:34
Juerd Who's going to yapc::copenhagen? 12:36
ruoso 's not going :(
BinGOs Juerd: I am. 12:37
Juerd BinGOs: Yay
Juerd is too
BinGOs I am giving a talk!
masak I'm going.
moritz_ envies all yapc::eu visitors ;) 12:38
12:42 cmarcelo joined
masak aye, visiting YAPC::EU is the new black. 12:46
Patterner Juerd: would you hold it against me if I say "yes"? 12:48
Blue is the new pink.
12:49 nipotan is now known as nipotaway
Juerd :) 12:50
12:57 BinGOs left, BinGOs joined 13:00 timbunce joined, timbunce left
audreyt ruoso: can we have sm0p5.pm committed inside svn 13:07
ruoso: for poor people who do not have convenient access to a linux box with ruby 1.9 and perl 5.10? :)
ruoso that could be a good idea... 13:08
13:08 gaal joined
moritz_
.oO( feather? )
13:08
pugs_svn r21776 | ruoso++ | [smop] adding sm0p5.pm for audreyt++ 13:09
audreyt moritz_: I do have access to such a box :)
moritz_ ok, I underestimated the "convenient" ;) 13:10
audreyt oh. 13:25
avar: ping!
moritz_ tries to build pugs on the server that hosts p6eval 13:28
is a normal 'perl Makefile.PL && make' build an optimized one? 13:29
I'm getting a few warnings during the build, but so far no errors 13:31
audreyt moritz_: it's fairly optimized
not fully optimized, but the diff should be small (<10%)
(it's -O1 not -O2)
moritz_ audreyt: ok, thanks 13:32
audreyt avar: OBJECTS in Makefile.PL, instead of LDDLFLAGS, is your friend :) 13:35
@tell avar community.haskell.org/~audreyt/re-e....05.tar.gz # should build everywhere 13:36
lambdabot Consider it noted.
moritz_ Could not find module `Text.Regex.PCRE': Perhaps you haven't installed the profiling libraries for package regex-pcre-builtin-0.94.1.0.7.7? 13:38
is this talking about a cabal package?
audreyt yes. hm. 13:39
the easiest way out is to say
ghc-pkg unregister --user regex-pcre-builtin
and then makefile.pl again
you may need to do that for each of the complained module 13:40
Makefile.PL should detect this condition
but it will only happen once, and will only happen if you had previously "cabal install Pugs"
13:41 pugs_svn left 13:44 Arathorn joined
moritz_ wonders if it's faster to just rm -rf ~/.cabal/ 13:45
audreyt then you need to rm -rf ~/.ghc 13:46
that is another way yes.
moritz_ otoh that would leave p6eval without pugs, and I don#t know if I'll be around long enough to build a new one
audreyt it'll take about 15mins. 13:47
moritz_ ok, I moved ~/.cabal and ~/.ghc6 to a backup dir 13:48
pugs: say "hi"
p6eval pugs: OUTPUT[sh: /home/evalenv/.cabal/bin/pugs: No such file or directory␤]
moritz_ I guess 'make' will put the pugs binary just in root of the repo? 13:49
audreyt correct
Arathorn is there any intention for smop to allow invocation of p6 code from within one of the other native runtimes, btw? or is the polymorphic eval only good for invoking methods from p6 on any other runtimes within the runloop?
moritz_ evalbot control restart 13:50
13:50 p6eval joined
moritz_ rakudo: say "back again" 13:51
p6eval rakudo 29834: OUTPUT[back again␤]
moritz_ is pleased to see that cabal requires even less interaction than cpan 13:52
ruoso Arathorn, I'm not sure I understand your question 13:53
moritz_ I think the question is "can I call perl 6 code from python code with smoop?"
Arathorn exactly 13:54
sorry for being unclear
ruoso as long as we integrate the runloop of the other runtime, yes...
that's the planned, actually
Arathorn right
ruoso for p5 it seems very much feasible
stackless python also seems like a good candidate 13:55
pasteling "moritz" at 91.8.218.102 pasted "pugs build failure - do I need a "make clean" or something?" (7 lines, 485B) at sial.org/pbot/31792
audreyt moritz_: rm -rf dist 13:56
then make
moritz_ ruoso: I think the differences between standard and stackless python are pretty small
audreyt that should do it
moritz_ audreyt: thanks, I'll try
audreyt it'll be only <10min from now
maye <5min :)
moritz_ ;)
ruoso moritz_, the differences are indeed smal... and I can't really understand why the stackless patch wasn't accepted 13:57
moritz_ ruoso: propably politics
ruoso very much possible
moritz_ "then we have to educate our programmers what 'stackless' means..."
ruoso is that really a quote?> 13:58
moritz_ no
[particle] ruoso: if it were a real quote, you probably would have gotten it emailed to you directly ;)
ruoso heh 13:59
Arathorn is a little confused as to why stackless python is actually called stackless - in that presumably when you resume a continuation of the python runtime, you do so by pointing its frame pointer at a stack (which happens to be a continuation)? 14:01
moritz_ Arathorn: because it doesn't use the C level stack to recurse into python subroutines/methods
ruoso moritz_++ bullseye
Arathorn how does that help being able to resume the runtime using continuations, though? 14:02
14:02 pmurias joined
moritz_ pugs: say "back, audreyt++" 14:02
p6eval pugs: OUTPUT[sh: /home/evalenv/.cabal/bin/pugs: No such file or directory␤]
gaal is the smokeserver still at smoke.pugscode.org? I can't view recent smokes. 14:03
14:03 p6eval left
ruoso Arathorn, because you can just take the interpreter state as the continuation... if you use the C stack you have to deal with both the interpreter stack *and* the C stack... which makes it quite harder 14:03
14:03 p6eval joined
Arathorn AH! right 14:03
ruoso and eventually impossible, depending on how weird your code is
moritz_ pugs: say "another attempt"
p6eval pugs: OUTPUT[another attempt␤]
moritz_ pugs: say "audreyt++"
p6eval pugs: OUTPUT[audreyt++␤] 14:04
[particle] perl6: say 'p6eval++'
p6eval elf 21778, pugs, rakudo 29834: OUTPUT[p6eval++␤]
[particle] time to add revision number to pugs again?
gaal perl6: "why say when you can display"
moritz_ gaal: because it takes longer ;) 14:05
p6eval pugs, rakudo 29834: RESULT["why say when you can display"]
..elf 21778: RESULT["why\ say\ when\ you\ can\ display"␤]
gaal hahaha
Arathorn what is involved in actually "dealing" with the stack in question, though? surely a snapshot of a stack + the heap is all you need to be able to resume an app
pmurias Arathorn: how do you plan to do it with pure C?
ruoso Arathorn, you mean, in SMOP? 14:06
Arathorn no, in general
pmurias it being taking a snapshot of the stack
ruoso it depends too much on each implementation
Arathorn pmurias: with difficulty, if it were to not be platform-specific hack
ruoso Arathorn, I think longjmp is part of C99... 14:07
Arathorn oh, right
pmurias C89
according to the man pages 14:08
ruoso yeah... exactly...
Arathorn so the kind of things you have to do are to ensure that you really do have a single stack frame to copy in the first place, and then find a cross-platform way of manually pointing the frame pointer to an alternative stack
ruoso or... implement a stackless runloop and you have a single instance with the "current continuation"
and that's it
Arathorn i still don't entirely see why it matters whether some of the stack frames happen to be for interpreted code rather than C 14:09
shame the stackless docs concentrate on threadlets and the other cool features it provides python, rather than explaining what the patch does under the hood 14:10
ruoso imagine the following call stack: perl5 => smop => perl5 => python => smop
Arathorn right
ruoso handling each interpreter + the c stack is very hard... and may be impossible 14:11
pmurias Arathorn: instead of calling a function the stackless python set's a variable with a function pointer,returns and calls the function in the variable
ruoso if you're stackless... you can use CPS to hand over the entire execution to the other interpreter, that will then hand back to that interpreter
pmurias ruoso: i think stackless python is not integrated into the mainline because the mainstream python developers don't care much about the features it provides 14:13
and it's a nasty hack 14:14
ruoso pmurias, it looks like so
Arathorn surprising, given the large-scale concurrency it gives looks pretty cool to me 14:15
gaal pmurias: got a test case for m0ld? I want to send in some golf but am not familiar with the language 14:16
Arathorn still doesn't entirely understand what "handling each [interpreter's] stack" entails, but i'll try reading the stackless python impl for clarification 14:17
14:19 sri_work joined
ruoso Arathorn, implemeting gather/take with intepreter stack + c stack when you have a call stack of python => perl5 => smop => perl5 => python looks very hard to me 14:20
14:21 pmurias left
zamanfou is now away: In the rain my tears are forever lost. 14:21
14:21 TJCRI joined
moritz_ it looks very hard for me either way ;-) 14:21
but it might be just me being not a good C hacker ;) 14:22
ruoso if it is stackless, it is much simpler...
because it's simple to create a closure with the current continuation
14:22 pmurias joined
Arathorn right 14:22
ruoso and make other calls to the interpreter where you hold a continuation to 14:23
remember...
you have a p5 continuation saved, and you're still using the p5 interpreter for other calls
the same interpreter
gaal pmurias: should v6/smop/sm0p/test_file parse with m0ld?
Arathorn <ruoso> you have a p5 continuation saved, and you're still using the p5 interpreter for other calls 14:24
^ for other continuations?
ruoso yes
Arathorn ah ha :D
Arathorn has his lightbulb moment
ruoso :P 14:25
Arathorn sorry for being thick, and for the explanation
ruoso it's always a good exercise to go through this concepts again...
Arathorn hopes others may google this in years to come and find similar lightbulbs
Arathorn nods
moritz_ tries to keep the IRC logs up as long as possible 14:26
ruoso Arathorn, you could sketch up a little more in the smop wiki abou thtat 14:28
14:31 TJCRI left
moritz_ [particle]: re adding revision numbers to pugs in p6eval, will do after my vacations 14:32
Arathorn ruoso: will try to document once i've read up a bit more on it 14:34
gaal Hmmm. I think Time::Out is not enough as it is used in yaml_harness. When a test times out, all the ones following it time out too. Unless I killall pugs in another shell... 14:39
14:40 masak left 14:41 kanru joined
pmurias gaal: sm0p and m0ld are totally different thinks 14:48
* things
audreyt: having sm0p5.pm in the repo is pointless as it compiles fast and perl5.10 is both required to run and compile it, (ruby1.9 on the other hand is required for STD5_red which is used by elf which is used for compiling p6 to sm0p) 14:55
Arathorn is there any semantic difference between sm0p and smop, btw? 14:56
14:56 jerrylee joined
pmurias sm0p is the DSL used by SLIME the lame interpreter implementation for smop 14:57
the difference is like pir vs parrot
pmurias don't think clearly or respond swiftly as usual when doing system administration related tasks... 15:00
* dosn't
gaal pmurias: okay, then where can i get a demo m0ld file? :) 15:01
pmurias gaal: i'll check in the example from the wiki ;) 15:04
15:08 Exodist joined 15:09 TJCRI joined
pmurias gaal: there was a typo in the example 15:15
gaal: m0ld is two days old, so it's not working yet 15:16
15:16 pmurias left
gaal does it at least construct an ast i can compare against? 15:16
15:23 alester joined 15:36 Alias_ joined 15:37 frobnitz joined
audreyt @tell pmurias ok, then an alternative is bake brew into Makefile. 15:41
lambdabot Consider it noted.
audreyt gaal: www.perlfoundation.org/perl6/index.cgi?smop_mold
lambdabot Title: SMOP Mold / Perl 6
15:52 hercynium joined 15:53 fridim_ joined 15:56 Lorn joined 15:58 wknight8111 joined 16:02 nothingmuch joined 16:05 fridim_ left, fridim_ joined, jerrylee left 16:17 iblechbot joined 16:28 icwiener left 16:31 cjfields joined 16:45 cjfields_ joined 16:48 toddr joined 16:49 iblechbot left 17:01 rindolf joined 17:02 cjfields left 17:04 toddr left
TimToady svnbot seems to be mum 17:15
17:15 pugs_svn joined
pugs_svn r21782 | audreyt++ | * Configure.PL: Probe for GHC's -threaded flag. 17:15
r21783 | lwall++ | [STD] implement quasi correctly
r21784 | lwall++ | [STD] support .parse and .parsefile methods, emit filenames on errors
r21785 | lwall++ | [STD5_dump_match] use new parsefile method
moritz_ better? ;-)
if some of the bots go missing during the next one or two weeks, poke Auzon (when he's back) or pmurias, they have access to the server 17:17
if not... either wait for my return, or start a copy on feather3
17:21 cathyal joined
TimToady or hack into your server... :) 17:35
17:42 gaal_ joined 17:43 gaal is now known as Guest79729 17:44 cjfields_ is now known as cjfields, gaal_ is now known as gaal 17:45 Guest79729 left
pugs_svn r21786 | gaal++ | * m0ld: minor cosmetic cleanup 17:54
17:55 gaal left 17:58 cmarcelo left 17:59 cmarcelo joined
rindolf Hi TimToady , moritz_ 18:02
How were your weekends?
Arathorn DSL == domain specific language? 18:12
ruoso Arathorn, yes
rindolf Arathorn: yes. 18:17
18:23 rindolf left
pugs_svn r21787 | ruoso++ | [smop] lowlevel method uses a Code object instead of a C callback function! 18:36
18:37 jhorwitz joined 18:40 TJCRI left 18:50 pmurias joined
pmurias audreyt: you mean integrate it into the main Makefile? 18:53
lambdabot pmurias: You have 1 new message. '/msg lambdabot @messages' to read it.
ruoso is there any implementation difference between Sub and Method?
both extend Routine, right? 18:54
the signature binding happens at Routine, I suppose...
pmurias ruoso: don't know 18:55
ruoso as well as the differentiation between 'leave' and 'return'...
I think it's time for lexical variables... methods would bind the capture to the signature resulting in new variables in a lexical scope inside which the code would be executed... 18:56
pmurias ruoso: i'll continue working on m0ld rather than implement lexicals, but i agree that lexicals are much needed 19:02
19:03 pbuetow joined
pmurias shower& 19:03
ruoso pmurias, are you planning to port smop_s1p_code to use mold directly, so that the attribute it keeps is a mold object instead of a frame and creating a frame at run-time
?
pmurias++ m0ld++
19:04 cathyal left
pmurias ruoso: once it's finished, why not? 19:15
ruoso actually looking forward to it ;)
19:15 Limbic_Region joined
ruoso confused by the differences between Block, Routine, Sub and Method 19:19
sometimes it seems that a block doesn't have a signature
only a routine does..
s/Block/Code/
sometimes in the spec it says that every code has a signature...
but what about bare blocks? aren't they Code objects also? 19:20
pugs: say { say "Hello World!" }.WHAT
p6eval pugs: OUTPUT[<SubBlock(<anon>)>␤]
wknight8111 rakudo: say { say "Hello World!" }.WHAT 19:21
p6eval rakudo 29834: OUTPUT[Block␤]
wknight8111 nice
ruoso rakudo: say -> $x { say "Hwllo World!" }.WHAT
p6eval rakudo 29834: OUTPUT[Statement not terminated properly at line 1, near "-> $x { sa"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤]
ruoso pugs: say -> $x { say "Hwllo World!" }.WHAT 19:22
p6eval pugs: OUTPUT[<SubPointy(<anon>)>␤]
ruoso hmm... pugs seems to have two object types for blocks with and without signatures...
TimToady a bare block is a lambda with an implicit sig of <-> $_ = $OUTER::_ or some such
where you can just bind $_ directly to the outer scope if you can prove that it will be called with 0 args 19:23
ruoso that looks... complex...
[particle] timtoady in the (government computer) news: www.gcn.com/online/vol1_no1/46724-1.html
ruoso does that mean that $_ doesn't work like other variables? that would naturally be found in the outer scope? 19:25
I was thinking on the binding process as the initialization of variables in the new scope... and that variable lookup would naturally access the outer scope 19:27
TimToady C
CALLER:: variables must be declared as context vars
$_, $/, and $! are implicitly context vars
ruoso hmm... outer != caller 19:28
TimToady true, but I guess I don' understand what you're asking 19:29
ruoso a bare block doesn't really have a caller, its caller is the routine's caller, right? 19:30
TimToady mygrep { ... }, 1,2,3
mygrep calls the block
and passes an arg which gets bound to $_
so the default doesn't come into play 19:31
19:31 REPLeffect joined
TimToady however, if mygrep called it without an arg, it would bind to outer rather than caller 19:31
if mygrep wanted to examine *your* $_, then it would use $CALLER::_
ruoso thinking 19:32
what about bare blocks as statements?
{ my $a; { my $b; { my $c; say $c; } say $b; } say $a; } 19:33
TimToady they're in void context, so can simply bind to outer outright 19:34
ruoso trying to figure out the better way to implement scopes... 19:35
TimToady but even if the optimizer doesn't see that, a statement-level {...} turns into {...}() anyway
so the default binding occurs
ruoso so which is the actual lookup order? 19:37
19:38 fridim_ left
ruoso it seems that there are two axes in the lookup... one is OUTER, the other is CALLER, but you only look for context variables when traversing the CALLER axis 19:40
TimToady yes, the caller info is normally supplied by the argument, not by CALLER 19:41
19:41 jagggy joined
TimToady but you don't know whether the arg is there till run time 19:41
hence the default to OUTER
again, unless you have knowledge of the context sufficient to prove that no arg will be passed, and then you can simplify 19:42
ruoso so, signature binding affects the OUTER (like if you had an implicit scope before the scope of the actual code, containing the signature variables)
TimToady I wouldn't say that
sig params are just "my" vars to the inside scope
ruoso yeah yeah... you don't need two scopes... you can populate the direct scope of the code about to be run 19:43
I still didn't get how $_ would switch from OUTER to CALLER... 19:44
if the default lookup is in OUTER... 19:45
for @x { mygrep { ... }, 1,2,3 }
TimToady it doesn't have to switch to CALLER 19:46
ruoso how will it find the correct $_/
?
TimToady you didn't reference $_ provided by the for
mygrep will pass 1, then 2, then 3 to the block
just as a normal arg 19:47
ruoso that would be slurped into @_?
TimToady mygrep sees the list in its @_, yes
and probably says for @_ { &block($_) } or some such 19:48
ruoso so for mygrep to declare a new $_ it would have to declare a new signature explicitly? 19:49
TimToady why would mygrep need to declare a new $_? 19:51
it's already a sub, and therefore has its own $_ automatically
which is unused in this case
since the for inside mygrep also is a sub with its own $_ 19:52
ruoso right...
but the OUTER for the block being passed as an argument to mygrep is the scope of 'for @x'
the CALLER is mygrep 19:53
so if I go looking in the OUTER axis before the CALLER axis I'll find the wrong $_
TimToady well, that doesn't happen because OUTER is just a default if mygrep doesn't pass the arg, which it does 19:54
ruoso so that block have an implicit signature that declares $_ for that scope? 19:55
and mygrep sends that as the argument which is then bound to the inner scope...
pmurias yes
ruoso where that signature comes from? 19:56
TimToady a fairy D[D[D[D[D[D[D[D[D[Dgodmother 19:57
yow
that's just what a bare block compiles into by default 19:58
ruoso alright... so a bare block is actually the same as -> $_? {...}
TimToady unless it can be proven that you don't need the argument
<-> $_ = OUTER::<$_> {...} 19:59
iow, -> $_ is rw = OUTER::<$_> {...}
ruoso alright... now I got it... 20:00
so... no blocks without signatures at all..
TimToady unless it can be proven that you don't need the argument
ruoso pugs: { say $_ }.("Hello World!");
p6eval pugs: OUTPUT[Hello World!␤]
TimToady I could say it a few more times if you like :)
ruoso but that as an optimization I think...
I'm trying to deal only with concepts at this point 20:01
TimToady blocks are just lambdas with (potentially) a single argument
note, however, that a block with $^a has an explicit argument 20:02
ruoso sure... that's just a syntatic sugar for -> $^a { ... }
TimToady and is equivalent to -> $a {...}
20:02 wknight8111 left
TimToady give or take a ^ 20:02
we don't actually allow $^a in a sig 20:03
ruoso got one level lower
TimToady you win :)
[particle] looks for turtles 20:04
ruoso pugs: { say $^a; say $a }.("Hello World!");
p6eval pugs: OUTPUT[Hello World!␤Hello World!␤]
TimToady taking the better-is-better approach to dazzling new depths
ruoso is that expected?
TimToady I think it is, which is why I wrote -> $a
the ^ is thrown away after the parameter is generated 20:05
ruoso alright... which means that it's completely invisible for the runtime...
[particle] pugs: { say $a; say $^a }.("Hello World!");
TimToady if we do it that way.
p6eval pugs: OUTPUT[*** ␤ Unexpected ";"␤ expecting "::"␤ Variable "$a" requires predeclaration or explicit package name␤ at /tmp/MklO6z3RJg line 1, column 9␤]
TimToady I could argue it the other way too...
[particle] pugs: { my $a = 'foo'; say $a; say $^a, say $a }.("Hello World!"); 20:06
p6eval pugs: OUTPUT[*** Can't modify constant item: VStr "Hello World!"␤ at /tmp/jIKyvpVZsd line 1, column 3-16␤]
ruoso me too... but I don't think it really matters..
[particle] pugs: { my $a = 'foo'; say $a; say $^a; say $a }.("Hello World!");
p6eval pugs: OUTPUT[*** Can't modify constant item: VStr "Hello World!"␤ at /tmp/E8jCIkralN line 1, column 3-16␤]
TimToady you're basically trying to declare $a two different ways
[particle] yep, i'm trying to break the law 20:07
TimToady the ^ means, declare this above...
[particle] that should be a compile-time error
ruoso yeah... please leave all this magic in the compiler
[particle] even though multiple 'my's are not
TimToady arguably, my $a should be the same $a as the one in -> $a 20:08
by the "my $a; my $a;" rule
[particle] right
but when does it bind?
and what's the value of $a in the block?
ruoso at invocation time?
TimToady parameters are just the first my variables bound in the body, really
[particle] that's how rakudo does it 20:09
TimToady yes, at invocation time, which is why they're formal parameters, after all
ruoso that brings me to the first question... which is the implementation difference between a method and a code object? 20:10
it seems to me that they just have different names
[particle] that would mean my example is equivalent to "my $x = 'Hello, world!'; my $x = 'foo';" and would print "foo\nfoo\nfoo\n"
TimToady biab &
20:11 cathyal joined
[particle] a tricky way of overriding parameters 20:11
ruoso [particle], that would generate a warning... 20:12
[particle] with the double my? yes
TimToady a method is a code object that expects an invocant as its first argument, and the single-dispatch dispatcher can see it because it's marked as a method (subs are ignored by that dispatcher) 20:15
however, once you take a reference to a method, it's just a sub 20:16
though you still have to pass the invocant
that's basically how a dispatcher calls a method
[particle] just a sub, but the single-dispatch dispatcher sees it 20:17
ruoso so it is a regular code with a different name that checks for a mandatory invocant 20:18
TimToady well, not just a sub, in the sense that if you pass a capture to it without an invocant, it might not like it.
right
and it doesn't have a different name 20:19
ruoso name as in type name
TimToady you don't know whether &foo is a method or a sub
ruoso not as in method naem
pugs: class Foo { method bar { say &bar.WHAT } }; Foo.bar;
p6eval pugs: OUTPUT[*** ␤ Unexpected "."␤ expecting "::" or signature value␤ Variable "&bar" requires predeclaration or explicit package name␤ at /tmp/kNSW1Samri line 1, column 34␤]
ruoso pugs: class Foo { method bar { say &bar.WHAT; }; }; Foo.bar;
p6eval pugs: OUTPUT[*** ␤ Unexpected "."␤ expecting "::" or signature value␤ Variable "&bar" requires predeclaration or explicit package name␤ at /tmp/fglPB9EFWL line 1, column 34␤]
ruoso TimToady, actually... &foo; looks up in the Package, and the method is not even there.. 20:20
the method is in the prototype/class 20:21
a method is not visible as a sub...
(at least that's how I've been seeing that for a while now)
TimToady "method bar" is not introducing the symbol to the symbol table early enough there
20:21 Limbic_Region left
TimToady a method must be visible as a sub 20:22
ruoso hmmm... does it?
really?
pmurias so it's both in the class *and* the namespace?
TimToady yes
(if there is a namespace, which there is for named classes)
ruoso pugs: class Foo { method bar { }; }; say &Foo::bar; 20:23
p6eval pugs: OUTPUT[<SubMethod(&bar)>␤]
ruoso hmm... ok.. not too bad... it can be aliased in the package
btw... are subs/methods stored as package variables? 20:24
pmurias ruoso: you gave the Perl6 is just a SMOP talk before?
ruoso pmurias, yes... in PPW in may
TimToady depends on how they're declared, but the default declarator is "our"
ruoso alright... so I can have a single storage for subs, methods and variables 20:25
TimToady that's the plan
pmurias ruoso: any comments/observations based on that?
[particle] just don't call it a glob
ruoso pmurias, yes... the initial jokes are annoying... you can clean that up... 20:26
pmurias, at least it didn't work well for me
[particle], although it's a perfect analogy
TimToady it seems okay to me for methods and subs to share a sigil 20:27
[particle] so it seems. but there's baggage.
pmurias don't we just store them in namespaces/lexical pads with the sigil as part of the key?
TimToady yes, which is why we don't need typeglobs any more 20:28
you can think of Captures as anonymous globs if it makes you happy :)
ruoso so CANDO needs to add '&' to the string before doing the actual lookup
TimToady maybe we should rename them Globs :) 20:29
ruoso: presumably
or another blind hellenic 8th century poet of the same name... 20:30
20:32 wknight8111 joined
ruoso moving '0.4.0 - Lexical Scope / Namespaces.' to the top of the ROADMAP 20:34
TimToady lunch & 20:35
ruoso pmurias, would it be too hard to implement (|$captureobject) in 'use v6' blocks? 20:36
pmurias ruoso: withought any fancy capture merging not very 20:37
ruoso yeah yeah... allowing a single capture object being passed....
pmurias, oh... forget it... I'm confusing things... 20:38
I don't really need it
postcircumfix:<()> have ($code: $actualcapture) as the signature...
pmurias * has 20:39
ruoso placing Signature on top of the roadmap, since that Code has it as an attribute... 20:42
s/that//
20:45 simcop2387 joined
pmurias (possibly bad idea) we can have Signatures as a compile-time only object at first 20:45
20:46 Jedai left
ruoso you mean generating my $foo = $capture[0] in the top of the block? 20:46
20:47 Jedai joined
ruoso might be acceptable... but maybe writing Signature is not that much of a trouble 20:50
ruoso home & 20:54
20:54 ruoso left
pugs_svn r21788 | pmurias++ | [m0ld] 21:03
r21788 | pmurias++ | maps names of registers with initial value to ints
r21788 | pmurias++ | counts the number of those withough
pmurias very little done today and i still haven't finished the **** wi-fi stuff :( 21:08
21:08 pmurias left 21:15 jhorwitz left 21:16 pmichaud left, jfredett left, araujo joined, pjcj joined, jfredett joined, pmichaud joined 21:17 araujo left 21:18 pmichaud left, pmichaud joined 21:19 araujo joined, pmurias joined
pmurias @tell gaal as you might have noticed from the coding style m0ld is my first haskell program, so feel to change it as you deem fit, you can diff the output on the hello world example when refactoring as a half-measure 21:24
lambdabot Consider it noted.
21:24 pmurias left 21:26 pjcj left, jfredett left 21:28 pjcj joined 21:31 cjfields left 21:32 alester is now known as AndyAway 21:33 eternaleye joined 21:34 Lorn left 21:42 jfredett joined 21:45 Blasi joined 21:47 Limbic_Region joined 21:53 hercynium left 21:55 Blasi left
pasteling "rhr" at 65.94.11.172 pasted "pugs build failure r21788" (44 lines, 2.3K) at sial.org/pbot/31801 21:56
22:07 jferrero joined 22:17 Blasi joined 22:25 ruoso joined 22:27 jagggy left 22:34 Blasi left 22:41 aindilis joined
ruoso is there any prior work on a Signature object? 22:42
@tell pmurias I think some other registers are worth being pre-set for mold frames, like the "back" continuation, the "outer" lexical scope... 22:44
lambdabot Consider it noted.
ruoso @tell actually not the "outer", but the "current" lexical scope 22:45
lambdabot Consider it noted.
ruoso @tell pmurias actually not the "outer", but the "current" lexical scope 22:46
lambdabot Consider it noted.
ruoso heh... when someone named "actually" comes in a unexpected message will appea 22:47
s1n moritz_: thanks for checking out my patch
moritz_: btw, is there anything that tracks those karma points?
ruoso pugs: sub bar { say $foo }; my $foo is context; $foo = 'Hello!'; bar(); 23:02
p6eval pugs: OUTPUT[*** ␤ Unexpected " };"␤ expecting "::"␤ Variable "$foo" requires predeclaration or explicit package name␤ at /tmp/86sB6rI5f2 line 1, column 19␤]
23:02 rakudo_svn left
ruoso does that mean that $!, $_ and $/ are special cases of context lookup? 23:05
that seems reasonable, actually... since p6 is strict... 23:06
23:09 pbuetow left 23:14 hercynium joined
ruoso www.perlfoundation.org/perl6/index....ementation 23:17
lambdabot Title: SMOP Lexical Scope Implementation / Perl 6, tinyurl.com/5ebhte
23:31 cognominal_ joined 23:42 Jedai left