Camelia, the Perl 6 bug

IRC log for #parrot, 2012-10-14

Parrot | source cross referenced

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

All times shown according to UTC.

Time Nick Message
00:08 benabik joined #parrot
00:38 dbcooper joined #parrot
02:39 bluescreen joined #parrot
04:44 bluescreen joined #parrot
06:46 Administrator joined #parrot
06:59 zby_home joined #parrot
07:18 Mike-PerlRecruiter_ joined #parrot
09:02 mobile joined #parrot
09:41 fperrad joined #parrot
10:23 dalek rakudo/nom: edb767a | moritz++ | src/core/Str.pm:
10:23 dalek rakudo/nom: allow substr($str, $first, Inf)
10:23 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/edb767a301
10:57 whiteknight joined #parrot
12:00 whiteknight good morning, #parrot
12:01 moritz good morning, whiteknight
12:02 moritz in C, how do I call a method on PMC of which I know that it returns a string?
12:02 moritz I guess I frist need to use VTABLE_find_method to get the method object
12:03 moritz and then? Parrot_pcc_invoke_sub_from_c_args? or Parrot_ext_call?
12:08 PacoAir joined #parrot
12:13 not_gerd joined #parrot
12:14 not_gerd whiteknight: I opened an issue ( https://github.com/parrot/parrot/issues/860 ) with some more information
12:16 ligne joined #parrot
13:04 Psyche^ joined #parrot
13:26 moritz nqp: say(nqp::chars(pir::trans_encoding__SSI('ø', pir::find_encoding__Is('binary')));
13:26 p6eval nqp: OUTPUT«Confused at line 2, near "say(nqp::c"␤current instr.: 'panic' pc 20014 (src/stage2/gen/NQPHLL.pir:7316) (src/stage2/gen/NQPHLL.pm:324)␤»
13:26 moritz nqp: say(nqp::chars(pir::trans_encoding__SSI('ø', pir::find_encoding__Is('binary'))));
13:26 p6eval nqp: OUTPUT«1␤»
13:27 moritz why does that print 1 instead of 2?
13:28 moritz I thought 'ø' would be an UTF-8 string, and changing it binary would produce two bytes
13:29 moritz nqp: say(nqp::chars(pir::trans_encoding__SSI('€', pir::find_encoding__Is('binary'))));
13:29 p6eval nqp: OUTPUT«Lossy conversion to single byte encoding␤current instr.: '' pc 46 ((file unknown):42) (/tmp/4yergZqlju:1)␤»
13:29 moritz that one is even more confusing to me
13:33 moritz are binary strings documented anywhere?
13:34 not_gerd moritz: my guess would be this is due to the fact that your first example is in latin-1
13:35 moritz not_gerd: might be, yes
13:37 moritz anyway, I don't understand how converting anything to binary can be a lossy conversion
13:38 moritz probably because there's a mismatch between what parrot considers a binary string, and what I do
13:38 moritz which is why I'm asking for documentation
13:48 not_gerd moritz: there's always the source
13:48 not_gerd binary uses the fixed8 encoder, ie just accepts any unicode char with value <= 0xFF
13:49 moritz so binary is a synonym for Latin-1?
13:50 moritz can I somehow convert an UTF-8 string to a binary string with the same bytes?
13:50 not_gerd moritz: it's not equivalent to latin-1 as it fails for many string operations
13:51 not_gerd to get at the bytes, you'll probably poke into the backing buffer
13:51 not_gerd no idea if there's an API for that
13:51 not_gerd *need to poke
13:58 not_gerd moritz: creating a ByteBuffer PMC from the string appears to do what you want
13:59 moritz not_gerd: well, currently i want to avoid ByteBuffer, because nqp and rakudo can't serialize them
14:03 not_gerd moritz: I can tell you how to do it using the C API, but that's probably not very helpful
14:04 moritz not_gerd: well, i could write a custom opcode once I know how it's done in C :-)
14:06 not_gerd moritz: you can pass the string's strstart and bufused to Parrot_api_string_import_binary(), or use Parrot_str_new_init() directly
14:06 not_gerd the former is a thin wrapper for the latter
14:07 not_gerd oh - the proper way is probably to string->bytebuffer->string
14:08 moritz that's still an option, yes
14:11 arnsholt joined #parrot
14:14 * moritz tries it
14:45 not_gerd bye, #parrot
14:45 not_gerd left #parrot
14:47 rurban_home moritz: binary strings are a bit crippled in parrot. I enhanced them in some branch, but forgot in which. They behaved like ByteBuffer's then
14:48 rurban_home I had exactly the same problem you are facing.
15:19 dalek rakudo/nom: 837d0f8 | moritz++ | src/core/ (4 files):
15:19 dalek rakudo/nom: switch Buf from ByteBuffer to binary string storage
15:19 dalek rakudo/nom:
15:19 dalek rakudo/nom: the serializer knows how serialize strings, but not ByteBuffer; should fix #114500
15:19 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/837d0f8ae9
16:03 dalek nqp: 86b5b43 | moritz++ | / (2 files):
16:03 dalek nqp: fix command line parsing (RT #114720)
16:03 dalek nqp: review: https://github.com/perl6/nqp/commit/86b5b436f8
16:04 dalek rakudo/nom: 0d2140b | moritz++ | tools/build/NQP_REVISION:
16:04 dalek rakudo/nom: bump NQP revision to get command line parser improvements
16:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0d2140b7c6
16:24 whiteknight how are binary strings crippled in parrot?
16:24 whiteknight joined #parrot
16:29 whiteknight moritz: Sorry, I didn't see your earlier question about invoking a method from C
16:30 whiteknight Moritz: from NQP-land code, if you already have the method object, best is probably Parrot_ext_call()
16:30 whiteknight STRING reg = STRINGNULL;
16:30 whiteknight Parrot_ext_call(interp, method, "Pi->S", obj, &reg);
16:31 whiteknight Pi is the invocant, S is the returned string
16:31 moritz whiteknight: ok, thanks
16:32 benabik joined #parrot
17:08 brrt joined #parrot
17:31 brrt ping whiteknight
17:39 contingencyplan joined #parrot
18:43 pmichaud I just added another note to #860 -- it looks to me like the encoding and/or record_separator attributes of the Handle PMC may be prematurely recycled by GC
18:44 pmichaud at least, I can't find where they're being marked.  (I've never completely been able to follow how marking works when PObj_custom_mark_SET() isn't called.)
18:45 pmichaud that looks like a bug of sorts to me -- the previous version of handle.pmc apparently didn't have any STRING attributes.
18:46 pmichaud (previous version == version in 4.6.0)
18:46 pmichaud afk for a while.
18:51 tuxit joined #parrot
19:20 Mike-PerlRecruiter_ joined #parrot
19:46 dalek rakudo/nom: dfbfbb9 | moritz++ | src/core/terms.pm:
19:46 dalek rakudo/nom: Add another dir to @*INC
19:46 dalek rakudo/nom:
19:46 dalek rakudo/nom: In the long run I want panda and R* to install the modules there,
19:46 dalek rakudo/nom: instead of ~./perl6/lib, which is shared among different Rakudo versions.
19:46 dalek rakudo/nom: Currently this means that if you have precompiled modules in ~/.perl6/lib,
19:46 dalek rakudo/nom: R* fails to compile modules.
19:46 dalek rakudo/nom:
19:46 dalek rakudo/nom: You can find this new dir with perl6 -e 'say $*CUSTOM-LIB'
19:46 dalek rakudo/nom: Better names are very welcome :-)
19:46 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/dfbfbb9828
20:20 dalek rakudo/nom: 8a07b84 | moritz++ | src/core/terms.pm:
20:20 dalek rakudo/nom: refine $*CUSTOM-LIB
20:20 dalek rakudo/nom:
20:20 dalek rakudo/nom: panda wants a prefix below which it creates bin/ lib/ and panda/ dirs.
20:20 dalek rakudo/nom: So now @*INC containts "$*CUSTOM-LIB/lib" by default
20:20 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8a07b84f49
21:04 tuxit joined #parrot
21:58 contingencyplan joined #parrot
23:28 benabik joined #parrot

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

Parrot | source cross referenced