-Ofun: xrl.us/hxhk | pugscode.org | pugs.kwiki.org | paste: paste.lisp.org/new/perl6 or sial.org/pbot/perl6
Set by apple-gunkies on 11 November 2005.
halobA can parrot questions be asked here? 00:04
obra yes, but #parrot on irc.perl.org is better 00:06
audreyt Juerd: no, I will resume my journal today or tomorrow. 00:26
halobA so will parrot have support for ruby? 00:27
audreyt halobA: if people work on it, then sure
halobA: ruby's multiple-backend compiler support is not quite there yet though, so it may be easier to take YARV instructions and translate to Parrot directly 00:28
but I'm not involved in racc or other ruby compilation technologies, so I'm not the most qualified person to answer this 00:29
halobA has anyone gotten parrot running on mac os x?
leo halobA: sure 00:30
since ages ;-)
audreyt leo: hey, thanks for the reply on p6i :)
stevan audreyt: good morning/afternoon/whenever 00:31
leo audreyt: welcome and thanks for the reminder
audreyt stevan: morning it is. saw your checkins :)
was about to go out to pickup my laptop and return ~2.5hr later
stevan ok
audreyt so you no longer crave for sugars in minilang? :) 00:32
stevan be thinking about dispatcher while you wait :)
audreyt okay, will do.
stevan not at all
leo halobA: parrot will support ruby, when someone writes a Ruby -> PIR translator
stevan I am getting the hang of it I think
audreyt: I tried, really tried (ask gaal) to do some Haskell today 00:33
I grok a little more now, ... but not enough to get it to compile & work
audreyt stevan: ooh, post a patch somewhere (or as comment) ? 00:34
clkao audreyt!
did you see the weird parse thungy
stevan audreyt: it was bad,.. i was chasing type signatures,.. 00:35
clkao thingy
stevan I was trying to hack in a has_attr() method for instances
it kept telling me the expected type was STM and the inferred type was Maybe,.. that was as close as I could get 00:36
I svk reverted in anger though,.. so it is no more
clkao not svk's fault that you are in anger?
stevan clkao: no it is not,.. but you have created a wonder stress reliever :)
clkao :P 00:37
audreyt clkao: yes I did
clkao sorted?
audreyt no, not until I got a working laptop back ;)
which I'm going to now
clkao did you mention asomething about 'first thing in the morning'
audreyt yes, they open at 10am 00:38
clkao oh well, it's quite a morning for you :)
audreyt so I will indeed arrive first thing in the morning
clkao alright. audreyt, i will see you in a few days or at most a week
audreyt stevan: I'll think about dispatcher... also has_attr
stevan: meanwhile:
clkao are we nearly there yet
audreyt <darix> the problem with haskell is
<darix> the learning curve is like a mountain in the himalaya ...
<darix> nearly 90degree and close to 8000 m
<darix> but standing up the hill just rocks ;)
bbiab... &
clkao you just need some climbing training
stevan audreyt: yes, I agree :) 00:39
luqui seconded
clkao it's not all that hard, slackerse!
stevan my problem is having the mind-share available for Haskell in my brain
too many other things already occupying space, and much accumulated damage :)
luqui clkao, I thought it was pretty hard, having never been exposed to ML, and never programmed anything real in scheme or lisp 00:40
stevan monads and types, those are the two things I curse at most often when programming haskell :) 00:41
luqui Haskell is like wasabe. It is hard to eat at first, but it will clear out all the garbled nonsense in your sinuses accumulated from other languages.
clkao i did some hardcore stuff in scheme
oh man, i love wasabe
luqui stevan, you... curse... monads?
clkao particularly when you can cut fish properly after some practice :) it tastes even better!
luqui By the time I had any idea what they were, I loved them.
stevan luqui: it's a love/hate thing,.. 00:42
luqui 's knife was too dull. It just squished.
the fish, that is.
stevan, have you used interesting monads yet? 00:43
i.e. things besides IO?
stevan I love the idea,.. but when you throw in static types and unfamilar syntax & control flow, ... I curse them
luqui: no, I probably should experiment on a small side project
luqui: I was fighting with STM today
luqui I actually rather dislike the IO monad
but Maybe is cool, [] is awesome, RWS is pretty useful
stevan will probably stick to meta-models for the time being :) 00:44
luqui mmkay 00:45
luqui just realized that he listed off all the monads in the standard library, with the exception of Cont :-)
drbean What can I look at in pugs to get some practice with monads? 00:46
luqui don't use pugs
stevan luqui: can you explain Monads in 20 words or less?
luqui it's very complicated, and it is not a very good learning tool (IMO) 00:47
stevan in p5-ish terms
luqui drbean, google "all about monads"
that's an exellent tutorial
stevan, hmmm
(there's one)
drbean I have read most of the monad tutorials. I want to try writing or using them.
I was pointed toward Parsec. 00:48
luqui stevan, monads are way to perform sequenced computations
drbean, parsec is a good one 00:49
stevan, that's the best I can come up with
drbean But I was thinking something perl-related would be good.
luqui stevan, do you know how State works? (it's quite simple)
drbean, you can look at Parser.hs
stevan luqui: no, esplain please :)
clkao zzzz
luqui stevan, you can do normal stuff, you can "get" the current state, and you can "put" the current state 00:50
if you "get" the state after you "put" it earlier, it just gives you back what you put there
stevan how is the state stored?
luqui that's not important
(to be honest, it's stored as a function that takes the current state, and returns a value with a new state)
stevan ok 00:51
luqui (but the monad hides that complexity from you)
stevan yes
how does the function maintain state? more magic?
luqui okay, I'll explain with code
stevan :)
luqui State Foo Int (int is the return type, Foo is the state type) is the same as the type Foo -> (Int,Foo) 00:52
It takes a current state and returns a value with a new state
stevan can you show an example of usage?
would you use this for say,.. a counter? 00:53
luqui perhaps
let's write a gcd that counts how many steps it took
stevan simpler than that please
in other words,.. no math ;)
luqui that's about the simplest nontrivial thing I can come up with
stevan what about a counter
luqui stevan, what should we count?
stevan State Int Int 00:54
web page hits,.. I dont care,..
I want to be sure I grok this on the simplest leverl
luqui hmm. okay.
do { ctr <- get; {- do stuff -} put (ctr + 1) } 00:55
er, not quite
stevan Monads have been someting I have only been able to understand in the very abstract,.. and I have trouble bringing them to the level of usefulness
<- is the way to get things out of the monad right?
luqui "the monad"... 00:56
more like "a monad"
stevan yes
sorry,.. :P
luqui get returns a monad.
stevan binding it to ctr?
luqui yep
stevan so get and put are functions related to the State monad 00:57
luqui yes
stevan is making sure he gets all the syntax right in his head
luqui it's tough at first to know when you should use <- and when you should use let
stevan let?
oh,.. nevermind
let x = ... 00:58
luqui yeah
stevan when should you use let vs. <-
luqui you use let on things that don't return monads
let x = 3 + 4
y <- get
(you can also use let on things that do return monads, but then you have a monad in that variable, and you still to bind it to something to use it) 00:59
let's see, I like the list monad
let's use that
stevan ok
luqui here's a function that increments every element in a list using the list monad 01:00
incList list = do { cur <- list; return (cur + 1) }
try that in ghci
stevan so ctr in (your last example) is a monad? or is it the value returned from the monad?
luqui ctr would be an Int, not a monad 01:01
stevan so where is the monad then?
luqui it is returned by get
stevan ok
luqui you can think of <- as a way to get from "m a" to "a"
stevan but not assigned to anything?
luqui that is: foo <- bar 01:02
if bar is "IO Int", then foo will be "Int"
stevan and bar is the monad?
luqui yeah
stevan but in your first example you just did get;,.. where is the monad in that example? 01:03
luqui get :: State s s
get is a monad itself
stevan ok
luqui did you do the list example? 01:04
because we're going to build on it
stevan parse error :)
luqui oh, slam a "let" at the front of that statement
stevan Prelude> incList list = do { cur <- list; return (cur + 1) }
<interactive>:1:13: parse error on input `='
ok,.. its in ghci 01:05
luqui Prelude> incList [1,2,3]
[2,3,4]
as expected
stevan cool
luqui so what the list monad does is it takes one value from the list it's binding to 01:06
and then performs the rest of that computation on the value
the computation must return a list
and then all the results are concatenated together
in the list monad, return x is the same as [x]
that's how it's defined
so, for a more fun example
let incList list = do { cur <- list; [cur + 1, cur + 2] } 01:07
I suppose "incList" is no longer a good name
stevan no,.. it works
now,.. why is this better than just using a function
luqui yeah it does. but incList doesn't describe what it does anymore
because the things you can express would be very complicated in a function 01:08
for example
let addLists as bs = do { a <- as; b <- bs; return (a + b) }
gives you every combination of sums of things from as and things from bs 01:09
it may not be surprising, but list comprehensions are just a little bit of syntactic sugar around the list monad
[ a + b | a <- [1,2,3], b <- [4,5,6] ] is the same as do { a <- [1,2,3]; b <- [4,5,6]; return (a+b) } 01:10
you could think of the Maybe monad as a way to fail a computation and have that failure propagate until the function returns (like the undef thread on p6l ;-) 01:11
stevan :D 01:12
luqui do { a <- Just 4; b <- Just 5; c <- Just 6; return (a + b + c) }
returns Just 15
but:
do { a <- Just 4; b <- Nothing; c <- Just 6; return (a + b + c) }
returns Nothing
because one of the inputs was Nothing (i.e. undef)
Maybe is a nice monad to define. 01:14
Just x >>= f = Just (f x); Nothing >>= f = Nothing; return x = Just x 01:15
that's it :-)
when you bind a Just to a function, you just apply that function. When you bind Nothing to a function, you return Nothing.
and that gives you failure propagatin
stevan nice
luqui any questions? 01:17
stevan not really,.. I am messing around with ghci :) 01:18
luqui loves ghci
luqui wishes perl had a competent interactive shell
stevan I dont really see where these would be that useful outside of Haskell though
luqui right. they are a good fit for Haskell. 01:19
other than the list monad, which kicks amazing ass
stevan I guess I was trying to transpose them to Perl, etc. to grok their usefulness
luqui yeah, I can't really see how that would be done for most of these 01:20
I kind of like the "implicit state object" of the State monad. It would have to be explicit in perl.
but the idea that a binding is a function application is quite powerful 01:21
stevan yes, I like that 01:22
luqui some of my insane junction proposals on p6l used that idea
but they were insane...
stevan wonders where luqui has been keeping his sane proposals ;)
so now,.. STM 01:23
what do you know about it?
luqui very little
stevan is it just a transation State monad?
transactional
luqui looks at the docs to see if he can figure it out
stevan that is what audreyt is using for the instance type in the Object Space 01:24
luqui STM looks like a way to computations over TVars
stevan TVars are? 01:25
luqui shared variables
atomically :: STM a -> IO a
so it's quite similar to IO it seems
stevan I thought IO was for reading and writing files/sockets/etc 01:26
luqui IO is pretty much for "unrevokable actions"
anything you can't undo
such as writing to a shared variable
STM gives you a way to locally undo that... 01:27
stevan hmm
luqui where is audreyt's code 01:28
stevan PIL/Native/*
luqui has trouble understanding what you mean by "instance type"
stevan PIL/Native/Object.hs in particular
is it the core "object instance" in the Object Space and mini-language 01:29
with that we build the class system with 01:30
luqui it looks like STM is just the computational framework in which the object space is executed
stevan what does the => mean in those signatures? 01:31
luqui "then"... kindof
that's the typeclass syntax
stevan ok
luqui do you think you grok that? 01:32
for example: sort :: (Ord a) => [a] -> [a]
stevan I grok more of it now than I did before
luqui "if a can be Ordered, then this function takes a list of as to a list of as"
stevan a being the polymorphic type,.. 01:33
luqui yeah
setAttr :: MonadSTM m => NativeObj -> NativeStr -> Native -> m ()
stevan but in this case,.. it is not totally "free",.. it must be Ord too
luqui right
it must be an "instance" of Ord 01:34
as they say
stevan ok
why is that not something like [ Ord a ] -> [ Ord a ]?
is it just sugar?
luqui setAttr will work for any monad m, as long as MonadSTM m is true; i.e. as long as m can do STM stuff
certainly not just sugar
Ord a represents a "predicate" on tyeps
types
that is, it is either true or false
it is not a type itself 01:35
so for any type a, if Ord a is true, then I can use this function
stevan interesting
luqui reminiscent of theories? ;-)
stevan yes, somewhat,.. I was always looking at theories from the metamodel POV 01:36
but now they actually make more sense,.. from this POV
luqui looks like PIL.Native.Objects uses a lot of fancy machinery, but it's really quite straightforward 01:39
stevan this is what I was fighting with today
I was trying to add a hasAttr function 01:40
luqui what was your plan?
it doesn't look to me like there's any way to do that without changing the NativeObj table
stevan yup, I added o_exists to that 01:41
then tried to create hasAttr 01:42
luqui it's possible that it should actually just be o_fetch :: NativeStr -> STM (Maybe Native)
stevan thats what gaal suggested :)
luqui but whatever, we'll go with o_exists for the sake of discussion
stevan but I wasnt sure if that would step on something audreyt was trying to do
I also added has_attr to PIL.Native.Eval.hs too 01:43
luqui okay, so what was your trouble with hasAttr? 01:44
stevan I could not get the types to all match up,..
luqui how is o_exists typed?
stevan I copied o_fetch's sig 01:45
stevan svk reverted this stuff,.. so he is recalling from memory
luqui NativeStr -> STM Native
or NativeStr -> STM Bool
stevan the first one 01:46
luqui that's most likely the problem
clkao dude, fix the blank-line parse problem please
stevan it was telling me expected: STM, inferred: Maybe
luqui clkao, which?
interestng
too bad you reverted 01:47
stevan luqui: I will try and reconstruct it,.. and commit my mess :)
luqui heh okay
clkao, which is that? 01:48
oh, I already asked that...
clkao i posted earlier.. 01:49
home.clkao.org/~clkao/tmp/test.pl 01:50
luqui works for me
clkao with and without hte first blank line, pugs -CPIL or -CPugs are subtly different
ya, it works. but with the first blank line, everything happens in Test:: namespace 01:51
without it, it's in main::, as expected
luqui investigates 01:52
stevan luqui: I just commited ,.. I think I have re-created the last version I had 01:56
svnbot6 r8310 | stevan++ | PIL.Native.* -> Haskell hurts my brain
stevan ... what svnbot6 said :) 01:57
luqui does that compile by default? 02:00
I mean, PIL.Native.stuff
stevan yes
but with my stuff in it,.. it breaks
luqui by "by default", I mean, should it be compiling when I type "make"? 02:01
because I got a successful compile here
stevan oh
no,.. make pili
luqui mmkay
stevan I think the exists definition is wrong,.. 02:02
it should be member,.. not lookup
luqui almost
stevan but I get "src/PIL/Native/Objects.hs:53:12: Not in scope: `member'"
luqui Map.member? 02:03
stevan checking
same error,.. just Map.member is not in scope
audreyt imports Data.Map as NMap in another module 02:04
luqui ahh
NMap.member?
stevan same error
not in scope
luqui weird
stevan yeah
luqui wonders how lookup is in scope but not member
stevan weirdness is bad for newbies :)
me too :) 02:05
luqui where does he import NMap 02:06
stevan Types.hs
import qualified Data.Map as NMap
luqui Oh! 02:07
Prelude.lookup exists
stevan ah,.. this is a good sign
luqui anyway, try "elem" 02:08
elem key attrs
er, no
isJust (lookup attrs key)
it converts a maybe into a bool 02:09
stevan isJust is not in scope
luqui wait... this is very confusing
oh, sorry, Maybe.isJust (or Data.Maybe.isJust)
it looks like lookup is returning a monad
did you put in the lookup call? 02:10
this might explain it. I was assuming that lookup was there before and therefore correct
stevan no I put in lookup
cause member didnt work 02:11
luqui how do I find the current file in vim?
stevan doesn't use vim,.. I have no idea 02:12
qwr current?
luqui okay. PIL.Native.Coerce
qwr, the one I'm currently looking at
stevan HAH!
luqui I just want it to show me the status line that I get when I first edit a file
stevan import qualified Data.Map as NMap.. then NMap.member works
luqui you want "exists" 02:13
stevan still getting a type error though
luqui to keep with his design
stevan where is exists defined?
luqui PIL.Native.Coerce line 73
qwr luqui: ^G seems to do this
luqui qwr, yep. thanks.
stevan, you will still get a type error though 02:14
stevan luqui: how do I get that exists
luqui what, is it not in scope?
stevan `exists' is applied to too many arguments in the call 02:15
luqui swap the arguments
exists key attrs
n/m
I'm wrong
stevan yeah,.. same error 02:16
luqui but maybe it's wrong about what kind of error it is
oh 02:17
that's a recursive exists call :-)
stevan ok
luqui you probably need PIL.Native.Coerce.exists
either that or change the exists key = do line
to exists' key = do
and change the surrounding reference to exists accordingly 02:18
stevan ok
I will just use PIL.Native.Coerce.exists
expected type: STM t inferred type: Bool
luqui right
you have to change the sig for o_exists
stevan ok,.. so are we closer now? 02:19
luqui yes
it should be o_exists :: STM Bool
stevan compiling .......
luqui you don't return a Native object when you're asking whether something exists
there will still be an error :-)
stevan change line 35 to hasAttr :: MonadSTM m => NativeObj -> NativeStr -> m Bool?? 02:20
luqui that is one thing
but the thing I'm staring at has to do with returning a Bool when you should be returning an STM Bool
in the newObject function
stevan yeah 02:21
luqui know how to fix that?
stevan no idea
luqui well, STM is a monad
how do you put a value in a monad?
stevan I am gonna guess that tvar has something to do with it?
luqui nah. you just need a function that takes a -> m a 02:22
stevan ok
luqui what's that function?
stevan wonders if he should check hoogle
luqui that might be overkill 02:23
okay fine, I give up on the socratic method
it's "return" :-)
stevan please
thanks
luqui I thought "it's one of the two monad primitives" would be giving away too much
stevan return PIL.Native.Coerce.exists attrs key ?
this breaks
luqui return (lookup attrs key) 02:24
if you do a monadic bind in a function, you have to return a monad
lookup just returns a bool
er, exists
s/lookup/exists/g
stevan horray!!!!!!! 02:28
it compiles
luqui cool
stevan and it works too 02:29
luqui coolness
stevan Haskell is not that hard if you have a luqui handy :)
luqui :-p 02:31
that'll be $3.50
stevan I will take it off your room charge from Toronto
:P
luqui hehe 02:32
svnbot6 r8311 | stevan++ | PIL.Native.*
r8311 | stevan++ | - adding has_attr method to the instance type, thanks to
r8311 | stevan++ | luqui++ for all the Haskell/Monad
r8311 | stevan++ | coaching
luqui is off to pay his bills, and then back to work on p6ge 02:33
luqui &
stevan is off to get some celebratory ice cream & 02:37
svnbot6 r8312 | stevan++ | PIL.Native.Bootstrap.pil
r8312 | stevan++ | - added has_attr back into ::Class.BUILD, and added test for it
audreyt stevan++ luqui++ 04:24
obra hey audreyt 04:25
audreyt obra: yo! I'm told my laptop will be ready for me in 5 minutes
hopefully this time they really mean it
sorry I missed sketch 04:26
obra ooh. has it been dead all this time?
audreyt where all this time = 3 days
yeah, been using the backup ibook
obra heh
audreyt which is not ideal for things
obra understood 04:27
"but good for see"
audreyt that might be the case :)
obra I extracted the currentuser stuff for Jifty
Login is just now working in the second app 04:28
audreyt gobby hits darwinports btw
oh cool
"the second app"?
obra Wifty
"not the hiveminder codebase"
audreyt k
obra also, the support for single-use urls for feeds and email auth
probably not necessary for what you're doing, but useful for confirmation mail 04:29
audreyt that sounds useful indeed
5 days to go until 0.00_00_00_01 release?
obra 0.01 ;)
audreyt oh, much more conventional :)
obra and alex got our AHAH support working 04:30
so a form submit can update multiple page regions
audreyt nod
obra just in time for the "AHAH" acronym to come up on microformats
audreyt Asynchronous
..?
HTML and HTTP?
obra yeah 04:31
"AJAX, microformats edition"
audreyt "A-HAH support"
it's not yet too late to rename the toolkit to "use Ahah;" 04:32
use Ahah::Bwahaha;
obra I like jifty :)
audreyt me too :)
ooh, the laptop is ready. I'll bbiab :) 04:34
&
obra later 04:35
luqui ?eval say < < 3 > > 04:42
04:42 evalbot_8307 is now known as evalbot_8312
evalbot_8312 OUTPUT[<3> ] bool::true 04:42
luqui ?eval say < < < 3 > >
evalbot_8312 OUTPUT[<<3> ] bool::true
luqui I find it disturbing that that works
?eval say < < < 3 > >; say "hello";
evalbot_8312 OUTPUT[<<3> hello ] bool::true
luqui how?
audreyt what how? 05:09
luqui the fact that < > balance, but only when you want them to 05:10
audreyt because it's a backtracking parsert?
svnbot6 r8313 | autrijus++ | * minor cleanup to "exists" usage in PIL.Native.Objects
luqui that was my guess... 05:11
audreyt clkao: I don't see a difference between test.pl with and without blank line. 05:12
what did I miss?
they both output "1\n1..0\n"
or was it fixed somehow already?
luqui he says that it compiles in a different namespace
without the blank line it compiles in Main, but with the blank line it compiles in Tes 05:13
t
audreyt oh, "compiles"
that makes more sense. fixing
luqui: so, how's it going for P6GE? 05:14
luqui I just scrapped and restarted 05:15
no more AST
more like Parsec now
audreyt *nod*
ooh, excellent
luqui also I'm building in the possibility of matching against non-text 05:16
I figured I fought hard enough on p6l for that that I should at least support it ;-)
audreyt cool... that's always one of the wins I perceive about parser combinator type stuff 05:17
although there is apparently another approach, more akin to the PGE/TGE plan, in the form of ASF+SDF2 05:18
luqui ? 05:19
audreyt www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/SDF2
luqui reads it twice
audreyt er.
www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ASF
it's declarative, not function based (i.e. not parser combinator) but is interesting neverthelss 05:20
luqui the thing that made me choose parser combinators was the match object stuff
the fact that you can't compile x* into a recursive (x|) 05:21
because the match objects would look different
I'd like to research the SDF some other time
audreyt *nod* and p6rule allows arbitrary callbacks to p6 code 05:23
so you can't be purely declarative anyway
so parser combinators is still the obvious choice
luqui mm hmm 05:24
audreyt also the fact that you can declare a rule without mentioning "rule" -- i.e. define it as a method -- pretty much means that rules are just desugared into parser combinator calls underneath
luqui well... sortof 05:25
that may actually be a suboptimal choice
audreyt (not neccessarily in the atom level)
I don't quite mean that rule {abc} is desugared into
char 'a'; char 'b'; char 'c'
but rather that you can treat it as a method and compose it in your methods 05:26
luqui well, I just don't want to wire it down to a particular implementation strategy
audreyt pretty much the same way that parsec's buildExpressionParser works
cool... anything that works works :)
luqui Pm's uses coroutines, mine uses CPS. So there has to be a compatibility layer.
audreyt *nod*
any reason not to use coros? 05:27
pugs's coro support should be pretty stable at this point
luqui because it's easier for me to think in CPS for some reason
pretty much a choice made by -Ofun
it probably has something to do with the side-effect-free impression that Haskell has made on me 05:28
audreyt cool :) 05:29
also... is pm still going to work on the pge-based minilang parse tree evaluator? 05:30
luqui it sounds like it
audreyt might be interesting to port PIL2 OO minilang to that evaluator
to get some sort of instant portability of metamodel
luqui whoever does that would have to touch PIR, no 05:31
?
audreyt probably not...
luqui doesn't know much about pm's plans
audreyt assuming pm gets an evaluator working, we can just output whatever it's evaluating 05:32
I think the Ann nodes are making pugs slower than needed...
audreyt benchmarks
luqui can you speed things up by strictifying? 05:33
audreyt it's already all strict
and unboxed
luqui hmm
audreyt need benching to be sure
luqui loves the always "use strict"ness of perl 6. I always forget to put that in my perl5 modules 05:45
audreyt clkao: fixing the newline bug now
luqui: export PERL5OPT=-Mstrict
or even better
export PERL5OPT=-MAcme::use::strict::with::pride 05:46
luqui that will only help me forget it
(these are modules that I would CPAN)
audreyt though if your module passes strict always without declaring it 05:48
it doesn't quite hurt that much (still hurts patch makers)
luqui I suppose
gaal morning!
audreyt gaal: hey 05:49
gaal audreyt: hey :) brb # coffee etc. 05:50
sooo, got sillicone? /me backloggeth 05:56
audreyt yup. 06:00
clkao: fixed
fees rather good to finally be able to hack :)
gaal audreyt: I had some monadicity trouble myself, let me nopaste.... 06:01
pasteling "gaal" at 192.115.25.249 pasted "making the exporter more general" (15 lines, 885B) at sial.org/pbot/15055 06:02
gaal this is the last bit of ruleUsePerlPackage 06:03
the idea is that it's all well and good to use unsafeEvalExp to export globals, but other things need to return a Pad
so I want to take each of the exportables by type, and fold their rebinding together into one Stmts list. 06:04
something like... %requested = { SMy => <$a &b @c>, SGlobal => <$d> }; 06:05
audreyt nodnod 06:06
gaal for %requested -> $key, $sym { accumulate map export $key $_ for @$sym }
svnbot6 r8314 | autrijus++ | * trivial patch in Parser.hs - Pos should close over lexical scope on 06:07
r8314 | autrijus++ | beginning of block body, not after the whitespacess
gaal return [mergeStmts] accumlator]
s/]$//
"accumulate" is handwavy; and the present nopaste doesn't compile because of monad level errors. 06:08
any suggestions?
audreyt looking 06:10
so, what monad level problems? 06:12
svnbot6 r8315 | autrijus++ | * fix the "newline causes use '' to belong in different namespaces" 06:13
r8315 | autrijus++ | bug mentioned by clkao; in -C and -B modes pugs inlines all use
r8315 | autrijus++ | statements in the beginning of lines _except_ when it occurs on
r8315 | autrijus++ | the first line, and it forgets to close over the scope in {...}
r8315 | autrijus++ | brackets. Fix both.
gaal 8315 !!!
what a weird bug
audreyt I forgot whose idea it was to do that
it might have been me... or you 06:14
gaal the problem with the nopasted code:
Couldn't match `Exp' against `GenParser Char RuleState Exp' 06:15
in mergeStmts
audreyt that part is easy
return . foldl mergeStmts Noop =<< smapM (rebind hardcodedScopeFixme) name
s/smapM/mapM/
gaal I tried lifting in all sorts of places :) 06:16
audreyt or, more readably
foo <- mapM (rebind hardcodedScopeFixme) names
return $ foldl mergeStmts Noop foo
gaal yeah, that won't work either, sec
darn. it DOES work. 06:17
arrrrghgh! :)
audreyt purrs
do you want me to walk you thru? :)
gaal I think I just forgot to "return" the fold 06:18
audreyt I think so too :)
gaal and was confused by the next error message
audreyt and yes I think the plan is sane
gaal so I started trying other things :(
audreyt the main drawback of monadic code is that error message is hard to read
gaal ok there is one thing I'm not sure about there:
audreyt although I've been told that Helium does it excellently
gaal if i want to export say 3 SMys
is it totally cool to do Stmts (Pad ... A) Stmts (Pad ... B) Stmts (Pad .. C) 06:19
instead of the more succinct
uh,
something else? :)
(Pad A (Pad B (Pad C)))
or something similar 06:20
audreyt Pad (A,B,C) etc
gaal maybe this can be solved simply by having two remind functions
audreyt I think it's totally cool to make it work using whatever
gaal :-)
audreyt and refactor later
(seriously.)
gaal audreyt++ # the pragmatic programmer 06:21
ohhh, good that you mentioned Heluim because I remembered I wanted to ask you about something
tools like buddha or other debuggers, none of them will work with wacky code like pugs'. 06:22
audreyt with hs' in sight, I think that is going to change 06:23
i.e. the main reason the tools doesn't work is that the last std is 98
gaal how to debug pugs? i mean okay, it's great to keep things simple so you never have to single step (huh? in a fp language what does that even mean?)
audreyt if there's a std in 06 that pugs can target against (which is what hs' is), there'd be better tool support
gaal "hs'"? an anti-google name :/
Juerd audreyt: (re journal) Ah, okay, neat :)
audreyt gaal: haskell.galois.com/cgi-bin/haskell-.../trac.cgi/ 06:24
gaal very interesting 06:25
audreyt but to answer your question, I just use ghci really
and call single functions
gaal audreyt: but when checking things in the parser, what can you pass as arguments? 06:26
audreyt gaal: hmm? string for it to parse against?
using runParser 06:27
gaal but what if you want funky things like use, that rely on some Env?
basically: monads help reduce the explicitness of state being carried about 06:28
but that means it's harder to debug because you have to get the state from somewhere...
audreyt nod... and you can conjure up the Env and pass it to runParser
but our Env carries to much mutables and hardrefs, making it hard
gaal re hs' -- interesting that haskell.galois.com/cgi-bin/haskell-...Extensions shows things that GHC doesn't have, I thought it was very innovative 06:29
audreyt which is why the minilang evaluator is much simplified
it is very innovative, but other implementations are also very innovative.
audreyt praises languages that has multiple implementations.
"the official implementation" is overrated
gaal praises innovation (but is scared to consider what *other* new things lambdaheads have invented :) 06:30
audreyt oh, there's one I really really like
repetae.net/john/computer/jhc/jhc-r...class.html 06:31
using "types are values" to reach "dynamic when needed static when possible" 06:32
luqui ?eval {}.perl
06:32 evalbot_8312 is now known as evalbot_8315
evalbot_8315 "sub \{...}" 06:32
luqui isn't that supposed to be a hash?
gaal I almost but not completely have no idea what that means :-)
...but I think I will defer trying to understand it till after I get some code working here 06:33
audreyt luqui: s06
"{...}" is always a block. However, if it consists of a single list,
the first element of which is either a hash or a pair, it is executed
immediately to compose a hash reference.
so I guess we coded to the spec 06:34
luqui I think we made a special case for {}
gaal btw, in Perl 5, is there any difference between 'use 5.6' and 'require 5.6' ?
luqui gaal, the latter is run at runtime
gaal and apart from that?
luqui doesn't think so
audreyt luqui: if it's not in S06... it's not made :)
luqui :-)
luqui will look for the decision and add it if there is one 06:35
audreyt please do. I think {} is hash makes sense
we can always disambig with {;}
gaal luqui: require perl5:DBI oughta work too, right? 06:36
luqui .... probably 06:37
the difference between require and use is touchy
audreyt bbiab
luqui because of the distinction between "modules" (which hold exports) and "packages" that we've been talking about 06:38
gaal well, I want at least to unify the first part of these statements: both use and require should work on the same atoms 06:39
and up to importation+configuration, should have the same syntax
luqui require doesn't, er, didn't import
gaal yes, I know
luqui but if perl5: is just telling it where to look, I think that makes sense
gaal so: version requests, languagespace requests -- these are common to use and require 06:40
audreyt yes... as is authority, version
as well as package name (if kane gets his way, which I reason he might)
luqui thinks that s06 is wrong in its clever wording 06:41
if it were true, then: my @a = {1,2,3,4} should be the same as my @a = {return (1,2,3,4)}.() which is the same as my @a = (1,2,3,4)
when in fact it should be the same as my @a = hash(1,2,3,4)
i.e. a single element
audreyt why would {} autorun? 06:42
{} only autorun on void
@a= is not void
so it will become
luqui see your quote above
gaal "executed immediately"
audreyt so?
it doesn't begin with a hash
neither does it with a pair
so autoexec doesn't happen
luqui sorry
pretend that the first and third of those commas were => 06:43
same issue
audreyt then it becomes
@a = {1=>2, 3=>4}
luqui right
and it is "executed immediately", which is the same as @a = {(1 => 2, 3 => 4)}.()
audreyt then @a contains a single elem
which is a hashref 06:44
no
it is
"executed immediately to compose a hash reference"
which means it's run in Item(Ref<Hash>) context
not the surrounding context
luqui okay, fair enough
I guess the only difference between that and "just" constructing a hash is:
{ a => my $b } 06:45
$b will not leak
?eval {{a => 1}} 06:50
evalbot_8315 Error: unexpected "{" expecting program
luqui ?eval { {a => 1} }
evalbot_8315 {("a" => 1),}
luqui see, that's wrong
?eval { {a => 1} }.perl
evalbot_8315 "sub \{...}"
luqui hmmm.. or.. not 06:51
?eval { say 42 }
evalbot_8315 OUTPUT[42 ] bool::true
luqui ?eval { { say 42 } }
evalbot_8315 OUTPUT[42 ] bool::true
luqui ??
audreyt void context propagates
that's correct.
luqui I didn't know that evalbot ran its expression in void context 06:52
audreyt need explicit "return" iirc.
luqui and then somehow printed the void that's returned...
audreyt mm 06:53
eval("...").perl 06:54
indeed it should be in item context
so that's a bug
svnbot6 r8316 | luqui++ | Scratch. 06:57
r8317 | luqui++ | A bare {} is a hash, not a code.
r8318 | luqui++ | Add half-complete new rule parser.
luqui heh, I guess I meant "half-compiling"
or half-working
certainly not half-complete :-p 06:58
?eval {}.perl
evalbot_8315 "sub \{...}"
audreyt luqui: can we please get a S06 commit on that too :) 06:59
luqui already did
audreyt oh, cool!
luqui++
need another bot to track synopses changes 07:00
or hack multi repo support to svnbot
bbiab 07:01
gaal oh, funny problem: 07:20
./pugs -e '{ use smth; } say "alive"'
this doesn't parse
but if there's a newline after the scope, it does. 07:21
?eval { "significant newlines?" } say "hmm"
07:21 evalbot_8315 is now known as evalbot_8318
evalbot_8318 Error: unexpected "s" expecting term postfix, operator, postfix conditional, postfix loop, postfix iteration, ";" or end of input 07:21
luqui gaal, I actually think that's specified 07:22
gaal makes oneliners weird
luqui put a semicolon after the brace 07:23
gaal though the "fix" from the programmer's pov is to add a semicolon after the scope
heh
luqui the problem we're facing is the fact that you can say { 42 }.do_something
gaal anyway... we have lexical imports now! :-)
luqui gaal++
sweet
gaal i don't handle exported multisubs now though 07:26
can someone explain the '&' hack?
svnbot6 r8319 | gaal++ | imports are lexical now. 07:27
luqui you mean the fact that &&foo represents multi foo?
gaal yeah
luqui no idea
I read that comment and ran away
gaal shouldn't the VCode store that info? 07:28
*doesn't* it? :)
it does
anymoose... now to make imports lexical by default only :-) 07:29
audreyt gaal++ # single-handedly made lexical imports work 07:32
if nothing else, that alone should motivate me to resume journaling
gaal adding variable exports now 07:35
(was surprised to find they weren't there!) 07:36
audreyt meanwhile I'm trying to make sure that pugs compiles on win32 with latest ghc 07:38
and get some profile info out of it
the recent slowdown makes a release a bit difficult
luqui there was a recent slowdown? 07:39
gaal since I started coLinux, I haven't built pugs on win32 fer real :-)
audreyt luqui: yes... I suspect Ann [Prags] but may be caused by something else
luqui the Ann thing
gaal oh, which reminds me, if someone wants a small buildsystem project, turn off Prelude precompilation when building unoptimized 07:40
audreyt: I think introducing Ann is a more likely culprit than Ann [Prags] specifically 07:41
we never insert prag annotations yet
but yeah, expect a slowdown when we do! :-)
gaal eyes chained var declaraions testily 07:43
hey, another monadic Q: look at Parser.hs:673 07:45
there's a let exp' = ...
a bit later there's a exp'' <- exp' 07:46
why go up a monadic level just to go down?
just so you can use "fail" there?
luqui that seems likely
gaal okay, thanks. 07:47
audreyt nod
gaal what's the type of exp', btw? what monad has it entered, Eval? 07:49
webmind hmm
feather had a high load again ?
luqui gaal: it had better be RuleParser 07:50
because you're binding it to exp''
gaal which is of type... Exp? 07:51
luqui uh huh 07:52
but that's not why it has to be RuleParser
gaal yes...
one of its possible values is "return exp" 07:53
um, no that's not a reason to be RuleParser either. 07:54
what is? :)
luqui the fact that exp'' <- exp' is occurring within a RuleParser
gaal "within" as in, the whole function has the signature ......... -> RuleParser foo? 07:55
well, just "RuleParser Exp" in this case
luqui the "whole function" being the one that starts on line 655 in this case
yes
gaal and we can infer that, because that uses "option", yes? 07:56
luqui yep
gaal option :: a -> GenParser tok st a -> GenParser tok st a
luqui type inference++ # nonlocal dwimmery
gaal what's the relation between "GenParser tok st a" and "RuleParser"?
ah
they're synonyms
luqui the latter is probably a synonym for something like the former
gaal src/Pugs/Parser/Types.hs:43, yes 07:57
ctags++
luqui adores ctags
I've used it much in this project
gaal luqui++ # helping me chip away at my ignorance 07:58
luqui taco bell (eww.. but it's the only thing that's open at this time of night) &
gaal um, shouldn't the FIRST hack use a boolean and not an integer, which might in theory wrap around eventually? (vcode2firstBlock) 08:03
audreyt integer is big and won't wraparound
but a boolean should be preferred anyway.
gaal okay, an integer is big and cause needless slowdown on looong running programs :-p 08:04
audreyt right. :)
I think Run.hs always ants to be compiled with optimization 08:05
gaal once native int64s become common this is very unlikely to be a problem :)
audreyt s/ants/wants/
gaal audreyt: because of the prelude?
audreyt yeah
either that, or turn off it during unoptimize... wait, you just said that
gaal tricky
the problem is that folks with "only" 300mb available really need not to precomp 08:06
audreyt the problem is that -CPugs wants to become -CPIL2.Haskell ;)
(which I'm working on)
but yeah... I think have unoptimize to disable precomp with it is the correct workaround for now 08:07
gaal hmmmm Parser:696 - isn't it a bug that the SState case doesn't handle unnestPad ? 08:08
(sorry for all the context switches...)
audreyt a bug 08:10
but I didn't hack in unnestPad in myself... it's a complex kludge :)
infix:<=> shouldn't be a special form 08:11
gaal I wasn't pointing any fingers :)
audreyt I was :) 08:12
gaal lol
audreyt in any case, slapping a unnestpad to it should do
cool, bleadghc compiles pugs fine. 08:13
dduncan quick terminology question
audreyt mm? 08:14
dduncan what's a synonym for 'pure' like in a pure function such as sum(x,y), that's about 10 letters long
what haskell functions have to be when not a monad
audreyt side-effect-free?
gaal unfilthy?
dduncan or tighter
gaal immaculate?
dduncan a function whose results looks only at the arguments, not any globals
gaal, good guess but no
audreyt mathlike? ;) 08:15
gaal dduncan: where is this haskell crossword you're looking at? :)
dduncan or maybe I just mean a function with no side effects
gaal innocent?
azuroth purely functional...?
gaal innocuous-only-spelled-right?
dduncan actually, I'm writing documentation
audreyt dduncan: evaluation-order-independent
gaal tame?
audreyt s/independent/agnostic/
dduncan audreyt, the meaning is right 08:16
audreyt dduncan: I think "free of side effects"
dduncan independent
gaal idempotent?
dduncan sorry
it may start with an 's'
gaal idempotent is even exactly 10 letters.
dduncan okay, I'll look in a book...
audreyt so is "effectfree"
gaal s/s(idempotent)/$1/ ? 08:17
dduncan not a compound word
reading ...
Khisanth you remember the length of the word but not the word itself?!
audreyt I do that all the time...
dduncan that's how my memory works
I'm much better with numbers
audreyt "referentially transparent"? 08:18
gaal I often remember what part of the page (which side too) something was
Khisanth I guess I am more suprised that someone would bother to count the length of words as they read :)
audreyt Khisanth: different brain patterns :)
gaal My only problem is that I often remember wrong :/ 08:19
audreyt i.e. not bothersome at all to me, sometimes
bleadghc on win32 is much faster than I remembered
hopefully it can complete without running out of heap
gaal I set 500m heap nowadays :( 08:20
and that's w/o precompiling Test
audreyt actually I suspect huge numbers of space problem will go away 08:21
if we just replace String with FastPackedString and [] with Seq
the list type is notorious for antisocial heap behaviour 08:22
dduncan I found my answer
"deterministic"
audreyt dduncan: cool!
dduncan that's a function whose answer is dependent only on the arguments, a pure math function 08:23
thanks for trying, anyway
audreyt np... I was reminded briefly of the time when we made hangman.p6 a bot 08:24
it was fun
gaal whee! 08:25
our Test doesn't do unscalar comparison, right? is smth_returning_a_list(), <val1 val2> 08:26
audreyt no it does not 08:27
the usual workaround is to compare .perl
gaal oh right!
cool, thanks
audreyt np:) 08:28
gaal drats, sticking an unnestPad isn't enough because of vcode2firstBlock 08:38
but i think at least i did fix my $foo = our $bar 08:39
at least
svnbot6 r8322 | autrijus++ | * more fixes to get bleadghc to compile pugs 08:46
araujo Hello. 08:47
Anyone knows if there exist a parrot channel?
audreyt yes, irc.perl.org #parrot 08:48
araujo thanks
audreyt np :) 08:51
audreyt watches two insane #haskell people inventing co-evaluation 08:53
spinclad [from 07:39Z] .oO ( oh sure, blame Ann [Prags]! .oO ( who the heck is Ann [Prags]? can somebody introduce me to her? has she been hacking here long? ) ) 08:54
audreyt spinclad: she lives in line 867 Pugs.AST.Internals 08:56
gaal but she's been depressed and hasn't been doing much lately 08:58
audreyt discovers Control.Concurrent.STM.TArray in bleadghc
gaal eeeeep! i think state variables leak
in baaaad ways
audreyt excellent... now we just need a TMap and all container types can be implemented in 0 lines
gaal let me post a demo 08:59
Khisanth 0?
audreyt Khisanth: 0, as in, it's already there 09:00
pasteling "gaal" at 192.115.25.249 pasted "try omitting the nonces on variable names, get different results" (15 lines, 683B) at sial.org/pbot/15058
gaal ...as posted test4 "chained my, state" fails with undef 09:01
if all $a and $bs are renamed to $a and $b...
$b is 44
which means the state isn't lexical 09:02
audreyt mm, can you get it without chained = ? 09:03
gaal let me try{} 09:04
...no. 09:05
this btw is after making this change: 09:07
-unnestPad (Pad SMy lex (Syn "=" [v,Pad SMy lex' (Syn "=" [v',x])])) = Pad SMy lex (Stmts Noop (Pad SMy lex' (Syn "=" [v,(Syn "=" [v',unnestPad x])])))
+unnestPad (Pad scope1 lex (Syn "=" [v,Pad scope2 lex' (Syn "=" [v',x])])) = Pad scope1 lex (Stmts Noop (Pad scope2 lex' (Syn "=" [v,(Syn "=" [v',unnestPad x])])))
(just paramatize over scopes) 09:08
and, well 09:09
return $ unnestPad $ Pad scope lexDiff implicit_first_block
but i don't see how state leaks across scopes at all
bbiab & 09:10
audreyt stevan: closure-based iterator with its own state is the way to go 09:14
I think we can make one trivially (KISS and all that) by introducing a .iterate form 09:16
for seqs
I'll work on it after dinner
araujo thinking if emergin' pugs or not 09:17
audreyt araujo: why not? :) 09:18
but for now, dinner &
Khisanth consumes too much memory! 09:19
araujo audreyt, I do't programm in perl :-/ 09:21
Though i do in Haskel, and that's why i am kind of curious :-)
hah, i also see you have a poem in my native language in Main.hs , pugs++ :-) 09:24
gaal rehi 09:34
wolverian use.perl.org/~luqui/journal/28064 nice post :) 10:04
svnbot6 r8323 | gaal++ | * Pugs.Parser: improve handling of chained declarations with differring scopes 10:27
r8323 | gaal++ | * t/var/chained.t: some tests
r8323 | gaal++ | * t/var/state.t: demonstration that this still isn't perfect
r8324 | Darren_Duncan++ | r1439@Darren-Duncans-Computer: darrenduncan | 2005-12-20 02:43:42 -0800 10:45
r8324 | Darren_Duncan++ | /ext/Rosetta-Incubator : updated SQL/Routine/Language.pod to add start of new DATA TYPES OVERVIEW pod section
clkao err 11:20
runghc: cannot find ghcrunghc: cannot find ghcBuild failed: 256 at util/build_pugs.pl line 86.
gaal clkao: worksfor me, but probably 8321 is the culprit? 11:26
clkao setting proper PATH works. 11:28
was only setting it when running makefile.pl before
gr! 11:29
Setup.lhs: internal error: stg_ap_v_ret Please report this as a bug to [email@hidden.address]
do i need 6.4.1 11:30
gaal last i heard 6.4 was still ok
but 6.4.1 recommended
araujo clkao, where did oyu get that error? 12:00
clkao 641 works fine 12:05
osmewhere running setup.lhs iirc
araujo clkao, I knew that , i was asking about what step of setup.lhs :-) 12:13
clkao configure: Dependency readline-any: using readline-1.0 12:15
Preprocessing library Pugs-6.2.10...
Building Pugs-6.2.10...
Setup.lhs: internal error: stg_ap_v_ret
luckily i have them in my scrollback. hth
araujo clkao, are you using the ghc's cabal? 12:18
6.4?
clkao i have no idea
i upgraded already 12:19
araujo ghc's cabal is kind of buggy.
I recommend you to use the stand-alone cabal version 12:20
gaal audreyt: ping 12:40
clkao audreyt: you sure it's fixed? still seems to be in Test namespace for me 12:52
nvm, it didn't actually compile. syck stuff. but it should tell me compile failed! 12:56
hmm,, did a proper compile, it still thinks i am declaring Test::foo 13:10
gaal whee! this is like learning Haskell! www.matessa.org/~mike/dutil/p1.html 13:17
# message sent to the stars by Encounter 2001
svnbot6 r8325 | kane++ | r576@coke: kane | 2005-12-20 14:17:07 +0100 13:19
r8325 | kane++ | * use constant to check existing files
r8325 | kane++ | * fix a bug in package::installed that returned the list of files as a string
r8325 | kane++ | * add a small JIB::HOWTO
r8325 | kane++ | * add file tests for uninstall
r8325 | kane++ | * add tests for jib::installation::set
r8326 | kane++ | r577@coke: kane | 2005-12-20 14:17:29 +0100
r8326 | kane++ | * add J::I::Set to represent your @INC for installatoins
13:43 hlen_ is now known as hlen
gaal yo stevan_ 14:01
audreyt yo 14:18
clkao: okay, roger, will revert the runghc hack 14:19
stevan_: I think .new_opaque to create a increment state var is the way to go 14:20
nothingmuch obra: ping 14:23
svnbot6 r8327 | autrijus++ | * revert the runghc hack (was there to get bleadghc to compile) 14:25
r8327 | autrijus++ | as it breaks Cabal 1.0 in vanilla GHC. So much for backward
r8327 | autrijus++ | compatibility... here's hope that GHC 6.6 gets released soonish.
obra hi nothingmuch 14:33
audreyt stevan_: dispatcher lands... surprisingly extremely easy -- please sanity check _make_dispatcher_iterator 14:45
stevan_ audreyt: will do 14:49
svnbot6 r8328 | autrijus++ | * PIL.Native.Parser: parsing for negative numbers.
r8329 | autrijus++ | * PIL.Native: [].fetch(4) should return nil not exception
stevan_ gaal: did you see I finally commited some haskell
and it works too :)
audreyt goes reading the /. interview with lwall 14:50
svnbot6 r8330 | autrijus++ | * dispatcher iterator lands -- this makes the object count
r8330 | autrijus++ | after bootstrappign 10 instead of the original 4 -- but hey,
r8330 | autrijus++ | it's a small price to pay to get "next METHOD" support.
r8330 | autrijus++ | Stevan, please sanity check the implementation. :)
stevan_ ooohhh
stevan_ puts all $work aside for the morning ... 14:51
14:51 stevan_ is now known as stevan
audreyt I started with coroutines and state vars and whatnot 14:52
but then switched to the simplest way possible:)
stevan simple is good
audreyt now, why is metamodel.t still failing... 14:53
stevan still?
audreyt it wasn't?
stevan i was working when I last commited (about 13 hours ago)
but I have not checked since
audreyt mmmmm 14:54
stevan I will investigate though
rebuilding pil now
audreyt it's failing with
pil: Map.find: element not in the map
I'll revert to older boot code
stevan eak
I hate that error :P
audreyt has a distinct feeling of hacking BIOS
stevan let me look first
audreyt I'll improve the errmsg then 14:55
stevan that error usually comes up when you ask for a non-existent attribute with get_attr
it was a large part of why I did has_attr :)
audreyt I improved the error 14:56
pil: Cannot find "%!methods" in map: ["$!name","@!MRO","@!superclasses"] 14:58
appears that ::Foo did not copy over %!methods?
stevan it is likely a bug in CREATE 14:59
svnbot6 r8331 | autrijus++ | * improve messages for NativeMap fetch error
stevan I did not test it last night since I didnt have the dispatcher
audreyt the boot was okay before my dispatcher fix. 15:00
stevan yeah
audreyt or rather, s/fix/break/
clkao audreyt: so the blank line issue?
stevan I will look into it
audreyt clkao: give me a minimal test case?
clkao the test.pl is the minimum one
audreyt I got the the test.pl
how do I look at the namespace?
-CJS? 15:01
clkao no
-CPugs
|grep Test::foo
which should never exist
or -CPIL
audreyt it now breaks regardless of whether there's a blank line or not 15:02
which is a definite improvement
...not
clkao oh well
it made my jsperl5 smoke this morning skip most of the tests
audreyt fixing
clkao because it simply doesn't work :P
audreyt fixed
clkao whoot 15:03
audreyt committed 15:05
clkao++ 15:06
clkao how did it all work before?
gaal rehi 15:07
svnbot6 r8332 | autrijus++ | * Pugs.Parser: when leaving a lexical block, restore not only
r8332 | autrijus++ | the lexical pad, but the current package namespace as well,
r8332 | autrijus++ | otherwise we leak over namespaces outside block, as clkao++
r8332 | autrijus++ | had painfully observed...
audreyt I don't know, sheer luck maybe
(inlining of "use" modules only happens for -C and -B)
gaal: hi
gaal i unearthed (or caused :) an error when i tried exporting vars 15:08
svnbot6 r8333 | autrijus++ | * er, uhm, typo.
gaal i think it only trips when you see a "$var is export" so i think i'll commit 15:09
is there a way to track "Prelude.head: empty list" errors?
audreyt yes... redefine head ;)
import Prelude hiding (head)
import MyHead (head)
but that doesn't help the general case 15:10
which is to replace head calls with an assertionor trace
gaal it never ceases to surprise me how far haskell has gone with so little in the way of standard debugging tools :)
audreyt I think you can search and replace all calsl of 15:11
head x
into
assert (not $ null x) head x
which will give you the error location
you can even do a #define for it.
and put -cpp on the pragma line
gaal nods 15:12
audreyt gaal: indeed... but then, haskell lacks most of enbugging features as well
so it all balances out
gaal that's why it's amazing
in this case though i'da wanted something replacing error with error-with-position
"assert" shows a stacktrace? 15:13
clkao can we steal the non-enbugging feature ?
audreyt gaal: no, only the erorr site 15:14
gaal: depth-1-stack trace
obra 'morning
audreyt if you will
gaal: I've talked with JaffaCake on a potential stack tracing assertion using repeated catch/throw (which will be even easier with GHC RTS support for delimited continuations) but I lack the tuits to code it up
gaal eep, one of the recent commits tripped a rebuild. wish those were faster :( 15:16
stevan: re:hacking - yay :) 15:17
clkao audreyt: still the same :/
no wait, compile failed
audreyt clkao: I united jsperl5 15:18
with perl5
clkao whoot!
audreyt how do I test it? 15:19
clkao can you make try { use perl5:foo } non fatal?
audreyt no, you need a require
clkao audreyt: t/unspecced/p5/return.t
audreyt clkao: how do I run it? 15:20
clkao get my javascripit.pm from home.clkao.org/~clkao/jspm
audreyt gah, why not commit it
clkao ./runjs --run=jspm --perl5 ../../t/unspeccted/p5/return.t
hopefully it will be on cpan soon 15:21
audreyt JavaScript.xs:8:22: jsdbgapi.h: No such file or directory
I do have spidermonkey
what gives?
clkao locate jsdbgapi
you should have that from mozilla
audreyt yup 15:22
clkao set JS_INC to that directory
audreyt I think you should ship it with you
makes no sense to require moz install
clkao *nod*
that's why it's not released yet. still some crap
audreyt oh well. 15:23
clkao *** Wasn't able to find 'Syck_stub.o', aborting... 15:24
gr!
obra That's syck. 15:25
audreyt clkao: did you clean up your dist/ ?
hmm, the BACKEND fix doesn't really work.
clkao no, i just killed that file.. make should be able to create it
audreyt aha, that's because runjs pretends it's compiliing to PIL not to JS 15:26
as far as the parser is concerned
it's messy... I'll figure it out tomorrow
need to sleep
clkao it's early! 15:27
audreyt no it's not... I'm still in australia time
clkao alright. catch you tomorrow then.
hotspring countdown
i am going to hotspring directly from airport
kane-xs clkao+- # good choice, but i'm jealous ;( 15:28
stevan audreyt: I forgot the &redo.() in CREATE :) 15:30
however, I found a very nice debugging technique... "---------------------".trace() adds nice seperators between other trace output :) 15:31
audreyt excellent :)
stevan once pugs finishes recompiling I will test metamodel.t 15:34
audreyt I wonder why you'd need pugs instead of (say) pil :)
i.e. "make pil" should be enough for metamodel.t
stevan Test::PIL uses pugs 15:35
stevan ponders re-writing it in p5
audreyt nah... it will be compiled to much faster minilang soon :)
stevan :)
audreyt I do plan to optimize the hell out of minilang :)
stevan purity++
hey,.. didnt chromatic say he wanted to write a PIL optimizer while we were in toronto? 15:36
audreyt :))
he probably did
stevan delegation++ ;)
audreyt cool ;)
stevan I will ask him if he is still interested
audreyt yay. shower, brb & 15:37
nothingmuch audreyt: isn't au time == tw time? 15:48
clkao 2 hour differences iirc 15:49
nothingmuch i thought they were ~~ same longitude
reverie.aaeol.ca/about/timezone.jpg 15:50
oh, i guess it depends which australia
which part
audreyt 3hr tzdiff 15:52
stevan: so, aside from autoboxing, what else is there to do? container types? types as values? SigList and ArgList objects? 15:54
stevan audreyt: I will finish the metamodel (minus Roles) and test the hell out of it today 15:55
audreyt woot
stevan then add roles
audreyt Roles will rock too after that
okay, I'll handle the compilation and boxing part
gaal audreyt, stevan, didn't you want to change the fetch/store interface to do Maybe?
to fix the nil semipredicate problem
stevan defers to audreyt on this one 15:56
nothingmuch i want pugs =(
ENOTUITS
audreyt gaal: which semipredicate problem again? :)
gaal nothingmuch: just make sure you're available on Feb :)
nothingmuch yeah, that's no problem
i already cleared up time
gaal audreyt: o_fetch can return "nil"
but then you can't tell if an attrib exists or is set to "nil" 15:57
you have to call has_attrib first
stevan gaal: right now get_attr will die
audreyt and the alternative is..?
I think in minilang, exception handling is not needed 15:58
gaal to return a Maybe Native (I think it was) and have the getter throw a detailed error
OK
audreyt we already raise a sorta detailed error now
gaal darn, I did the head-replacement operation
and the problem is not in Parser.hs
:-((
audreyt :( try headhunting elsewhere then
I need to doze off now... good night
gaal bye 15:59
audreyt good luck!
gaal thanks :)
stevan audreyt: once we have roles, I think the next step is the container types 16:00
audreyt loves the mdo notation 16:25
stevan mdo? 16:26
PerlJam method destruction order? ;) 16:28
stevan I was thinking maybe Microsoft Data Objects 16:29
PerlJam The thing about context is that you need to have enough of it for stuff to make sense.
audreyt stevan: you are going to like this 16:30
*PIL> eval "::Bit.add_method('foo', ->{3}); true.foo"
3
stevan boxing!
auto-boxing?
theorbtwo audrey: does it add the method lexically? dynamically? globally? 16:31
stevan thought audreyt was going to sleep?
theorbtwo Congrats on the great renaming, BTW.
audreyt theorbtwo: globally. you can temporize it too 16:32
also you can dynamically rebind ::Bit
and the autobox will use the lexical ::Bit as class
_metaperl stevan: ping?
audreyt thanks re congrats :)
stevan _metaperl: pong
integral mdo with or without side effects? :)
audreyt stevan: yes, full autoboxing with no strings attached
stevan audreyt++ # horray
audreyt integral: with sideeffects 16:33
bootstrapClass x = mdo
cls <- newObject cls $ mkClassMethods [("add_method", addMethod)]
svnbot6 r8334 | autrijus++ | * autoboxing arrives to PIL.Native.*:
r8334 | autrijus++ | ::Bit.add_method('foo', ->{3});
r8334 | autrijus++ | true.foo; # 3
r8334 | autrijus++ | Currently only Bit (also it doesn't reuse autoboxed objects),
r8334 | autrijus++ | but the rest is just filling out the details in PIL.Native.Eval's
r8334 | autrijus++ | bootstrapClass and PIL.Native.Objects's Boxable types -- helps welcome!
r8335 | autrijus++ | * redundant char
stevan is still trying to figure out what mdo is
audreyt namely, using the lhs of a <- in the rhs of that <-
integral wow. that's very, very, very cool
audreyt stevan: it's like the "do" notation but gets you value recusion
stevan ah
audreyt so you can use something to define itself 16:34
which is why it's just one line to complete metamorphisis
gaal what does "Native" refer to btw?
PerlJam finally switches to a haskell context so that things make sense
audreyt no intermediate class-without-a-class
gaal: it refers to "something that is not civilized^Wmetamodelled" 16:35
gaal well, nativity also means pertinent to birth :-)
audreyt which fits the gnosis theme :) 16:36
integral: if you got tuits, maybe tidy up the Boxable code and create default ::Bit ::Num etc using the boilderplace in PIL.Native.Eval?
once we get that we can autobox everything :)
in any case... have fun, I'll conclude this committing-in-my-sleep session :) 16:37
audreyt waves & 16:38
gaal hmm how do i express a pattern match in a "when" condition?
when (isExport && lhs ~~ (VStr x))
I know I can case, but don't wanna
audreyt easiest is to derive isVStr
DrIFT can do that for you
but you can define it yourself
isVStr (VStr _) = True -- etc 16:39
gaal cool, thanks
audreyt np. :)
really &
18:06 evalbot_8318 is now known as evalbot_8335
nothingmuch stevan: ping 18:11
?eval say "redhat-- " for 1 ...; 18:13
evalbot_8335 pugs: out of memory (requested 1048576 bytes)
nothingmuch =(
18:35 kakos|away is now known as kakos
svnbot6 r8336 | stevan++ | PIL/Native/Bootstrap.pil 20:44
r8336 | stevan++ | - simplified bootstrapping (much less meta-circularity issues
r8336 | stevan++ | in the mini-language)
r8336 | stevan++ | - added ::Object.isa and .can
r8336 | stevan++ | - this file is 99% complete, we still need ::Package.FETCH &
r8336 | stevan++ | .STORE (and the overriden versions for ::Class), but those
r8336 | stevan++ | can come later on
r8336 | stevan++ | - added many new tests as well (see t/pil/*)
gaal hmm. variable exportation will be harder than I thought, because the actual object is only created in Eval (reducePad). 21:16
audreyt: I'll have to pick your brains about this, unfortunately tomorrow's a longish $work day 21:17
one ugly way would be to unsafeEvalExp in the parser immedeately and then look up the fresh object. yuck! 21:18
I'm not even sure what that requires to get to work though.
on that happy note I will bid you good night. & 21:19
svnbot6 r8337 | stevan++ | PIL/Native/Bootstrap.pil 22:31
r8337 | stevan++ | - added ::Class.isa() because it is different than ::Object.isa()
r8337 | stevan++ | t/pil/*
r8337 | stevan++ | - renamed metamodel.t to basic_object.t
r8337 | stevan++ | - added inheritence.t to test basic inheritance
stevan audreyt: I am feeling pretty confident in the metamodel now. I still want to write some more tests before I introduce roles. 22:47
audreyt: but once that is done, roles shouldn't take too long to add and test 22:48
audreyt: we do however need to discuss how to handle next METHOD
audreyt: we can can go the CLOS route and just create a lexically scoped function for each method invocation 22:49
similar to how $?CLASS and $?SELF are handled 22:50
audreyt: I think that next METHOD will likely need to be written in Haskell 22:58
but we should be able to just add it to the lex like $?SELF and $?CLASS
stevan dinner & (be back in ~2 hours) 23:00
rafl nothingmuch: ping 23:59