Camelia, the Perl 6 bug

IRC log for #dbdi, 2009-08-11

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

All times shown according to UTC.

Time Nick Message
04:20 eternaleye Somewhat OT, but does anyone in here have java2perl6 working? I don't have a JVM (and Exherbo doesn't package one yet), but I wanted to run it on the Google Wave java API so that people could make Wave robots in P6
05:04 eternaleye joined #dbdi
06:46 mzedeler joined #dbdi
07:11 cosimo joined #dbdi
07:11 cosimo hi there!
07:12 moritz_ hi cosimo
08:20 timbunce joined #dbdi
11:19 dalek joined #dbdi
11:20 Infinoid Ok, second try after a minor tweak, the dalek plugin loaded this time.
11:23 moritz_ Infinoid: great, thanks
11:27 Infinoid please commit something :)
12:31 timbunce I've just committed a TODO file :) r89
12:33 moritz_ let's wait a few minutes, I think dalek has up to 5 mintes lag
12:34 dalek java2perl6: r89 | tim.bunce++ | trunk/TODO:
12:34 dalek java2perl6: Added a TODO file with an off-the-top-of-my-head list of things we need done
12:34 dalek java2perl6: review: http://code.google.com/p/ja​va2perl6/source/detail?r=89
12:34 moritz_ Infinoid++
12:35 Infinoid \o/
12:35 Infinoid enjoy :)
12:35 Infinoid left #dbdi
12:35 timbunce Infinoid++ many thanks
12:40 timbunce eternaleye: I saw your question in the irc log re running java2perl6 on the Google Wave java API. Firstly java2perl6 only generates role definitions not actual code that does anything. If you understand that and that's what you want, then great. Getting a working javap command would be best. Failing that you could consider improving the parser so it can parse real java source, but that could easily be too much pain.
12:42 timbunce I wonder if java2perl6 should be renamed to avoid the impression that it does more than interface translation.
12:43 timbunce Perhaps 'java api' so javapi2perl6?
12:43 moritz_ better, but maybe a bit long
12:45 timbunce ja2p6? ;)
12:46 moritz_ :-)
12:46 moritz_ anyway, the name is not so important to me
12:46 moritz_ afaict we need that once for the translatoin
12:46 moritz_ and then when we have tested the generated Perl 6 code we can pretty much abandon it
12:46 moritz_ is that right?
12:46 timbunce yeap.
12:47 timbunce Is it working for you?
12:47 moritz_ then I don't think a rename is worth the trouble
12:49 moritz_ rakudo supports typed constants already, but I don't think they can be exported yet
12:50 timbunce I don't think exporting is important.
12:50 moritz_ if they are not used outside the class
12:51 timbunce I see the java2perl6 project as strategically valuable for perl6. Java has a huge community of developers (say two orders of magnitude more than perl) and lots of mature OO APIs we can steal, er, be inspired by. If java2perl6 helps 0.01% of those developers get interested in perl6 then it's a big win.
12:51 timbunce I'd be happy enough if they could be called as methods.
12:52 timbunce When I run perl mkjdbc.pl I'm getting all the code now but some are failing with
12:52 timbunce . . interface java.sql.Statement: checking jdbclib/java/sql/Statement.pm
12:52 timbunce Unable to parse multisig; couldn't find final ')' at line 63, near "--> java::"
12:52 timbunce in Main (src/gen_setting.pm:3363)
12:53 timbunce moritz_: could you take a look?
12:54 moritz_ timbunce: sure
12:54 moritz_ just a sec
12:55 moritz_ uhm, Parse::RD takes more than a second :-)
12:56 timbunce it takes a long time to run perl6 :) All those calls to perl6 recompiling more and more of the class tree.
12:59 moritz_ ok, finally got there
12:59 moritz_ timbunce: precompiling the modules to PIR might speed that up
13:00 timbunce yes, sounds good. I've no idea how though.
13:01 timbunce (without --check mkjdbc.pl takes ~30 seconds for me. with --check it takes many many minutes)
13:01 moritz_ perl6 --target=PIR --output=$file.pir $source
13:01 moritz_ or so
13:01 timbunce and then it'll automatically use the .pir file if some other code does a "use" of that module?
13:02 moritz_ yes
13:03 moritz_ I can't see a good reason for that failure in java::sql::Statement
13:07 moritz_ it seems to not like      --> java::sql::ResultSet, but it know about that type.
13:10 p6eval joined #dbdi
13:15 dalek java2perl6: r90 | tim.bunce++ | trunk/bin/java2perl6:
13:15 dalek java2perl6: Added "--target=PIR", "--output=$pirfile" to perl6 options so the
13:15 dalek java2perl6: pir will be cached to speed up checking of higher-level modules.
13:15 dalek java2perl6: review: http://code.google.com/p/ja​va2perl6/source/detail?r=90
13:15 dalek java2perl6: r91 | tim.bunce++ | trunk/ (2 files):
13:15 dalek java2perl6: Added :all to use autodie so system() gets checked.
13:15 dalek java2perl6: Added time to java2perl6 call.
13:15 dalek java2perl6: Added note to TODO.
13:15 dalek java2perl6: review: http://code.google.com/p/ja​va2perl6/source/detail?r=91
13:17 PerlJam Good morning.
13:17 PerlJam Should autodie be added as a PREREQ in Makefile.PL ?  I'm not sure where mkjdbc.pl falls in the grand scheme.
13:18 moritz_ timbunce: now autodie requires IPC::System::Simple for system() calls, that should also be a prerequ
13:19 timbunce yeah, well, I tend to view mkjdbc.pl as a not really part of the java2perl6 project. Perhaps it should be. I'm not sure it's worth it though.
13:20 PerlJam java2perl6 is the general tool and mkjdbc.pl is the "run this once" tool once the general tool is vetted?
13:24 timbunce java2perl6 is a general tool hopefully suited to translate many java apis. mkjdbc.pl is a quick hack for testing the use case that interests us most.
13:36 dalek java2perl6: r92 | tim.bunce++ | trunk/ (3 files):
13:36 dalek java2perl6: Added pod docs to mkjdbc.pl.
13:36 dalek java2perl6: Added 'java.math.BigDecimal'  => 'Rat' to TypeCast.
13:36 dalek java2perl6: Removed -c from --check perl6 call as it's noisy and not needed.
13:36 dalek java2perl6: review: http://code.google.com/p/ja​va2perl6/source/detail?r=92
13:49 timbunce moritz_: I suspect the "Unable to parse multisig; couldn't find final ')' " error is another case of recursive-use
13:49 timbunce java::sql::ResultSet uses java::sql::Array which uses java::sql::ResultSet
13:50 moritz_ timbunce: ah, that makes sense... but the error message does not
13:50 timbunce that's your department ;)
13:51 moritz_ masak's, actually :-)
13:51 moritz_ anyway, I'll see if I can reduce it to a sensible test case tonight and submit it as a rakudobug
13:52 timbunce I quoted one yesterday in irc. I'll go find it.
13:52 timbunce http://irclog.perlgeek.de/​dbdi/2009-08-10#i_1382144
13:53 timbunce will that do?
13:53 moritz_ yes
13:54 timbunce as a workaround you suggested class foo {}; then later class foo is also { ... }. Can I do the same thing with roles?
13:54 moritz_ I don't think so
13:55 moritz_ rakudo: role A { }; role A is also { method foo() { say "alive" } }; A.new.foo
13:55 p6eval rakudo 11a293: OUTPUT«Ambiguous dispatch to multi '_block50'. Ambiguous candidates had signatures:␤:()␤:()␤in Main (/tmp/dil7iw4iET:2)␤»
13:55 moritz_ rakudo: role A[$unused_parameter] { }; role A  { method foo() { say "alive" } }; A.new.foo
13:56 p6eval rakudo 11a293: OUTPUT«alive␤»
13:56 moritz_ timbunce: that will work, but it's one of the ugliest workarounds I've seen so far :)
13:56 timbunce ok, thanks :)  I think I'll just map  java::sql::Array to something harmless for now.
14:06 PerlJam rakudo still does "is also" instead of "augment"?
14:11 moritz_ PerlJam: yes
14:11 moritz_ (it blocks on context variables)
14:17 dalek java2perl6: r93 | tim.bunce++ | trunk/ (2 files):
14:17 dalek java2perl6: Map java.math.BigDecimal to Num not Rat as Rat isn't available yet.
14:17 dalek java2perl6: Map java.sql.SQLInput & .SQLOutput to Object.
14:17 dalek java2perl6: Raised trace level to logging the javap command call.
14:17 dalek java2perl6: review: http://code.google.com/p/ja​va2perl6/source/detail?r=93
14:23 timbunce moritz_: it's getting harder to duck this problem. java::sql::Statement has a use-loop with java::sql::ResultSet
14:26 timbunce It's complicated by having a mix of classes and roles. A given name could be either. Having to pre-scan to work out which workaround to use would be painful.
14:27 moritz_ rakudo: role Foo[$bar] { }; class Foo { }; say Foo.new.WHAT
14:27 p6eval rakudo 11a293: OUTPUT«Re-declaration of type Foo at line 2, near "; say Foo."␤in Main (src/gen_setting.pm:1604)␤»
14:27 moritz_ ouch.
14:28 timbunce rakudo: role Foo { }; class Foo { }; say Foo.new.WHAT
14:28 p6eval rakudo 11a293: OUTPUT«Re-declaration of type Foo at line 2, near "; say Foo."␤in Main (src/gen_setting.pm:1604)␤»
14:32 dalek java2perl6: r94 | tim.bunce++ | trunk/ (2 files):
14:32 dalek java2perl6: Excluded .pir files from diff -r at end of mkjdbc.pl
14:32 dalek java2perl6: Added java.lang.Exception mapping to Object.
14:32 dalek java2perl6: review: http://code.google.com/p/ja​va2perl6/source/detail?r=94
18:31 mzedeler_ joined #dbdi
19:44 _timbunce joined #dbdi
20:18 timbunce joined #dbdi
22:18 _timbunce joined #dbdi

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