Camelia, the Perl 6 bug

IRC log for #moe, 2013-02-06

| Channels | #moe index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:12 stevan sure, why not
00:12 stevan i will start with all the passing ones tghough
00:24 jnap I hate to even ask this but has anyone written any performance benches?
00:25 jasonmay none that I know of
00:25 jasonmay I'm not sure it's worth writing any for the prototype implementation
00:26 jasonmay some basic ones would be great though
00:27 jnap I think weak performance was one of the things that made pugs feel like a side thing.  I'll have to read the Scala benchmarking examples to figure it out though
00:28 * jasonmay finally gets to use zip!
00:28 jasonmay says jasonmay right after discussing performance stuff
00:45 jasonmay hmm an AST validator that runs after parse time might be good
01:26 stevan jasonmay: yeah, I was thinking that too
01:27 stevan we could do a number of things with this
01:27 stevan 1) check type usage
01:27 stevan 2) check method/functions are valid
01:28 stevan all sorts of stuff
01:28 jasonmay 2 is what made me think of it
01:28 jasonmay I started playing around with interpreting arguments in sub calls and stuff, supporting closures like p5 isn't as easy as it looks
01:30 jasonmay I kinda have it working like.. javascript I think
01:30 stevan yeah, closures are tricky
01:30 stevan the Environment should just work
01:30 stevan but you basically have two environments
01:30 stevan 1) the creation environment
01:30 stevan and 2) the execution environment
01:31 stevan gotta go watch Dr. Who with the kids, but I will check in later and we can go over it if you want
01:34 jasonmay actually I think this might be working. I'm tired and overthinking
01:35 jasonmay I was thinking this was happening: sub getn { $n } my $n = 4; getn; $n # gives 4
01:36 jasonmay s/getn; $n/getn/
01:37 * perigrin ponders writing a moe::compat pragma that implements (some of) the syntax that doesn't compile / run clean in cPerl5
01:38 perigrin so far it appears to consist of @EXPORT = qw(true false);
01:38 perigrin sub true { 1 } sub false { 0 }
01:39 jasonmay actually the getn thing is totally happening because getn's env's parent env is the $n env
01:39 jasonmay say that 5 times fast
01:40 perigrin q[getn's env's parent env is the $n env] x 5
01:40 perigrin done!
01:40 jasonmay cheater
01:40 perigrin :)
01:41 * perigrin adds sub import { uft8::all->import() } to the list of things moe::compat would need
01:42 jasonmay sub import { Fun->import() }
01:43 jasonmay with some adjustments :)
01:43 perigrin I haven't gotten that far in his syntax examples.
01:44 jasonmay sorry I'll stop spoiling
01:44 * perigrin raps jasonmay's fingers for reading from the little blue book.
01:44 perigrin Jim the Fish?
01:45 perigrin jasonmay: looks like TryCatch.pm also needs re-importing
01:46 jasonmay how about Try
01:46 perigrin stevan: somewhere around "statements" you start quoting true/false
01:46 jasonmay https://metacpan.org/module/Try
01:46 perigrin are you intending for string litterals there? or did you confuse the true/false barewords at some point?
01:47 perigrin jasonmay: yeah probably that one
01:51 perigrin are there any examples of twigils in perl5?
01:51 * perigrin has reached the section on classes.
01:56 jasonmay stevan: I think the environment might need to be copied at declaration time
01:57 jasonmay that is, if we want it to behave like perl5
01:59 jasonmay the declarer environment, if that makes sense
02:13 perigrin AND STAY OUT!
02:17 alh joined #moe
02:17 moritz joined #moe
02:17 Util joined #moe
02:17 ducks joined #moe
02:17 triddle joined #moe
02:17 au joined #moe
02:17 sartak joined #moe
02:17 auggy joined #moe
02:17 reddickulous joined #moe
02:17 oalders joined #moe
02:17 mattp joined #moe
02:26 stevan perigrin: I started quoting "true" and "false" cause I didn't want those to fail the syntax test because of a lack of true/false
02:27 stevan jasonmay: yes, ideally we differentiate between a plain anon-sub and a closure
02:28 stevan the closure will need to capture a reference  to the definiton env
02:29 stevan if we write a traversal method that checks the body of a sub for unbound varibables, that should be sufficient
02:29 stevan to determine the diff that is
02:29 stevan but that might be premature optimizing
02:29 stevan anyway, i think I am gonna get some sleep
02:29 stevan I've been trying to avoid getting sicker
02:33 stevan perigrin: I was thinking the same thing myself, "wow this is working, I wonder what i would need for a moe.pm pragma"
02:34 perigrin I *think*
02:35 perigrin signatures.pm (rather than fun), Try.pm
02:35 stevan yeah, those would help
02:35 stevan Try.pm is missing the catch class matching
02:35 perigrin and sub true { return dualvar 1, 'true' } sub false { return dualvar 0, 'false' }
02:36 perigrin oh! and utf8.pm
02:36 stevan :)
02:36 perigrin which honestly I think someone should fight the fight to get that turned on with use 5.18;
02:39 stevan well volunteered
02:40 moe [moe] stevan deleted more-grammar-examples at fb4ceb3: http://git.io/HPnr0g
02:42 perigrin I'm not sure where to start with that one.
02:42 perigrin Politically.
02:42 perigrin but yeah once I figure that out I'll try
02:43 jasonmay if I want to have moeSub.execute() return both the result and the sub's environment, would I be going about this wrong?
02:43 jasonmay for instance
02:44 jasonmay if I increment $n in the sub, right now it replaces sub_env.get("$n") with a newly instantiated MoeIntObject(env.get($n).nativeValue + 1)
02:44 jasonmay so I lose the old MoeIntObject
02:45 * stevan is not following
02:45 jasonmay but if I have execute() return the new env it makes
02:45 jasonmay I will have access to the env to rebind what was modified
02:45 * jasonmay is tired
02:45 stevan oh
02:45 stevan uhm
02:45 stevan yeah I think  you are overthinking it
02:46 stevan the new env should already be bound to the parent env
02:46 jasonmay it's not bound both ways
02:46 stevan can you push the code?
02:46 jasonmay yeah
02:48 moe [moe] jasonmay created jasonmay/wip-sub-arguments (+1 new commit): http://git.io/jw6kGg
02:48 moe moe/jasonmay/wip-sub-arguments e5e56bc Jason May: (WIP) Pass arguments into subs
02:54 stevan ah, you don't want to clone
02:54 stevan so, and I am not all there right now, so I might be talking crazy (I am dancing on the edge of sick and pretty tired)
02:55 stevan but you need a couple things
02:55 stevan 1) the declaration environment
02:56 stevan 2) the local sub environment
02:56 stevan 3) the execution environment
02:56 stevan for a closure you should only be altering #1
02:56 stevan altering #3 is javascript, which is dynamic scoping, which is shit
02:56 * perigrin frowns and worries about stevan a bit.
02:56 perigrin you're at home right?
02:56 stevan yes
02:56 perigrin 'k then I won't worry too much
02:56 stevan #1 should be parent of #2
02:56 stevan not a clone/snapshot
02:57 stevan jasonmay: I think that is the entirety of you problem right there
02:57 jasonmay yeah
02:57 jasonmay the clone/snapshot was to prevent the javascript behavior
02:57 jasonmay I will sleep and think more
02:58 stevan ok
02:58 stevan I will do the same
02:58 stevan maybe try and draw this out too
04:34 kthakore joined #moe
08:01 am0c joined #moe
08:39 hobbs joined #moe
08:40 am0c joined #moe
09:27 clintongormley joined #moe
11:31 melo joined #moe
13:56 gizmomathboy joined #moe
14:25 clintongormley joined #moe
14:43 bluescreen joined #moe
15:05 jnap joined #moe
16:59 clintongormley joined #moe
17:12 am0c joined #moe
17:21 clintongormley joined #moe
17:22 melo1 joined #moe
17:28 clintongormley1 joined #moe
17:31 melo joined #moe
17:59 sahadev joined #moe
18:30 melo joined #moe
18:44 melo joined #moe
18:51 PerlJam joined #moe
18:51 PerlJam woot
18:52 stevan greetings
18:52 masak joined #moe
18:52 masak \o/
18:52 stevan :)
18:53 PerlJam So ... the goal is to have fun and as a side-effect, maybe improve Perl 5?  :)
18:54 masak -Opun \o/
19:05 umask001 joined #moe
19:06 jasonmay I wonder if the interpreter can be organized better with some clever uses of orElse
19:09 stevan jasonmay: how so?
19:09 stevan PerlJam: yes -> http://moe.iinteractive.com
19:09 stevan that statement is as much as I am willing to say at this point
19:10 * stevan has several longer documents, but they are not ready for public yet
19:10 stevan PerlJam: basically trying to prototype/add new features into the existing perl 5 core was a painful experience
19:11 PerlJam I believe it.
19:11 stevan and in the case of p5-mop, it very quickly got to the point where like only 1-2 people (doy and rafl) could hack the Devel::CallParser stuff that was needed to properly handle the syntax
19:12 stevan and then it got worse when we broke PadWalker
19:12 stevan cause then it basically was "need a core hacker"
19:12 stevan and at that point, the fun is all gone
19:12 stevan so, believe it or not, it was easier to re-write Perl 5 then it was to try and prototype new features in the core
19:14 jasonmay stevan: that I'm not sure :) giant partial functions can be split to smaller ones, and orElse can be used to run through them in order, I think
19:15 stevan jasonmay: is this an alternative to pattern matching?
19:15 jasonmay no
19:15 stevan I guess I am just not really sure what you mean
19:16 jasonmay have some literal node cases in one object/file/whatever, expression ones in another, and so on
19:17 jasonmay nodepartialfunction orElse othernodepartialfunction
19:17 jasonmay just to break it up a bit
19:17 jasonmay I'm not proposing anything, was just thinking out loud
19:21 jasonmay by partial function I mean the match blocks
19:23 stevan yeah I am not familiar enough with Scala to understnad what you mean
19:23 stevan other then that your basically proposing an combinator style interpreter
19:23 PerlJam joined #moe
19:29 masak joined #moe
19:30 jasonmay stevan: https://gist.github.com/jas​onmay/9e8d68cfeefe4895df40
19:30 jasonmay but I don't rally know The Scala Way for that kind of thing
19:31 jasonmay that's just the only thing I've found to split up pattern matching
19:34 jasonmay alternatively there's alwys just keeping it and moving stuff into util objects or something
19:35 stevan oh
19:36 stevan I kinda like that
19:37 stevan i know that large pattern matching functions can bloat when they hit the JVM, so this is probably a good idea
19:37 stevan also, since you could (in theory) override the methods, it would make it extensible
19:39 sivoais joined #moe
20:12 sivoais joined #moe
21:59 awwaiid joined #moe
22:54 moe [moe] jasonmay created jasonmay/sub-arguments (+1 new commit): http://git.io/iPoJ0Q
22:54 moe moe/jasonmay/sub-arguments 8224f91 Jason May: Pass arguments into subroutines
22:56 jasonmay pass subrouments into argutines
23:09 moe [moe] jasonmay deleted jasonmay/wip-sub-arguments at e5e56bc: http://git.io/InBTRw

| Channels | #moe index | Today | | Search | Google Search | Plain-Text | summary