Pugs 6.2.9 released | pugscode.org | pugs.kwiki.org | paste: sial.org/pbot/perl6 | www.geeksunite.net
Set by autrijus on 4 August 2005.
brentdax ...that just might be the weirdest thing I've ever seen a Pugs program do. 00:09
Basically, I use an s/// in a while loop to extract two fields from a string. Stringify $0 and mess with the result, and somehow things that depend on...oh, hmm... 00:11
Are the $N variables lexical yet? 00:13
stevan iblech: re: [18:13] <iblech>stevan: class Foo {...}; say Foo.ref; say ::Foo.ref; say Foo.meta.ref # what should these print? 00:39
I am not sure about .ref 00:40
.ref on a class has more relevance in p5 since that is the crux of that object model 00:41
(or lack of an object model)
so I think Foo, ::Foo and Foo.meta should act like all other types
basically whatever Array.ref, ::Array.ref would od
then Foo.meta.ref is just asking Foo's metaclass instance what it's ref is 00:42
so it is not all that different from MetaClass.ref
mugwump So, ::Foo.ref would be some subclass of "Package", presumably?
stevan but to be totally honst, I am making this all up, and you should ask p6l
mugwump: I dont know, I dont think of ::Foo as a reference 00:43
it is an instance of Class
::Foo.isa(Class)
is .ref() really as useful with P6Opaque objects? as it was with Perl5 blessed refs 00:44
I think that is the basic question
my $foo = \::Foo;
maybe then $foo.ref is Class
mugwump well, to me it's asking what the type of something is. Perhaps it would be better called .type
stevan mugwump: ok
then Foo.ref would be Foo?
::Foo.ref would be Class? 00:45
and Foo.meta.ref would be MetaClass?
I think that make some sense
however, Class.isa(Object)
and MetaClass.isa(Object)
so maybe like ::Foo.ref returns a type junction (Object|Class) 00:46
etc
but I am not sure that makes a lot of sense either
iblech: I would run it up the p6l flagpole 00:47
and see what @Larry has to say
ok, movie time, ... later all & 00:48
mugwump waves 00:49
brentdax Is m:c (continue from previous position) implemented? 06:15
autrijus brentdax: no 06:58
write up some tests?
brentdax Hmm, okay. Maybe I can find another way...
autrijus are you using it with pcre?
brentdax No, PGE preferably. I did some checking, and it looks like they changed what I want to :p since A5 was put out--there are some tests in t_disabled, but they crash for seemingly unrelated reasons (pos isn't implemented). 06:59
autrijus okie. 07:01
svnbot6 r6080 | scook0++ | * Unbreak Haddock, using #ifndef and whitespace
r6080 | scook0++ | * Misc. Haddocks and fixes
autrijus funny, we do have pos
Aankhen`` Morning.
autrijus but for match objects
not the string itself
I forgot whether string itself carries pos information anymore 07:02
hey Aankhen``
07:02 ods15_ is now known as ods15
Aankhen`` What's new in Pugs? 07:03
autrijus theology :) 07:04
Aankhen`` Kewl.
autrijus I'm beginning to see the huge gap between static object systems and dynamic ones. 07:05
Aankhen`` Neat!
autrijus ...and, ignoring the impossibility, thinking of ways to unify them. 07:06
(which means more paper reading and prototyping)
Aankhen`` Heh.
autrijus a rich typesystem and a rich metaobject protocol rarely exist together, after all 07:07
you usually have one or the other 07:08
coral hmm 07:09
"There are no languages that have both counters and gender-- if you classify your nouns one way, you don't classify them the other way." 07:11
"English is one of the rare languages that has neither counters nor gendered nouns."
ttp://www.mindspring.com/~kimall/Japanese/numbers.html
autrijus ;)
coral &
autrijus at one end we can restrict all the theology -- I mean MOP -- as read-only 07:12
that is ways to reflect into the runtime, but never changing it
and focus on the typefulness (MMD, Generics, Roles, inferencing) to provide flexibility 07:13
on another end we can do what CLOS does and embrace Apotheosis -- making _everything_ tweakable at runtime, and the compile time typing are merely hints, or assertions. 07:14
coral is there a third route, do neither? 07:15
autrijus I have no idea. I suspect yes.
coral the lack of such strictures serves english well in usage
autrijus but makes it a pain to reason with. 07:16
coral i've begun to discard certain englishisms as impractical 07:18
one thing, two things
zero things
fools' errand
eh, too tired
coral &
stevan morning autrijus, coral 07:37
autrijus: I see you have MOP on the mind :)
it is very addictive
autrijus: not sure if you saw this (use.perl.org/~Stevan/journal/) 07:39
I figured I should try this blog thing a bit 07:40
anyway, time for me to sleep &
autrijus stevan: I had. :) 07:41
journaling++
g'nite stevan!
brentdax If match objects have a pos(), how do I use it? Just do $/.pos?
autrijus $/.from and $/.to 07:42
also all the subobjects too
brentdax Ah, alright...
autrijus $0<foo>[3].from
etc
brentdax Okay, thanks. 07:44
Hmm, looks like :pos is broken anyway. Maybe I can fake it with something along the lines of /^.**{$lastlen}/, though. 07:45
autrijus nod. 07:46
but please write tests :)
for the pcre subset
not rules (the implementation should carry over)
I mean for the m:c and/or m:pos 07:47
and I'm not sure that having the string remembering the pos() is a hot idea after all
but that's the spec, I'll do it
brentdax I wouldn't be surprised if PCRE handles this stuff--I'm just trying to use rules whenever I can, because that's what the final system will use everywhere, so it means less rewriting.
autrijus ah ok. 07:48
rx:P5 will also be supported universally :)
but yeah, future proofing == good
brentdax Heh.
autrijus brentdax++ # pushing the envelope
brentdax bows.
(Says the guy who's implementing one of the most complex procedural/OO languages ever designed in a functional language...) 07:49
autrijus ah, I'm just this coding monkey, you know? :) 07:50
brentdax There's modest, and there's too modest. :^P
autrijus purrs 07:51
brentdax ...it's a sad day in the life of a Perl hacker when he runs out of characters to use as regex delimiters. 07:52
scook0 unicode to the rescue? :-) 07:53
autrijus you can use unicode :)
I recomment U+236A APL FUNCTIONAL SYMBOL COMMA BAR 07:54
s/recomment/recommend/
brentdax Heh.
Sadly, I'm not sure I have a font that'll support it. Guess I'll stick to French quotes or something. 07:55
autrijus bbiab... & 08:08
kgftr|konobi castaway: moo 08:53
castaway woof 08:54
what up? 08:56
kgftr|konobi castaway: not much... when you going to be getting into the UK? 08:59
castaway This is a good question.. according to current plans, the 23rd or so 09:00
(of august natcherly)
brentdax & #sleep, and the mental regrouping that goes with it.
castaway Which reminds me, I wanted to ask if theres any useful bus services around there
We may or may not have a flat by then, depending on how fast things get processed.. 09:02
kgftr|konobi castaway: there's buses every 10 mins or so between central oxford and abingdon during peak times 09:04
castaway right, but they dont actually come past the pentagon?
kgftr|konobi castaway: nope... pentagon is about 5-10 min walk from centre of abingdon 09:05
castaway ah, ok then :)
castaway ponders a bike
kgftr|konobi castaway: you looking to more to oxford rather than abingdon then? 09:06
castaway Nope, abingdon
kgftr|konobi ah... k
castaway but we'll probably be carless for a while
looking at the south corner, hobbs close, etc
kgftr|konobi castaway: 2 secs 09:07
castaway nods
kgftr|konobi castaway: ah yeah... very close
castaway: yer other half got any work sorted yet? 09:08
castaway desert-island.dynodns.net/perl/abin...ental.html (googlemaps++)
Nope, but he did get his Visa issued! So we can start looking now :)
allo nm 09:09
ods15 hello nothingmuch, if you are there. hi
nothingmuch hola 09:11
ods15 hehe
nothingmuch castaway: theorbtwo get a visa? w00t!
castaway yup :)
ods15 lol i just noticed, nothingmuch, you just joined the channel :P 09:12
kgftr|konobi castaway: what sort of work he looking for?
nothingmuch ods15: well, i did say I lived here, didn't I? 09:13
ods15 i joined the channel last night, and saw you were in it, at this point i was active and just figured you were here... didn't notice you JUST joined..
hehe.
castaway kgftr|konobi: Similarly to me, but lower entry level probably, since he has little work experience.. 09:14
nothingmuch ah... I didn't pay attention to the channel last night
castaway Need any junior programmers? :)
nothingmuch and now i'm done doing morning stuff
kgftr|konobi castaway: heh, not in the web dept i'm afraid
castaway darn :) 09:15
morning? I though it was later over there, nm? (11:14 here)
And preferably in the area, of course 09:16
nothingmuch i woke up ~10:00
kgftr|konobi castaway: perl stuff specifically or what?
castaway Yup, perl stuff 09:17
kgftr|konobi hhhmmm... ox.ac.uk may have something... 2 secs
castaway nifty
ods15 so, umm, does perl6 actually work
castaway pugs does, for some definition of work (which changes daily) 09:18
QtPlatypus pugs works.
like castaway said
ods15 pugs are like fleas?
castaway pugs is what this channel is about, see title 09:19
(s/title/topic/
ods15 heh, just noticed, topic says 'Pugs 6.2.9', i thought it said Perl... 09:20
QtPlatypus pugs is an implementation of perl6
ods15 hmm, is this the official implementation of perl6?
kgftr|konobi it's "an" implementation of perl6 09:21
castaway official, no
ods15 didn't know there was several implementations... 09:23
nothingmuch goes to do a favour
kgftr|konobi castaway: www.ox.ac.uk/jobs/
ods15 i always considered much of perl's advantage is that there's a single implementation
nothingmuch ods15: that's both an advantage and a limiting factor 09:24
right now there's a problem: the "official" perl 6 is getting nowhere 09:25
castaway Thanks, will have a look!
nothingmuch pugs, on the other hand, is pretty far along
osfameron is anyone working on a backend targetting mono or jvm?
ods15 sounds like perl6 is analogous to mplayer G2 :)
kgftr|konobi castaway: www.admin.ox.ac.uk/ps/gp/current/http038.shtml - that's in headington (part of oxford) 09:26
ods15 i still don't like the idea of several perl implementations.. it's one of the reasons C is in such poor state...
("The great thing about standards is that there's so many to choose from!") 09:27
nothingmuch ods15: perl 6 is right now being slightly redesigned with this in mind
the garbage collection api is just being discussed on the perl6-language mailing list
castaway Mmm, debian..
kgftr|konobi TIMTOWDI 09:28
nothingmuch there is a relative concensus that the api should be requirement oriented
so that if you clearly state your requirements for where they matter, it doesn't matter what garbage collector you use
ods15 heh. i think... i don't like where this is going...
nothingmuch lots of perl 5 code was written "unportably" in this sense: circular references were weakened, timely destruction was relied upon, and so forth 09:29
in perl 6 you may be running under an embedded environment, where it's more efficient to do some kind of garbage collection
ods15 i like perl as a string parser.. it's very good at that.. however i don't like the idea of people writing big OO projects in it...
nothingmuch and the same code might run on a multiprocessor machine, where you would prefer a multithreaded GC 09:30
ods15: that's what perl 6 is fixing
it's OO model is divine
ods15 GC?
nothingmuch garbage collection
ods15 ah
nothingmuch perl 6 is not just another scripting language
ods15 nothingmuch: then it should not be called perl...
nothingmuch perl is not just a scripting language either
osfameron ods15: perl 5 is not just another scripting language either
nothingmuch but it's harder to see that
jdv79 p5 isn't all that performant by the way when you try to put regexes under pressure 09:31
ods15 i hope perl6 doesn't make the same mistake C++ did
castaway perl isnt either (wait, people already said that ) 09:32
nothingmuch ods15: what is that mistake?
ods15 an infinitely complex language
is not as good as a simple one
nothingmuch wdev.perl.org/perl6/doc/synopsis.html
that's where perl 6 is specced
jdv79 since when was perl ever simple?
nothingmuch it's pretty big and complex
castaway (otoh I agree that perl6 doesnt seem to be very perl-like)
nothingmuch but once you start knowing them, you see that it's very consistent 09:33
ods15 jdv79: hence not being a good pick for OO projects
castaway OO projects? (danger will robinson :)
integral is C++ "big and complex" and hence not a good pick for OO projects too? 8-)
jql perl5 is latin. perl6 is the set of romance languages we have today
QtPlatypus nothingmuch: I still would like to be able to send non portable tuning infomation into the GC.
castaway kgftr|konobi: I like how all their jobs have the same salaray (range :) 09:34
nothingmuch QtPlatypus: in that case you have to introspect the environment, and see what kind of GC you're running under
ods15 integral: yes, exactly
QtPlatypus For example I would like to say, "If I have a geneational GC, I would like it to have 5 generations"
castaway (speaking of C++ anyone care to give me a hand with some?)
ods15 castaway: i know (quite) a bit
nothingmuch but the requirement oriented GC api needs to be 100% portable, since it will probably be used in library code 09:35
ods15 integral: C++ is a horrible language
integral ods15: the original stuff wasn't so bad since there wasn't so much then, but the way it's grown hasn't made it simpler
ods15 i'd hate to say it, but Java and C# are much better. I've never actually used python, but i think it's good as a "project" language too 09:36
nothingmuch java doesn't have closures!
ods15 integral: exactly. they increased complexity instead of reducing it
nothingmuch: bah, i dunno what that means :) 09:37
jql whatcha wanna know about C++?
:)
GeJ regarding the GC API, while I agree that the idea is really interesting, I'm afraid of the problems it could generate. Lets say two modules used in one application that both override the GC settings in an incompatible way.
integral OTOH I'm not sure I completely agree about perl5, the thing I think it's lacking (and p6) fixes is nice easy things like class{} to implement a metamodel
ods15 i have a project in it
nothingmuch ods15: do you know the 'map' function in typical functioanl languages?
ods15 nothingmuch: not really
jql admits a shameful preference for VB.NET over C#.NET
ods15 jql: same shit different flavor :) 09:39
QtPlatypus GeJ: It would depend on how the settings could be scoped.
ods15 i think computing has reached a solid point where.. all programming languages suck. some just suck less.
jql prettier
:)
nothingmuch www.rodadams.net/Perl/S29.html
search for rthe definition of map under there
GeJ QtPlatypus: GC settings would be module-related? That would be nice indeed :)
ods15 maybe we should all just switch to brainfuck
nothingmuch the first argument of map is a function. 09:40
ther rest is a list
the result is a list of elements, with the function applied to every element
ods15 hmm
ah, so, it's umm, nothing
nothingmuch if lisp is nothing it's nothing
ods15 why not just make a silly for :) 09:41
nothingmuch because the function is a parameter
ods15 ... so?
castaway LISP++
nothingmuch with a for loop you can't supply the body of the loop as a parameter
ods15 yes you can
nothingmuch well, not in the languages I know 09:42
ods15 for(i = 0; i < 50; i++) func(arr, i);
where func can be a function pointer...
nothingmuch ook
that's not really what I meant
ofcourse you can make a body that applies a function in a var
but nevermind, i have to go, i'll give you some more fp-fu later 09:43
ods15 ok
integral but you're having to type out the body each time?
ods15 just whats fp-fu?
integral: umm, how is this different from map? i don't understand
QtPlatypus GeJ: Some settings can be lexically scoped. I know some can be applied just to values or collections of values (Such as Timely and Tardyness). Others I think will just be last setting wins.
integral ods15: well with map you've hidden how the iteration works 09:44
ods15 ok, change:
integral ods15: and map can apply to different datastructures too (things that are Functors in haskell)
ods15 for(i = 0; i < 50; i++) arr[i] = func(arr[i]);
integral ok, that's another thing which has a similar type to map 09:45
ods15 integral: explain to me what exactly is the difference between this and map?
integral that does an in place update, map (in perl) returns the concatenation of the list results of the functions 09:46
ods15 it returns.. what?
"@arr" ?
integral in perl map calls the given function once for each element in the input list, and returns a list which consists of all the results of the functions concatenated together 09:47
castaway fp-fu is probably function pointer fu
ods15 this is obviously not valid C, but you get the idea: for(i = 0; i < 50; i++) str += arr[i] = func(arr[i]);
integral castaway: I'd guessed "functional programming"...
ods15 integral: so, umm, it returns arr? 09:48
integral ods15: in perl map is like: my @result; for my $e (@input) { push @result, f($e) }
castaway well I'm not sure where the -fu comes from.. it means 'knowledge' kind of
integral it returns a new list
ods15 integral: ah
i forgot what was the point of this conversation
jql perl6's map is cooler 09:49
ods15 i think i'm just not cut out for this. i like lower level programming more.. (not asm, but not high OO either) 09:50
jql to each his own, as long as it's Perl
ods15 .. C! 09:51
QtPlatypus castaway: It comes from kungfu
castaway Perl!
(wrong channel for that, ods15 :)
ods15 castaway: :D
I like MPlayer BTW, that's my kind of programming... 09:52
jql can picture someone making a C eval grammar for perl6
ods15 bleh
castaway Inline::C you mean?
ods15 lol
what's it based on, libtcc? :)
jql not Inline::C. I mean eval
castaway norra clue 09:53
castaway avoids C like the plague
except when work insists..
jql actually parse a C function into a Perl script, type and all
ods15 avoids the plague
integral C->LLVM->PIL2->LLVM->C :-)
castaway ah.. 09:54
jql make sure to add a ->PMC->Parrot at the end
castaway mebbe theres a Parse::RecDescent for it..
integral heh
castaway but honstly, that'd be a bit daft
integral jql: good thought that :-)
iirc there's some C lib for o'caml
ods15 only in C can you do crap like int c[10]; (!!c)[c] = 1["bla"];
nothingmuch ods15: now in haskell map is nice
it's part of a type class
you can map a tree
and you can map a list
and you can map a moose 09:55
as long as the type class has an instance on said type
ods15 nothingmuch: you got me confused
what are you babbling about
nothingmuch map is a combinator
integral and with generic haskell map and other can be automatically derived from the type definition
ods15 hmm
nothingmuch it takes a function that applies to an element
the function is not concerned with the structure 09:56
nor is the call to map
it's only the definition of the structure that must worry about it
ods15 hmm
castaway maps moose (or meese?)
nothingmuch castaway: the plural of moose is moose
castaway jojo
ods15 deer
castaway sounds like walk_mapping
ods15 so, umm, the struct has to define a "map return and set" value?
could you just tpype this out in your favorite pseudo language? i hate understanding words 09:57
nothingmuch uh, yep
castaway (even if its perl?)
ods15 castaway: yes, even vb if you preffer
just not brainfuck
castaway or Ook!
ods15 MOO 09:58
castaway cant do MOO, only LPC
ods15 there's ofcourse also whitespace...
nothingmuch integral: i forgot what the TC of mappable is... Functor?
ods15 which i still think is better than python... 09:59
castaway whitespace?
(Acme::Bleach?)
ods15 castaway: never seen it?
castaway nope
ods15 a language completely based on space tab and return
integral nothingmuch: yep, Functor 10:00
castaway sounds like Ook! oder bf
s/oder/or/
ods15 ook is identical to brainfuck
whitespace is a completely different dialect
jql space & tab represent the bits, IIRC
space 0, tab 1, or perhaps the other way round 10:01
ods15 have a look at www.99-bottles-of-beer.net
i like that perl won first place in that site...
jql: nah, iirc they do some kind of stack manipulation..
jql I meant for Acme::Bleach 10:02
ods15 oh
jql BF is a turing-type monstrosity
ods15 i dunno what that is
so is whitespace, i think
castaway you use that module in your perl code, and your source code ends up looking like just whitespace
nothingmuch integral: uuh, you take over 10:03
ods15 "bleach" as in, the cleaning product?
nothingmuch fglasgow-exts is not letting me derive Functor
integral nothingmuch: oh, you can't in standard haskell afaik
nothingmuch oh
ods15 what languages is pugs? 10:04
haskell? never heard of it...
castaway yes that product
integral data Maybe a = Nothing | Just a; instance Functor Maybe where { fmap f Nothing = Nothing; fmap f (Just x) = f x }
castaway Its written in Haskell
ods15 integral: was what you typed just now a sentence or code... 10:05
integral ods15: code! :-)
ods15 horrible
QtPlatypus Loose like hascall
castaway runs away at the sight of Haskell
ods15 next thing you'll start using ThisIsAnIterator instead of 'i'...
nothingmuch ods15: huh?
integral underlines the use of "a", "f" and "x" ;-) 10:06
ods15 integral: ok :)
nothingmuch ods15: Maybe x means that the value is either Just x or Nothing
ods15 using more than 2 chars for an 'i' is braindead.. i've seen some people actually do counter and kounter
castaway picky picky
integral data Stream a = MkStream a (Stream a); instance Functor Stream where { fmap f (MkStream x s) = MkStream (f x) (fmap f s) } 10:07
ods15 nothingmuch: i don't get it
nothingmuch so Maybe Int allows you to add an out-of-bounds state to data types
anyway, never mind
ods15 :)
nothingmuch the point is that lets say you have a function that returns a tree
you can map that tree into another 10:08
ods15 thats pretty non specific
nothingmuch where the structure is the same
but the elements are changed by the function that applies to elements
ods15 ok...
nothingmuch the function that applies to elements doesn't know whether what it's being applied to is an element of a tree or a list, or anything
th
the code mapping a structure into another using a function also doesn't need to know about the structure 10:09
or the function
or the elements
(it should probably know of one of these in order to be useful)
integral data Foobar a b = Foo a | Bar b; newtype Bar b a = MkBar a b; instance Functor (Foo a) where { fmap f (Foo x) = Foo x; fmap f (Bar y) = Bar (f y) }; instance Functor (Bar b) where { fmap f (MkBar (Foo x)) = MkBar (Foo $ f x); fmap f (MkBar (Bar y)) = MkBar (Bar y) } # argh 10:11
ods15 screams 10:12
integral hmm, s/MkBar a b/MkBar (Foobar a b)/
ods15 nothingmuch: ok, is a "tree" something the user has defined or is there such a data structure built into the language?
nothingmuch ods15: either or
jql hmm... that code could use some $'s to break up the mind-numbing textyness
nothingmuch i'm not sure if Data.Graph and friends have Functor instances, bu tthey should
at least DAG graphs
ods15 how on earth would 'map' know how to iterate over the tree 10:13
nothingmuch ods15: it's just simple polymorphism
ods15 it transforms into a cat?
nothingmuch nope
an appropriate implementation of 'map' is chosen, WRT the data structures involved 10:14
integral data Tree a = Branch (Tree a) (Tree a) | Leaf a; instance Functor Tree where { fmap f (Leaf x) = Leaf (f x); fmap f (Tree x y) = Tree (fmap f x) (fmap f y) }
ods15 integral: binary tree!
hey, i get it
nothingmuch okay then, now go beyond map 10:15
foldl, foldr
ods15 when you define a thingy, you make a function for mapping, that either returms (or sets) the value, OR iterates over the rest of the .. strcture
yes?
(did i understand right?)
nothingmuch no, it just itertates the structure
integral yes
nothingmuch applying the function to each element
and returning the same 'shape' but with different elements 10:16
ods15 ok, anyway, umm, i've forgotten the point?
nothingmuch the point is that these relate to closures:
higher order functions
and java doesn't have them
so it sucks
ods15 whats closures
nothingmuch okay, now, given map, we can either give it a qualified function 10:17
integral nothingmuch: I'm not entirely convinced by that personally, since everything you can do with closures you can do with objects
nothingmuch or something we just made up
integral: the issue is choices
ods15 also, if i understood correctly, you've introduced the recursion from hell
nothingmuch i interleave functional/object oriented programming in perl, and that's why i like perl
ods15: haskell has tail recursion optimization.
integral ods15: recursion only exists for data structures that are recursive :-)
nothingmuch all control structures are moot 10:18
integral So for a Maybe (which can be Nothing, or a box with a value in it) there is no recursion
nothingmuch there is no 'for', 'while', or anything like that
ods15 integral: will this all work correctly for lists?
nothingmuch since all loops are recursive
QtPlatypus And most of the funtional lanaguages optimize tail recursion.
integral ods15: yes, but those are recursive, so you do get recursion
ods15 ..lists are not recursive (?!)
nothingmuch ods15: lists are recursive
linked lists
integral yes they are: data List a = Tail | Link a (List a) 10:19
ods15 by definition they are not.. trees by definition are, lists are not...
nothingmuch by definition a linked list is recursive
ods15 integral: ugh, please stop typing in haskell, it's worse than brainfuck
integral it's just that the recursion for a list can be done in constant space, but for a tree you can't
nothingmuch ods15: it's actually very readable
castaway thats what you say :)
nothingmuch en.wikipedia.org/wiki/Linked_list
ods15 for(it = l->first; it; it = it->next) whatever(it); // i don't see recursion here 10:20
nothingmuch that's recursion
integral ods15: struct Link { struct Link *next } /* recursion! */
nothingmuch it might not be recursion of the for block
but the structure is recursive
integral it mentions itself which is quite definately recursion :-)
ods15 then i need to redefine recursion...
nothingmuch also, in haskell that'll be:
whatever [] = []
where the empty list returns the empty list 10:21
oh, wait
we are throwing that away
ods15 ??
nothingmuch whatever (x:xs) = (do something to x, and then ) ... whatever(xs);
ods15 integral: ok, but, umm, does map() recurse when iterating over a list or is it smart enough to not do that? 10:22
nothingmuch whatever [] = .... ; # whatever on the empty list
integral whatever a [] = return (); whatever a (x : xs) = do { a; whatever a xs }
nothingmuch ods15: it recurses
it can't not recurse
integral ods15: it does recurse
nothingmuch but it's smart enough not to do it
since there is tail recursion optimization in haskell
ods15 tail recursion?
integral but because you don't need the previous stack frame it can get thrown away (because it's not a stack ;-)
ods15: void f(struct List *l) { ...; f(l->next) } /* here the call to f in f is tail-recursive */
ods15 yeah, i'd hate to see the backtrace of a 6 million element map() :) 10:23
integral none of the local variables or arguments stored in the first f's stack frame are needed during the nested call to f, so it just gets binned
So it's got the same performance as a loop (memory-wise)
ods15 integral: lemme understand map correctly, in more or less pseudo code:
nothingmuch map [] = []
uh, map f [] = []
ods15 nothingmuch: hold on a second...
nothingmuch map f (x:xs) = (f x):map f xs 10:24
integral void map (func_ptr_t f, list_ptr l) { f(l); map(f, l->next) } /* map in C, modulo typedefs */
nothingmuch integral: no, map constructs a result list
integral nothingmuch: erk, true :-)
ods15 hmm 10:25
integral: how does that work in trees though
nothingmuch ods15: it doesn't
integral ods15: it doesn't :-)
nothingmuch there's also a map that works on trees
ods15 ... didn't you just say it does :)
integral To traverse a tree iteratively typically you keep your own stack, right, ods15 ?
nothingmuch well, not 'the' map, 'a' map works on trees
ods15 integral: ok, so i've lost the point again
if map() doesn't work on trees, whats the point! 10:26
integral it does work, it's just a different definition
ods15 just do for(it = l->first; it; it = it->next) whatever(it);
nothingmuch ods15: for some really novel example of higher order functions look in SICP
integral there is one map defined for lists, one for maybes, one for trees
nothingmuch they discuss a wonderful way of calcualting the square root
integral but they can all be called as: fmap f d for any datastructure d supporting fmap
ods15 bah, binary search is good enough for that :P 10:27
integral iirc that's what the SICP implementation uses :-)
nothingmuch binary search does not return the same shape with different elements
oh wait
yes, the square root solution is a binary search... *blush* 10:28
integral maybe a good example is sum, product, etc?
nothingmuch around here: mitpress.mit.edu/sicp/full-text/boo..._sec_1.1.7
integral sum and product are both very similar as loops: my $accumulator = 0; for my $e (@l) { $accumulator = $accumulator + $e } 10:29
nothingmuch yep
integral sub foobar { my ($list, $start, $func) = @_; my $acc = $start; for my $e (@$l) { $acc = $func->($acc, $e) } } # sub sum { my $list = shift; return foobar($list, 0, sub { $_[0] + $_[1] }) }
nothingmuch product l = reduce (+) 1 l 10:30
uh, that's sum
no, that's product
since sum starts with 0
but you get the picture
integral has a small dislike of reduce ;-)
nothingmuch reduce f init (x:xs) = reduce (f init x) xs 10:31
ods15 ..
nothingmuch reduce f init (x:xs) = reduce f (f init x) xs
reduce _ i [] = i
integral: why?
integral nothingmuch: foldl + foldr just make more sense to be as a pair
nothingmuch integral: explainb "to be as a pair" 10:32
do you mean "you just reimplemented folding" ?
because I know i did =)
integral (reduce f (f init x) xs) vs. f x (reduce init xs)
nothingmuch: I mean there's a choice between the two, and reduce's name doesn't say which one like the l/r after fold :-/ 10:33
nothingmuch right
integral hmm, do I mean: f init (reduce x xs)
nothingmuch i agree, but I think that this is side tracking too much from the point that product and sum differ only in the reduction of two values into one value, and the initial value
integral true :-) 10:34
nothingmuch and that the pattern for doing both can be found in a very concise function
ods15: anyway, if you're still slightly interested, SICP has video lectures 10:35
they are a very nice intro to functional programming
swiss.csail.mit.edu/classes/6.001/a...-lectures/ 10:36
ods15 oh lectures, cool. i like lectures. they help me sleep. 10:39
nothingmuch these are not lectures you sleep through =)
ods15 just today i (re)watched some lectures by mike melanson and alex
it's the ONLY time i ever find MPlayer's -speed option useful 10:40
cause alex talks REALLY slow
GeJ Hum, what is Perl6-MetaModel? I'm not sure to get it... If I understand, autrijus is 'porting' it to Haskell so we can play with the S12. But what is the implementation in perl5? A blueprint for Mr. A. ? Is it use-able on a p5 application/script? 10:41
nothingmuch GeJ: it might be usable, but likely inconvenient 10:42
integral GeJ: both, and it can be used by the PIL->P5 runtime
nothingmuch it was a draft, mostly
GeJ oh, ok. thanks 10:44
castaway If I'm doing: strncpy ( strBeg, (char *) strtmp.c_str(), strLen ); .. how should strBeg be declared? 10:50
(C++ junk)
hmm.. char strBeg[strLen] seems to work, but I have no earthly clue why.. ,) 10:53
nothingmuch that declares strBeg as a pointer to a char 10:54
and 'alloca's strLen*(sizeOf char) every time that scope is entered
castaway fine by me as long as it works :) 10:56
if i just "char * strBeg" it seg faults
(theres that elmex again.. he ever talk?) 10:58
nothingmuch castaway: because you haven't allocated anything 11:09
char * strBeg
upon entering the function strBeg contains an undefined value or 0, depending on your compiler
if you then say strBeg = (char *)malloc(n * (sizeOf char)); 11:10
then strBeg points to some area in memory
on the heap
if you say:
char strBeg[strLen]; then strBeg also points to some area in memory
but this time it's on the stack
so when you leave this scope, and enter another, the data may be overwritten 11:11
castaway hmm, so theres anot a way to have it take any length content?
I hate C :) 11:12
nothingmuch uh, to malloc enough
one sec
castaway my confusion is because I have other code which does:
nothingmuch you are trying to strn.... something into strBeg?
castaway ostringstream ostr01 ( timeout );
ostr01 << MisTimeStamp ( sec, 0 );
strncpy ( timeout, (char *) ostr01.str().c_str(), cDb2TimeStampStrLen );
yes
nothingmuch what do you want to do with strBeg later?
castaway there, timeout springs into existance as if by magic :)
nothingmuch okay
do you want to keep 'timeout' and give it to someone else? 11:13
and also - how big can it grow?
if the answers are 'yes' or 'big' then you want to say:
castaway oops, I lied.. timeout is passed in, there..
nothingmuch timeout = (char *)malloc(cDb2TimeStampStrLen * (sizeOf char));
eep
ods15 nothingmuch: i don't get your nick 11:14
nothingmuch ods15: my nickname?
11:14 Yaakov_ is now known as Yaakov
ods15 yeah 11:14
nothingmuch it's just a nick =) 11:15
ods15 Yaakov? are you the Yaakov i know?
ods15 checks
not sure, hostmask is different
castaway anyway, forget the timeout stuff.. the code iterates over the contents of strBeg later, passing it to other thigns and so on 11:17
I guess its fine to size it, if I know the size anyway 11:18
previoud code just did: const char * strBeg = mDataStm.str ();
nothingmuch okay 11:19
Yaakov ods15: Yes.
nothingmuch i think that means that mDataStm.str() had a pointer to space it was supposed to write into
ods15 Yaakov: hi!
Yaakov Hello
castaway I guess.. it used to be an ostrstream, now its an ostringstream, which is causing headaches 11:21
ods15 so, what's haskel implemented in 11:22
nothingmuch ods15: depends 11:23
GHC - the glorious glasgow haskell compiler is implemented in haskell
there's also nhc and hugs, but i don't know what their implemented in
hugs is focused on the interactive environment
ods15 i think a good rule of thumb is not to implement a programming language in a language that can't compile itself...
nothingmuch ods15: ghc can compile haskell to C 11:24
which can be ported to another platform
compiled with a C compiler
resulting in a GHC on that platform
so getting a binary is not that hard
ods15 nothingmuch: but, umm, does that ghc produce valid output?
nothingmuch for a porter
ods15: no, never
ods15 lol
nothingmuch in fact, when you compile haskell code, it's usually just ascii art
ods15 lol? 11:25
nothingmuch seriously though, what kind of question is that?
ods15 nothingmuch: compile a compiler on a platform does not mean it will produce correct output for that platform!
nothingmuch i just said the C output probably needs to be ported to get a binary 11:26
but it's not junk code
ods15 i'm confused..
nothingmuch You won't be, after the next episode of Soap
ods15 soap? 11:27
nothingmuch en.wikipedia.org/wiki/Soap_%28TV_series%29 11:28
GeJ haha...
I almost forgot about that line
thanks nothingmuch
ods15 nothingmuch: so anyway, what i wanted to show you yesterday 11:48
14:48) ods15@linux15:~ $ grep Oded sources/mplayer/main/AUTHORS
Shimon, Oded (ods15) [email@hidden.address]
nothingmuch huh? 11:55
oh
so what does 15 stand for?
castaway theres certainly a lot of 15s in there.. mebbe age? :) 11:56
ods15 no. it's a random number 12:00
after i've used it for some years i found out my dad actually picked it out, if i would've known that i wouldn't have used it
castaway ,) 12:01
ods15 pokes out castaway's other eye
you're supposed to say ' )' now 12:02
castaway ) 12:03
or rather (
or even () ?
ods15 wipes that smile off castaway's face
castaway nice try :) 12:05
ods15 you're supposed to say
:/
ods15 looks at the tumbleweed roll by 12:29
13:13 wilx` is now known as wilx
rafl Fresh pugs packages for Debian: www-user.tu-chemnitz.de/~rafl/Code/Debian/Pugs/ 13:32
stevan ok, normally I wouldnt post links to IRC, but this one is just hilarious 14:18
bink.nu/Article4655.bink
ods15 bink! binky! 14:19
that was an awesom seinfeld episode. even though it wasn't a seinfeld episode.
osfameron stevan: ? 14:22
gaal two things worth mentioning: 14:27
1. it's codenamed "Monad" :)
2. it has $_ 14:28
eg., channel9.msdn.com/wiki/default.aspx...mpleScript
ods15 gaal: shalom 14:31
gaal hi.
Aankhen`` I've changed my mind. I don't want Need For Speed: Most Wanted AND Project Gotham Racing 3. I want NFS:MW AND Project Gotham Racing 3 AND Test Drive Unlimited. 14:37
QtPlatypus guesses that Aankhen`` is a fan of car games. 14:38
Aankhen`` Hrm.
Not quite...
I like the NFS series. NFS: Hot Pursuit 2 in particular. NFS: Underground, the sequel (in name) was disappointing. NFS: Underground 2 was much better, but still not quite HP2. Most Wanted combines the Underground and Hot Pursuit styles, and it's got great graphics. 14:39
Project Gotham Racing 3 has mind-blowing graphics.
Test Drive Unlimited has amazing graphics as well as promising gameplay. 14:40
Khisanth isn't everything suppose to look like a blurr anyway? :) 14:41
Aankhen`` No, durr. :-P 14:42
www.gamespot.com/xbox360/driving/te...ml?page=27 14:43
Going out, BBL. 14:44
iblech autrijus: Hi, PIL2 questions :) 15:30
my $a; BEGIN { $a = 3 }; say $a # PIL2? 15:31
sub foo { my $a; BEGIN { $a = 3 }; say $a } # PIL2?
And WRT your answer to my class Foo {...} question: That'll work :) 15:32
svnbot6 r6081 | iblech++ | PIL2JS: Use real JS "lexicals" for lexicals inside subs. 15:36
r6081 | iblech++ | * sub foo { my $a = 3; return { $a } }; say foo()() works now.
r6081 | iblech++ | * sub foo ($a) { return { $a } }; say foo(3)() works now.
r6081 | iblech++ | * Probably more speed.
integral hopes the last one get a rude error message :) 15:48
iblech It would certainly simplify PIL2JS :)
But in Perl 5, or better perl5, &foo will output 3 on the first invocation and undef later on. 15:49
putter brentdax: my $pos = 0; while 1 { my $m = substr($str,$pos) ~~ /mumble/; $pos = $m.to if $m; ... } # re :continue
integral I suppose the former should give an error too, I'm thinking of what ModPerl::Registry does by wrapping sub{} around code which may contain BEGIN blocks, and to go from working (because it's at file-level) to broken because it's insane would be bad 15:50
putter hmm, or $m.to + 1.
coral: re nouns/gender - that reminded me some written languages use whitespace to break words, in which case you dont need to write the vowels, some use vowels but no whitespace (you incrementally parse it), and some use both. the same language may drift among the three with time. the vowels-no-whitespace need for a preperatory wordbreaking pass was why once the highest praise was "he's so smart, he can read _silently_". 15:56
coral ooh, interesting
putter (everything tweakable at runtime)++ 15:57
:) 15:58
coral agreed
QtPlatypus putter: Curiosuly when we read, we actally read out loud and the suppress our throught movements. With the correct sensors you can actally detect this. 16:02
coral subvocalization
putter pos and the target string should really be accessible during the regexp (perhaps via $/) after (pos...) and perhaps before. during the regexp, the logical place is in the, err, whatever the regexp run state object was called, and could be accessed via $/. pos on string could be used elsewhen as an api, but blech. backwards compatibility. :( last time I looked, seemed need for more speccedness here. 16:05
QtPlatypus: neat. I wonder if it's universal? if one includes outliers, there seems to be a great variety of human cognitive strategies. 16:06
hmm, if /foo/ is "future search", $/ is "present or past search", perhaps Bar.new($str,$extra_cruft) ~~ /foo/ to add data to initialization of new search? 16:09
re C grammar... and with backtracking, you can even parse _un_preprocessed C source (because preprocessor use is so stereotyped). :) but note "C isnt all that simple" caveats like CIL's (written in ML) manju.cs.berkeley.edu/cil/cil017.html manju.cs.berkeley.edu/cil/ 16:16
sili which doc covers p6 references/pointers? 16:18
putter looks somewhat nonlocalized. suggest dumping AES in a directory and grepping. maybe look at the 02's and then the 06's. "reference" is the keyword. 16:25
does the debian distribution of ghc include ghci? I've long been puzzled that the binary ghc builds dont.
(the ones distributed by/in association with ghc) 16:26
oh, and re rules, there is also the (as yet unimplemented) rules-as-multi-subs, to which one could pass arbitrary cruft. 16:30
wee, caught up. modulo some missed days last(?) week.
kolibrie seen stevan 16:35
jabbot kolibrie: stevan was seen 2 hours 16 minutes 26 seconds ago
kolibrie stevan: getting ready to read through the irc logs from yesterday
do you have a diagram/visualization of the whole metamodel? 16:36
velcro \quit
putter brentdax: do you have a wish list for rules support? (I need a "client" to motivate work on rules, lacking stevan++'s capability of working alone for months with all the payoff at the end) 16:39
kolibrie putter: I want to be able to easily extract and/or tag things in documents 16:41
such as dates, names, etc
putter kolibrie: perhaps collect notes as you go? the beginnings of a "metamodel intro/summary" could be useful. both for writing backends, general understanding, and frontends (how do I map my language X's model onto p6). 16:42
kolibrie I've got my paper in front of me.
four red squares so far, labeled: role, class, instance, metamodel
putter kolbrie, so named aliases? / @foo := <mumble> / or are names enough / <mumble> <frotz> /; say $/<mumble>; 16:43
:)
kolibrie I think that names will be enough, but don't know for sure yet
dudley kolibrie: Make sure you're up on your Gnostic metaphysics...
iblech putter: (Weird idea I have had for quite some time now) $some_str.substr(3, 5).tags<some_tag> = "hi"; say $some_str.substr(4, 1).tags<some_tag> # should print hi 16:44
kolibrie dudley: I'm sure I'm behind in that field
dudley I spent way too much time on wikipedia and ended up missing most of the discussion
kolibrie I was $working
putter goes to check CPAN.... very fuzzy recollection of a tagged/attributed text module... 16:45
stevan kolibrie: howdy :) 17:00
putter bah. kolibrie: yes, good idea. definitely need one if doesnt already exist. 17:01
hi stevan. 17:02
stevan hey putter :)
hows rules treating you?
putter bah. ;) I need a "client", someone with real pressing needs to motivate dealing with the cruft involved. 17:03
stevan putter: funny I need to get rid of my $client, but $work would not like that :) 17:04
putter lol
kolibrie stevan: hi! 17:06
stevan hey kolibrie
I am whipping up a 10,000 ft veiw of the metamodel for you
kolibrie awesome! 17:07
it is slow reading
putter ah, $work. I should really write back to a head hunter today. but hunters->interviews->contract negotiations and lawyers... the thought of which... maybe I'll get back to them monday. yeah. monday of some week or other.
stevan kolibrie: to be honest, the JS is the easiest one to read (if you know JS that is)
it is not bootstrapped, so does not deal with the circularity issue
putter: by Christmas ;) 17:08
putter :) better be sooner than that. :(
kolibrie stevan: JS is not my forte
svnbot6 r6082 | iblech++ | * PIL2JS: Support for $CALLER::. 17:11
r6082 | iblech++ | * On subentry, a new pad ({}) is created and pushed on PIL2JS.subpads.
r6082 | iblech++ | * Each var declaration updated the pad.
r6082 | iblech++ | * $CALLER::CALLER::CALLER::foo is "PIL2JS.subpads[-3]["$foo"]" then
r6082 | iblech++ | (with error handling etc. of course).
r6082 | iblech++ | * New test: t/var/caller.t (passes 7/7 on PIL2JS, had to skip
r6082 | iblech++ | two tests on regular Pugs).
kolibrie stevan: so, does the MetaModel work in perl5? I mean, it is useable, or just a reference? 17:12
stevan it is useable
run the tests
kolibrie neato
stevan it needs nothing outside the core
kolibrie ubercool
so I could write all my objects the Perl 6 way? 17:13
stevan kolibrie: you could
but I would not recommend it right now
it still lacks error checking
kolibrie studies the metamodel furiously
stevan in critical parts
however I am planning on making a p5 class generator out of this once current $work project is done 17:14
kolibrie I wrote a class generator
stevan class generators are fun
kolibrie I needed one with a simple interface, and the ones on CPAN just didn't cut it 17:15
stevan perlbot nopaste 17:19
putter autrijus: I assume you are on ll1-discuss? 17:20
pasteling "stevan" at 67.186.136.119 pasted "10,000 ft view of the metamodel v1" (46 lines, 1.5K) at sial.org/pbot/12248 17:21
kolibrie stevan: all in 46 lines!
stevan ASCII art even
kolibrie :)
stevan I am a visual thinker, and it is worth at least 1000 words :P 17:22
kolibrie I'm a visual thinker too 17:23
iblech stevan: You get to Foo from i(Foo) by calling .ref on an instance of Foo, right?
stevan iblech: I see Foo as being really just a proxy to the Metalevel class(Foo) 17:24
the interpreter handles it, but it has no actual concrete form
in the p5 MM it is just a package
and I let the p5 bless magic deal with it 17:25
iblech Ok.
putter so in ruby say, when one adds a method at runtime to an individual object, it creates an anonymous mumbleclass which inherits from the objects current class, and re-classes the object. how would something like that fit in...?
iblech And you get to meta(Foo) by calling i(Foo).meta?
stevan iblech: yes
in the JS metamodel, I actually dealt with Class objects, but that was just because it made the most sense to do so
iblech Ok. 17:26
stevan no packages/bless in JS :)
that is really where the sugar/magic is
in CLOS you do a name lookup
so (find-class 'Foo') or something like that 17:27
to get the class(Foo)
at the hackathon $Larry said he wanted the class to be really a thin layer
which connected the meta and user worlds 17:28
putter 2nd question, class(Foo) is meta-level? not Class instanceof Class, Class instanceof Object, Class(Foo) instanceof Class?
stevan Class isa (Object) yes 17:29
however not in the p5 version
because bootstrapping that is problematic
really Perl6::Class is not even needed
it could be tossed out, except it handles much of the magic
putter how does one then do anonymous classes? 17:30
iblech Next question :) i(Foo) is an instance of Foo. What is meta(Foo) an instance of?
ods15 i(Foo).meta
stevan putter: it is the same as a named class, just you dont know the name
ods15 i dunno
stevan iblech: MetaClass 17:31
putter: at least I think that is how it would work
iblech stevan: And meta(MetaClass) is again an instance of MetaClass, right?
stevan my $foo = class { method bar { "$foo.bar" }}
iblech: yes, that is the cycle
autrijus putter: no, as a matter of fact I'm not. should I? 17:32
stevan MetaClass.isa(Object) as well
autrijus rehi \camels, btw. I learned a lot of ocaml today :)
stevan howdy autrijus
iblech Hi :)
stevan iblech: that is the boostrap which brings the meta-level into the user-level
iblech stevan: Ok. Definitely commit that nopaste :) 17:34
putter autrijus: I failed to find an archive that is still working... and while bursty high traffic, and not always the highest quality, there some current threads on package systems and closures that might be worth at least scanning...
autrijus putter: lists.csail.mit.edu/pipermail/ll-d...hread.html
I recognized Felleisen 17:35
stevan iblech: I will
autrijus looks mildly interesting
putter ah, good. mildly sounds about right. I accumulate them for a few months, and then skim. I've found the highest payoff is when someone good says something you find surprising, and you can go back to them directly and explore. 17:37
ocaml++ With active community and good backend support, is definitely on my short-list of interesting potential backends for pugs. 17:39
svnbot6 r6083 | Stevan++ | Perl6::MetaModel - 10,000 ft. view of MetaModel
autrijus putter: right. ocaml feels, amazingly, very perlish. 17:40
I mean the grab-bag-of-too-powerful-tools mentality 17:41
but it's also strangely fast.
stevan ok, back to $work &
putter &
autrijus conversely, one has to spend lots of time in baby talks and acquire idioms of how to mix those sublanguages together 17:42
but that is also true for perl anyway :)
autrijus backlogs
putter yes. (thanks, I was just now trying to identify what makes me think of something as perl-ish. "grab-bag-of-too-powerful-tools mentality" is really good characterization) 17:43
autrijus iblech: the same thing as for "sub foo { 1 }"
iblech: i.e. values that is part of variable declaration
so you don't allocate undef for them; you directly allocate with value 17:44
iblech Ah, ok, will work. :)
integral has there been an answer to iblech's questions (1530Z) about my $a; BEGIN { $a = 5 } ? 17:45
iblech Yep, scroll 4 lines up :)
brentdax putter: I don't think I'd make a good "client"--I'll be done doing anything really interesting wth the regex engine in a couple days. 17:46
putter re idioms, I would give bodily appendage for "the big book of language idioms". most languages dont even document their own idioms well. so that ends up being the longest and hardest part of learning a language (or spinning it back up after not having used it in a while).
integral blinks 17:47
putter :( snif. ah well. sooo... what'cha building?
autrijus putter: The Big Book == CPAN :)
QtPlatypus putter: I wonder if thats what the whole 'design pattens' movement is trying to do but not realizing it. 17:48
putter :)
brentdax At the moment, a parser fora simpleish markup language.
putter QtPlatypus: yes. and just "lets document our language better / make it easier to learn" making progress from the other, more concrete end. The c2wiki can be fun c2.com/cgi/wiki?PerlLanguage 17:53
autrijus hm, as I'm on Win32, I might as well start drawing some Pugs architecure flowchart.
autrijus conjures up Visio
obra 'afternoon, autrijus
autrijus greetings obra. how is the con?
putter brentdax: ah, neat.
obra the con is quite excellent
The past couple years seem to have focused on "How the hell are we going to make money on open source" 17:54
svnbot6 r6084 | iblech++ | * EOL at EOF.
r6084 | iblech++ | * Perl6-MetaModel: docs/10_000_ft_view.pod: Added putter++'s and my questions
r6084 | iblech++ | and Stevan++'s answers.
putter autrijus: re CPAN, it seems I'm always using non-mainstream modules, and, well, the authors are really happy to hear from someone when I email them bug reports... ;) 17:55
obra This year, people have realized that they're earning money on opensource and the feeling seems to be "Let's talk about some fucking technology for a change"
autrijus ahhh. that is good
I was afraid it will get downhill.
that sounds exciting indeed
putter obra: any tech highlights? 17:56
obra Ruby is the new black.
autrijus and stiff is indeed very lucky. 17:57
putter "the new black"?
autrijus obra: for the longest time I've been saying that Ruby is Perl6 without advertisement :)
obra autrijus: and rails is the obvious killer app 17:58
autrijus: I remember
autrijus yup. so imagine how nice Perl6 would be _with_ the advertisement!
obra putter: an american expression meaning "Is cooler than cool"
also, nobody dislikes the ruby people. 17:59
putter and the ruby C implementation is nicely clean... posible to do mostly automated bulk code transformations to play games with it...
obra, re "cool", ahhhhh, thanks. :)
very friendly community. (having just asked a question on #perl, and one response being an "that's a silly thing to want (because I dont immediately see the need)" (albeit followed by a "perhaps that's not the most helpful resonse to give people...") 18:01
s/one response/the one and only response/ 18:02
nice wiki www.rubygarden.org/ruby blog redhanded.hobix.com/ 18:04
autrijus yeah, the good-vibe thing is certainly an advantage.
yeah, redhanded is amazing. 18:06
it makes me want to start doing web comics. 18:07
putter ruby on p6 should be straightforward. I have bits of grammar and runtime. currently on hold for rules and oo. if anyone else is interested, would be much more fun to do as a group...
;) # re web commics
autrijus putter: OO is the priority and will be resolved in due time
are you going to bootstrap rules in a nonparrot fashion? 18:08
putter ooo, have to catch up on bunny www.frozenreality.co.uk/comic/bunny/
autrijus or by hacking PGE into a better shape?
it's unfortunately that pmichaud was again massively distracted elsewhere.
putter non-parrot. definitely not hacking PGE, except now and then a bit around the edges. though PGE is now working well enough that it can run a grammar for regexp. so one can chuck the whole fake-match-trees-to-bootstrap pain. 18:10
autrijus nod. 18:11
jdv79 geoffb, around? 18:13
putter and with pugs working so much better than it was a few months ago, there's really no reason for it to be other than straightforward. I'm afraid I just a bit burned out on it.
autrijus putter: that's fine... you can write the plan down first
(or find someone to interview you. that always works) 18:14
Maddingue autrijus: not wanting to bother you, but did you see this Module::Install bug : rt.cpan.org/NoAuth/Bug.html?id=13711 ?
putter hmmm, be interviewed... that's a nifty idea... volunteers? ;) 18:15
autrijus Maddingue: no... is that you? 18:16
Maddingue yes
I filled it about 3 weeks ago, but was wondering if you received the mail from RT
autrijus the /Library thing, don't worry 18:17
it's just a #file directive.
I mean #line
Maddingue ok
it looked weird :)
autrijus so, can you try with EUMM 6.17? 18:18
putter re pmichaud, if you give him test cases, fixes can at least sometimes happen quickly...
autrijus or indeed any version prior to 6.30
Maddingue let me try
autrijus please tar the entire dir and mail to me
putter and his fixes have been backported to parrot trunk/, so you can use them even if leo-ctx5 isnt working for you. 18:19
Maddingue ok
jdv79 PGE isn't going to be used now?
autrijus jdv79: er, no, just trying to render it optional.
jdv79 ah
seems to be a popular theme 18:20
putter and also wrap it in p6 helpers for things it doesnt support yet
autrijus jdv79: right... nondependence is indeed one of pugs's themes :) 18:21
Maddingue: also, just in case -- you got a committer invitation mail to svn.openfoundry.org/modinstall/ .
putter a pcre backend provides a stable alternative when pge is having difficulties, and a prototype for backends to other languages (eg p5) which have a regexp library with something like named-subexpressions. second, an entirely p6 regexp engine helps languages (eg javascript) which lack even that, and also allows doing the full regexp spect in which 18:23
Maddingue autrijus: er, thanks :) 18:24
putter regexps interact with code in interesting ways.
putter is just waiting for a :inline adverb to regexps, which allows subsequent code to backtrack back into the regexp. eg, rx:inline/foo/; bar; is rx/foo { bar }/ or something (I always have to recheck which code embedding is which;) 18:26
in a different universe, perl6's design could really be a couple of theses. 18:27
Khisanth in a different universe perl5's core is less hairy :) 18:28
putter :) 18:29
autrijus in a different universe, this sentence yes verb
putter wonders what it would have taken for that to be true... 18:30
;)
years of effort by a refactoring obsessed person with larry's ear and the development of a massive test suite... 18:31
autrijus stevan: hm.
=head2 What about anonymous classes?
They're basically the same as named classes.
stevan: your approach calls for a gensym-like scheme 18:32
integral anonymous stashes?
autrijus where anon classes are named like ANON001 or something
this is popular in languages where you cannot rebind class names
Khisanth is Perl 6 such a language? 18:33
autrijus that is my question.
I have no idea :)
putter though since you can already gut and restuff packages/classes, I'm not sure anything is bought by prohibiting it. 18:34
autrijus whoa, not so fast... 18:35
putter ;)
autrijus class Foo is reopened { ... }
is extending-only
you can't, for example, remove methods that way.
perl5 remains a nominal type system, where all bless() has is a tag that describes the package name. 18:36
I wonder if perl6 is like that too.
putter so you can do things to a package/module (undefine subs) which you can't to role/class? 18:37
integral maybe it's blessed with a reference to the package, not a name of the package?
autrijus integral: that's what my current theology have
integral (autrijus' theology)++ ;-) 18:38
autrijus but then it's not purely nominal anymore
putter ?
autrijus putter: it concerns that, when you do Foo.bless(), does the resulting object contain a symbolic, or hard, refrence to ::Foo. 18:39
putter where the concequence of that indirection is... you could simultaneously reclass all the instances of a class? 18:40
stevan autrijus: I think you cannot rename a class 18:41
autrijus it looks like in the Js world it's not by name, it's by ref
stevan i think that would break tooooo much
autrijus stevan: but... it won't really break if existing objects contains hardlinks to their class 18:42
putter stevan: but then, so much of static oo is just crying out to be broken...
autrijus instead of symbolic links
stevan: am I correct in thinking that Perl6.MetaClass does that?
that is, it does not make use of an extra named-only lookup
stevan one sec $client called 18:43
autrijus whilst in perl5, you use the package stash for that lookup.
sure 18:44
putter one nice thing about the indirection is that, as classes/roles name both sets of behaviors and implementations, one could swap among different sets of behaviors over common implementations. 18:45
whether to allows swaps over implementation, with rep coersion, is a second question.
putter would reaaally like objects to change rep while remaining =:= 18:46
autrijus putter: well, you can swap them anyway by rebinding ::Foo. 18:47
consider.
svnbot6 r6085 | iblech++ | PIL2JS: PIL2JS.js: Made it work with Opera again.
autrijus my $obj = do { my class Foo { ... }; Foo.new };
$obj is of course of class Foo. 18:48
but it can't just contain a name -- unless it also carries a closure scope.
at which time it's too expensive anyway.
putter (aside, for clarity, the object rep change with unchanged =:= was wrt individual objects, unlike the rest of the discussion) re Foo, err, so if a Foo symbol isnt sufficient (need closure too), what's the question again? wether to point directly to the class object or indirect through a rebindable reference ??? 18:51
putter probably didnt want to say "rebindable" there...
coral oo, reclass all instances of a class 18:53
i could use that to make classes read/write
:)
putter re theology, etal, putter notes the existence of pugs.kwiki.org/?Perl6Nomenclature which could be extended... volunteers? ;) 18:54
autrijus putter: whether to point to a class object by name, or by reference.
iblech putter: IIUC, whether to point directly to the class object or indirect through its name
autrijus I was arguing that by-name doesn't work unless all classes can by fully qualified.
integral hmm, there's the option of pointing to the symtab slot, rather than naming it
autrijus I further wonder if it makes sense to talk about anonymous packages, but that's another topic. 18:55
iblech: if I'm not mistaken, the JS version of metamodel is already nameless 18:58
stevan autrijus: I see what you are saying
autrijus: yes, it is, it uses the class(Foo) objects directly
autrijus the 'Foo-0.0.1-jsan:STEVAN' carries no meaning, and the class is not depending on it addressable via 'Foo'
oh.
hm. 18:59
foo.isa('Foo')
stevan autrijus: the ideal would be for instance to hardlink to the Perl6::Class instance
then naming is a non-issue
autrijus yay. good. thanks.
I started out that way, then found that the high-altitude overview doesn't say that :)
stevan autrijus: yes, sorry, that overview was more for the p5 prototype, I should clarify that 19:00
autrijus I can see that only having fully qualified class can simplify stuff
putter use Mumble as Frotz; my $o = ...; $o.isa('Frotz::Zog') ...
autrijus but then you'd need to hoist up every lexical-scoped class by naming each lexical scope with a fully qualified name
integral putter: why the single quotes? Isn't Frotz::Zog an object itself?
autrijus such as Packagename::ANONBLOCK003
which I'm not sure is worth it. 19:01
stevan autrijus: agreed
autrijus yay, thanks for agreement :)
stevan autrijus: I will rework the p5 metamodel to use Class instances
like you said, the JS model already does this
autrijus stevan: oh good. in that case the META hack can go away too
stevan it was just a happy accident that it happened
putter integral: because autrijus's preceeding example had single quotes (I just copied it;)
stevan autrijus: yes
integral oh :-)
autrijus then all three versions will be in perfect alignment :)
integral: the preceding example is js code :) 19:02
integral ah!
autrijus this is truly a multilingual channel :)
stevan autrijus: I recall having some issue with trying to do this in an earlier version
problems with the GC
but I will overcome :)
autrijus mm weakrefs?
inside-outs?
I think inside-outs is designed to solve things like that
stevan autrijus: I think if I anchor something to the symbol table, the rest should not get GC-ed 19:03
what that something is, I am not sure
autrijus looks at Class::Std
"Std is the new Acme!"
putter stevan: (as a complete aside (which I include now solely so I dont forget again)) if at some point in the distant-is-fine future, you could convert one of the perl5/PIL-Run/lib/PIL/Run/Type/*'s to use the mm (and dont even worry about getting it running), I could then do the others... 19:04
stevan putter: does any of this help (svn.openfoundry.org/pugs/perl5/Perl...ontainer/) 19:05
fglock how do I get the "identity" of an object? ".id" is returning undef 19:07
autrijus ?eval class Foo {} Foo.new.id
evalbot6 51
autrijus stevan: hm, object has this Id thing. 19:08
stevan: which the metamodel does not address yet, right?
stevan right
autrijus is it one of its implicit private attribute?
fglock ?eval my $a; $a.id
evalbot6 undef
putter ooo, that's it? psyche.
autrijus fglock: $a does not contain an object 19:09
putter psych, even. not the goddess? princess?
autrijus fglock: you are perhaps looking at container ID.
fglock: I don't think there is an official way to get it right now
nothingmuch feels like such a burnout
autrijus you can compare them with =:=
but that's it
fglock: please p6l if you'd like to get the container id. 19:10
ods15 hi nothingmuch
autrijus (with a use case, preferably)
ods15 nothingmuch: you're not a lot, are you :P
nothingmuch hi ho
nope
i'm nothing much
bwahaha
haha.
ods15 hehe
nothingmuch *cough*
autrijus I'm told that joke is more funny in chinese
Aankhen`` putter: Support for recursive rules is definitely on my wishlist. :-)
stevan autrijus: P6::O could have a private class attribute, and P6::O.CREATE could stash the .next_value into the instance somehow 19:11
nothingmuch goes to fulfill basic human needs such as food and/or higene
autrijus stevan: either that, or in addition to objMeta and objData, we add objId
nothingmuch uh, spelling.
ods15 heh 19:12
stevan autrijus: yes, that would be ideal, so that it won't override any user defined id
autrijus yup. 19:13
stevan ok, on the TODO list: 1) $obj.id 2) remove lookup-class-by-name functionality in favor of hardlinks 19:14
autrijus and 3) move META into an attrib 19:15
stevan: if you hit the GC wall, I highly recommend Class::Std
I've been doing that for my projects for some time now
stevan autrijus: #2 implies #3, so I consider it a subtask :)
fglock I'm longing for "Lazy", so that I can test the Recurrence modules
stevan autrijus: I will look into it
Class::STD that is
autrijus fglock: the new runcore will take care of that
fglock: but OO has priority currently... so another couple weeks 19:16
wow, past 3am. better start journaling
putter Aankhen``: how recursive? Fully left -- rule foo { <foo> <bar> } ? (Is slow ok?) rule foo { x <foo> } should work now. Mutually -- rule foo { x <bar> } rule bar { y <foo> } I'm not sure whether PGE can do this now or not. rules on PCRE wont be able to :( (hmm, or... atleast not my current simple approach -- PCRE needs a total ordering to exist over its named subpatterns), only rules on p6. 19:17
fglock autrijus: I wish I could help,
stevan oooh,... I can do this to fake name based lookup : my $Foo = Perl6::Class->new('Foo', ...); sub ::Foo { $Foo } 19:18
autrijus fglock: oh. but you could... look in S04 (I think, maybe someplace else) for .spec and generators 19:19
fglock: and write tests for them
svnbot6 r6086 | autrijus++ | * add objId as recommended by Stevan to support .id
stevan hey, dont go blaming that on me now :)
autrijus er, but you did say that is the ideal approach :)
fglock: or even better, prototype it in perl5 or perl6 or javascript or pir :) 19:20
stevan you cant prove it, I'll deny it,.. I was never here,.. :P
putter autrijus: how's your clock speed these days. with work and late nights and all. never used to see you online at this local time...
autrijus roflmao
putter: yeah... $work is usually to around dinner localtime
so I resume pugs working pretty late
and well into midnight
fglock Span::* is kind of a prototype for things like 1..Int 19:21
putter aahhhh.
stevan autrijus: funny, I am on the opposite schedule
autrijus fglock: right. but the thing gets interesting when an array has multiples of them.
stevan $work during the day is too difficult (to many $client calls), so I hack pugs
autrijus fglock: suppost @a is 1..Inf 19:22
stevan and work on $work work last at night :)
autrijus then I splice it a 2..10 into position 5
can Span handle that?
1,2,3,4,2,3,4,5,6,7,8,9,10,5,6,7,...
fglock autrijus: no, but you can use a list of Spans: [1..4],[2..10],[5..Inf] - that's how Set::Infinite works 19:24
autrijus fglock: aye, the key is that the "splice" container method 19:25
must be smart enough to handle that.
Aankhen`` putter: Fully left ought to be enough for now. You say it works?
autrijus I'll look at the Span code for guidance.
fglock I could implement it - all I need is a namespace
autrijus sure. Tie::Array::Span?
basically just implement all the methods in the standard perltie 19:26
putter mugwump: re crude_repl.pl and Scriptalicious, I tried installing Scriptalicious from CPAN and got
/usr/bin/perl "-Iblib/arch" "-Iblib/lib" Build.PL Build
Too early to specify a build action 'Build'. Do 'Build Build' instead.
make: *** [Build] Error 9
autrijus actually if you can do that, it may make sense to p5ize it
Aankhen`` Neat!
autrijus because _that_ will become our container for Lazy when we compile p6 to p5.
as an advantage, you can also test it with regular perl5 t/* and perltie.
fglock autrijus: look at Set::Infinite::Functional. However, what you are talking about is an "unordered" set, which is a different thing 19:27
Aankhen`` Hmm.
autrijus hm? I though I was talking about a List.
Aankhen`` Now I need <before> and <after>.
putter fglock: fyi, there is a p6 splice in... src/perl6/Prelude/PIR.pm 19:28
fglock Sure, but Spans are ordered sets - what you need is a bit different - now I got it
putter oh, and if your working in p5, I have one of those too.
autrijus fglock: cool. I want generator lists, methods on them that respects list fusion 19:29
fglock does it have to support things that are not "Int"?
Aankhen`` rule escaped ($char) { <after [<!after <escaped>> \\]> $char } # this ought to match any singly escaped character, right? 19:30
(e.g. "\n" in "foo\n")
fglock I was thinking about something like date(2000-05-10)..date(2005-05-20)
putter Aankhen``: fully left doesnt I believe. you can rewrite it though... sub foo { <foo> bar... } as sub foo { [<bar>...]+ }
err, s/sub/rule/
autrijus fglock: surely it needs to 19:31
fglock: a stream of strings, a stream of objects, etc
putter though of course that can get hairy if foo has additional alternation clauses...
autrijus fglock: it is like spans but also a bit different. 19:32
fglock autrijus: mmm ok. So if it supports splice, I could do (emulate) a splice in a stream, right? 19:33
autrijus riight. 19:34
putter Aankhen``: rules with additional arguments definitely arent implemented. shouldnt that be <after [<!after <escaped '\\'>> \\]> $char 19:35
Aankhen`` Er, right. 19:36
It should.
Left recursion appears to work... but maybe I'm missing something?
I'll nopaste.
putter hmm... \\ <!after <escaped '\\'>> $char 19:38
pasteling "Aankhen``" at 203.101.5.81 pasted "Left recursion?" (2 lines, 62B) at sial.org/pbot/12254
Aankhen`` Wait... dangit.
Ignore that, please.
autrijus ?eval my $p; $p< connection username password > 19:39
evalbot6 [undef, undef, undef]
Aankhen`` putter: Ah, it doesn't appear to work.
Have you heard of Markdown?
putter Aankhen``: paste looks fine. not really left recursive (what I probably incorrectly called "fully left recursive") because of the x. should work. does. (tried r6060 with a fairly recent parrot trunk/ (may or may not be r8730)) 19:41
Markdown? 19:42
Aankhen`` Yeh, that works, but I figured "left recursive" means something like /<foo> x/, rather than /x <foo>/.
daringfireball.net/projects/markdown/ 19:43
putter yes. PGE happily recurses to boom on that.
Aankhen`` Indeed.
Anyway.
putter well, not to boom. gives nice max recursion exceeded error message.
Aankhen`` In the words of the author, Markdown is a text-to-HTML conversion tool.
putter ah. 19:44
wolverian Aankhen``, is there a CPAN module for it? there is one for Textile, which is why I'm using that instead of Markdown.
Aankhen`` wolverian: Not that I know of. :-\
wolverian (Textile seems to be more supported in general, too, maybe because of the module.)
Aankhen``, right. well, the differences aren't that great.
see Textile if you want a module to do that sort of a thing :)
putter best bet, if it's not too difficult, is to rewrite the recursion as a repetition. all other approaches are still vaporware.
Aankhen`` putter: What is of relevance to you and me is that Markdown supports escape sequences. These escape sequences are handled by, in the first parse, replacing all such sequences with MD5'd versions of themselves, and replacing them in the last pass with the escaped characters. 19:45
I want to rewrite Markdown in Perl 6 using recursive patterns rather than the MD5 approach.
It is my dream to someday do that. ;-)
Dang, I think I scared him away. 19:50
putter I see, so there are other backslashes about, but one only wants to apply this processing to things in particular places defined by a larger grammar...? 19:51
:)
Aankhen`` Er, yeah.
I guess.
fglock if I had 'say for 1,2,3,-Inf..0;' it would iterate to 1,2,3,-Inf,-Inf,-Inf,... right? 19:52
autrijus fglock: exactly. 19:53
however!
if you pass it to reverse()
it will magically then iterate 0,1,2,3,...
fglock sure - reverse would use 'pop()'
putter My fuzzy understanding is PGE will have a p5-like restriction that lookbehinds have to be fixed length. So I vaguely expect recursive lookbehinds will be a nono. PCRE has the same limitation. so it looks like that particular approach (nested afters) would have to wait for a p6 engine.
autrijus fglock: yeah 19:54
Aankhen`` Wha?
fglock cool - I'm starting Tie::Array::Span
Aankhen`` I thought patterns are meant to support variable length lookbehinds?
putter Could be. I don't know. Would somewhat restrict implementation options. 19:56
Aankhen`` It would totally suck to not have variable length lookbehinds.
putter PCRE definitely shares p5's fixed length limitation.
Aankhen`` Yup, I know about PCRE.
putter I actually expect there will be multiple engines with different properties. I could be wrong though. 19:57
mauke that's because variable-length look-behind's matching semantics are unclear, at least to me
putter But for any property foo which someone wants, I expect there will be an engine which supports foo.
mauke: hmm, interesting. for example? 19:58
Aankhen`` I suppose.
mauke perl5: "1234x" =~ /(?<=(\d+)(\d+))x/;
what are $1 and $2? 19:59
putter Aankhen``: I expect the standard way to do what you described is ... (pattern-matching-thing-to-munge) { $/[index or name of thing] = munge($/[same]) } ...
mauke possible values: "123","4"; "1","234"; "3","4" 20:00
putter ie, you can modify the strings matched within the regexp.
if one defines lookbehind as lookahead on a reverse, then "1","234" is clearly the right thing. or for ui consistence, one could define a region by the same, and then run the pattern forward, in which case it would be the first. seems more a matter of definition than ambiguity, no? (but I'm not sure if reversability restriction introduces issues) 20:03
s/consistency/ 20:04
things do get odd if :exhaustive has been specified :)
or not really. no different than the issues with lookahead. 20:05
mauke: am I missing something obvious...?
mauke no, I just need a sane definition of how lookbehind is supposed to work 20:06
putter the spec already has a lot of "and subpattern foo is varied first, then subpattern bar" flavor proceedural definition.
ah. yes. 20:07
Aankhen``: while code in regexp remains unsupported, another option is a rule munge_this { ... } rule foo { ... <munge_this> } and then just crawl over the match tree reassembling the string, but for nodes reached via $m<munge_this>, munging it. 20:10
Poorman's :parsetree (which is also currently unimplemented). Just make sure nodes of type x are always refered to via <x>, no aliasing (which doesnt yet work anyway(?)), and crawl the tree top-down. 20:12
That you can do today.
svnbot6 r6087 | iblech++ | PIL2JS: Very minor fixes: .isa and .ref work on Any and added Int and Rat. 20:15
putter The grammar looks just about as it would ideally. One just does the stringification as a separate step. If one wants a match tree with the munged nodes, you can crawl and assemble a new tree of MatchX, a Match alternative, in modules/Grammars (though it still has issues. hmm, and I have a more recent version that hasnt been checked in yet). but I've used this approach, so you could do it now... 20:16
putter notices Aankhen`` has been silent for the last 20 min...
autrijus well, pcre has known-length lookbehind 20:21
which is quite a bit better than fixed-length lookbehind of perl5's.
(?<=a|bc|defg) is allowed in pcre but not perl5. 20:22
mauke (?:(?<=a)|(?<=bc)|(?<=defg))
autrijus hm, true. 20:23
I wonder why p5 doesn't compile this to that though.
maybe because the regex engine is not easily hackable. 20:24
Aankhen`` putter: I was off shooting terrorists. :-)
autrijus journal up. g'nite! 20:34
autrijus waves &
20:34 Maddingue__ is now known as Maddingue
putter goodnight autrijus. interesting. curious mauke. eeep Aankhen``. 20:53
;)
around 9/11, the official us state dept definition of terrorism was, hmm, approximately, "war-like acts by NGO's". ;) probably been changed since. 20:55
Hey, day 180. We're approaching the 1/2 year mark. 21:04
Party? ;) 21:05
Aankhen`` goes to sleep. 21:21
G'night. 21:22
putter & 22:01
fglock how can I call the global 'pop'? I have a method with the same name, and it is calling the method instead 22:25
Khisanth is CORE still around?
fglock no, I get No compatible sub found: &CORE::pop 22:26
wolverian *pop, I assume 22:27
might have to do &*pop
fglock I just renamed my method to _pop for now :( 22:29
brentdax waits for his test document to render yet again... 23:21
svnbot6 r6088 | fglock++ | * new class 'Array::Lazy' - implements "Array" using iterators, so that 23:29
r6088 | fglock++ | you can store a list like "1,50,$obj,1..Inf,10,4" and do splice, pop,
r6088 | fglock++ | shift, etc on it.
wolverian o.O
brentdax (I grabbed a few paragraphs from [[Wikipedia:Hermione Granger]] and translated them into my markup language. Yes, I'm a hopeless geek.) 23:39
Khisanth hmm Hairy Plotter 23:48
ayrnieu mmm slash 23:53