Parrot 3.4.0 released | parrot.org | Log: irclog.perlgeek.de/parrot/today
Set by moderator on 17 May 2011.
00:09 daniel-s left 00:13 whiteknight joined
whiteknight good afternoon, #parrot 00:14
soh_cah_toa whiteknight: you're the first one to break the silence :) 00:16
whiteknight oh, not a busy day today?
sorear hello whiteknight. 00:17
whiteknight hello sorear
soh_cah_toa sorear: hey, you're here too :)
cotto ~~
soh_cah_toa cotto: and you! hey
00:25 davidfetter joined 00:27 daniel-s joined 00:29 daniel-s left 00:41 whiteknight left
Coke 00:42
00:45 whiteknight joined 00:48 davidfetter left
dalek TT #1984 closed by cotto++: Remove clone_pmc VTABLE slot 00:56
TT #1984: trac.parrot.org/parrot/ticket/1984
rrot/soh-cah-toa/hbdb: 377a93d | soh_cah_toa++ | src/hbdb.c:
Renamed hbdb_cmd_list to hbdb_cmd_table_t and hbdb_cmd to hbdb_cmd_t as this is a little more accurate
00:57
rrot/soh-cah-toa/hbdb: f53a710 | soh_cah_toa++ | / (2 files):
Defined run_command() and finished implementation of parse_command(). Almost recognizes commands but segfaults
cotto soh_cah_toa, I recommend running the build with -s. That will prevent make from printing what the commands it's running and make warnings much easier to find. 01:03
01:04 whiteknight left
soh_cah_toa cotto: ah, ok 01:05
cotto: i'm so so so close to command recognition. it's segfaulting though. think you could help me find out why? 01:06
i'd rather right in my blog "yay, it works!" rather than "ugh...so close" ;)
cotto cstrings?
01:06 whiteknight joined
soh_cah_toa cotto: yeah, i wanted to get this working before replacing everything w/ STRING's 01:06
cotto soh_cah_toa, you may find that it's less work to start using STRINGs now 01:07
soh_cah_toa i guess i'll do it now. that could be why. i just hate wasting time guessing/looking for the right function or type to do something w/ STRING's when i already know how to do it w/ cstring's 01:09
cotto perldoc src/string/api.c 01:10
soh_cah_toa yeah, i'm looking at it now
well, let me write my blog first b/c this will probably take quite a while 01:11
whiteknight (blog first)++ 01:20
I'm *way* behind on my blogging. I need to get back on that
01:23 preflex left 01:27 preflex joined
cotto whiteknight, in your mind, what's the most valuable thing about Parrot? 01:32
dalek website: bubaflub++ | Parrot-GMP: More Tests 01:59
website: www.parrot.org/content/parrot-gmp-more-tests
website: soh_cah_toa++ | It's So Close, I Can Almost Smell It 02:04
website: www.parrot.org/content/its-so-close...t-smell-it
cotto soh_cah_toa, to clarify, I don't think your segfaults are because of cstrings. It's quite possible to use them correctly. What I mean is that segfaults are harder to cause when you're using Parrot's string system. 02:08
correctly
whiteknight cotto: that's a really good question 02:09
I'll have to ponder
cotto soh_cah_toa, make sure to read the documentation on IPC::Open3 carefully. There are some gotchas you need to be aware of that it'll tell you about. 02:16
soh_cah_toa cotto: ok
cotto Getting started testing needs to be your next priority after the STRING conversion. 02:18
soh_cah_toa yeah
cotto (and after getting command parsing working)
soh_cah_toa cotto: so what do you think i should do first? convert char * to STRING* or try to get rid of this segfault?
cotto I think that converting to STRING* would be a more productive use of your time. It's not too useful to fix something that you'll be rewriting the next day. 02:19
soh_cah_toa alright 02:20
cotto I'll be around this evening but not much tomorrow. 02:23
soh_cah_toa ok
is a STRING equal to a char *? not literally but what i means is if i have char *, do i replace it w/ just STRING or STRING *? 02:27
cotto STRING* 02:28
soh_cah_toa ok, that's what i thought
cotto The API takes pointers to STRINGs.
soh_cah_toa alright 02:29
02:29 rurban_ joined 02:32 rurban left, rurban_ is now known as rurban
soh_cah_toa looking through the string api reminded me of something...what's a PObj? what's it used for? 02:36
whiteknight soh_cah_toa: it's mostly a holdover
soh_cah_toa whiteknight: holdover? 02:37
whiteknight there are no PObjs used in the system. However, PMC and STRING structs contain the first few ields the same
fields
so if I have a PMC *pmc, I can cast it to PObj* and treat STRING and PMC the same
the flags field is common
so we can differentiate between types with a flag
soh_cah_toa thinks about this 02:38
whiteknight that isomorphism isn't as useful as it once was. We used to have other types of PObj in the system
you do any C++?
soh_cah_toa bleh...school :(
whiteknight it's basically like saying STRING and PMC are subclasses of PObj
but, in the manual, crappy, C way of doing that 02:39
basically, unless you are going to be playing with the GC, just ignore it
soh_cah_toa hmmm...is there any advantage to using it?
i'm not interested in using it or anything. just curious 02:40
whiteknight yes. We can write one set of functions for dealing with STRING and PMC in the GC
otherwise, we would need two sets of functions
soh_cah_toa ah, right
whiteknight all headers look like PObj, so we can cast them all to PObj and treat them the same
soh_cah_toa that sounds dangerous 02:41
whiteknight it is dangerous
that's why it only happens in the GC, and with adult supervision
soh_cah_toa yeah, i don't see it used very often but every once in a while it'll pop up 02:42
whiteknight there's a reason why we don't do it often 02:45
it has limited usefulness
it only really matters inside the GC
soh_cah_toa ok 02:46
whiteknight no other subsystem is so stupid as to mix and match PMC and STRING headers
incoming push 02:48
dalek sella: b5e81dd | Whiteknight++ | / (4 files):
Add in logic to automatically create dirs when building files, so we don't need to keep dummy dirs around
sella: 62a912e | Whiteknight++ | src/winxed/Distutils.winxed:
Small cleanups and docs for distutils
sella: 752d36a | Whiteknight++ | src/winxed/Distutils.winxed:
more distutils docs
sella: 0475c1f | Whiteknight++ | src/test/ (2 files):
+docs for SuiteFactory.Vector
sella: f7cca04 | Whiteknight++ | src/test/Asserter.winxed:
Add exists_keyed_str and not_exists_keyed_str assertions, for testing hash keys
sella: 7d69d79 | Whiteknight++ | t/test/SuiteFactory/Vector.t:
Add some tests for SuiteFactory.Vector
sella: 87dcf09 | Whiteknight++ | t/test/Assertions.t:
Add some tests for the new exists_keyed_str assertions
sella: 4117d3a | Whiteknight++ | / (3 files):
Cleanup Test.Suite. Break functions into public, protected, and private sections, with comments. Update tests
soh_cah_toa i can't do direct comparisons w/ STRING's right? for instance, if foo is a STRING *, i can't do "if (foo != '\\0')"? 02:52
cotto You can, but it won't do what you're hoping it'll do. 02:53
soh_cah_toa i just found Parrot_str_not_equal() anyway 02:54
dalek sella: 68ac304 | Whiteknight++ | s (3 files):
Refactor out logic for autocreating paths to a function make_path_for. Use that in setup.winxed to create a home for the generated version file.
02:54 whiteknight left
cotto or STRING_length() 02:55
soh_cah_toa but what if i want to compare a STRING to a string literal? do i have to replace the second arg to Parrot_str_not_equal() w/ Parrot_str_new()? 02:56
b/c i'm not seeing a Parrot_str_cmp(STRING *foo, const char *bar) 02:57
cotto What are you trying to do?
right. You can't directly compare STRING* and char*. You can use CONST_STRING("foo") though 02:58
soh_cah_toa doesn't that make a .str file i have to include though or something? 02:59
cotto (or Parrot_str_new_constant for external code)
yes 03:00
soh_cah_toa what i'm trying to do is this: 03:01
i have "if (hbdb->current_command != '\\0')". current_command used to be a char * but now it's a STRING *. i want to make this STRING-appropriate
cotto If you want to use CONST_STRING, you'll need to do a little fiddling with the build
Are you testing for a non-empty command?
STRING_length will work for that
soh_cah_toa yeah, if the user entered nothing,use the last command
ok
oh, i found Parrot_str_length(). less ugly than STRING_length ;) 03:03
i'll use that
03:04 bubaflub left 03:28 contingencyplan left 03:35 zostay joined, zostay left
soh_cah_toa cotto: i've got a bit of a problem. my command-line parsing logic relies heavily on pointer arithmetic and i also use isspace() which i don't see a STRING equivalent 03:37
is it ok if i use STRING *foo; foo->strstart++ and such? 03:38
cotto soh_cah_toa, definitely don't use that except for debugging. It breaks encapsulation and there's no guarantee that it'll continue to exist. 03:39
soh_cah_toa i thought so 03:40
cotto let me look
soh_cah_toa sure
it's the parse_command() function around line 419 in src/hbdb.c 03:41
cotto One way to do it would be to use a hash to map strings to function pointers 03:42
I think you're working too hard.
soh_cah_toa i'm not too familiar w/ hashes though
in c, that is
cotto Parrot already provides what you'll need. 03:43
There's no existing function to do that, but you'd just need to call Parrot_hash_create(interp, enum_type_STRING, Hash_key_type_ptr); 03:47
er, the opposite of that
Parrot_hash_create(interp, enum_type_ptr, Hash_key_type_STRING); 03:48
soh_cah_toa how do i iterate through a hash though? is there some docs about hashes i can look at? 03:49
cotto That way you just stuff a bunch of STRINGs and C function pointers into the hash. When you want to run a command, you check if the command maps to anything and run it if so.
just a sec 03:50
The addrregistry is a pretty minimal wrapper around a pair of hashes. 03:51
(it's used to store the GC root set, in case you're curious)
soh_cah_toa this is gonna set me back a bit though. right now, i'm just a segfault away from command recognition. if i do this, i have to completely redesign a lot of logic and hbdb_cmd_table_t and hbdb_cmd_t 03:52
cotto It'll be a lot simpler. 03:53
I don't want you to get too frustrated though.
soh_cah_toa i have more than just a string to match to a function pointer too. there's the help message and the short name in addition to the command string and function pointer. how am i gonna organize that? 03:56
cotto You can have more than one thing map to a single function pointer. 03:57
and the help message is just another command
soh_cah_toa no, the help message for the command
there's "help" and "help break" 03:58
"help" is another function" "help break" is just a string i have associated w/ the command
s/function/command 03:59
cotto You'll need commands to be smart enough to process arguments. If you also store the help text in a hash, the "help" command only has to do a little extra work to figure out what to display.
soh_cah_toa hmm...ok
cotto Does that make sense? 04:00
It's essentially using a dispatch table.
soh_cah_toa yeah, but...
cotto but?
soh_cah_toa i don't know. i'm unsure 04:01
cotto Do you understand how dispatch tables work?
soh_cah_toa the basics. yeah
cotto They're noisy in C, so you should get the concept solid before you try to implement it.
soh_cah_toa i'm just worried that i've come so far to try and make up for lost time and i'm so close to where i want to be and now i have to back track and do my "make up work" again. i don't want to have to re-do my re-do 04:04
cotto You can plow ahead. Refactoring will be easier once you have tests anyway. 04:05
soh_cah_toa for now, i think i'll just convert my STRING's to c-strings in parse_command() and then convert then back. at least i hope that will work 04:06
cotto ok 04:07
04:44 zostay joined 04:47 jsut_ joined 04:51 jsut left 05:03 soh_cah_toa left 05:06 preflex left 05:09 preflex joined
cotto dukeleto, ping 05:30
06:24 theory left
dalek rrot/leto/embed_grant: 46a1347 | dukeleto++ | t/src/embed/api.t:
Add coverage to Parrot_api_flag
07:03
07:09 fperrad joined 07:36 cjh left, cjh joined
dalek rrot/leto/embed_grant: 14a15f1 | dukeleto++ | t/src/embed/api.t:
Add test coverage for Parrot_api_unwrap_pointer
07:38
dukeleto cotto: pong 07:47
cotto dukeleto, privmsg reply 07:50
07:59 preflex left 08:01 preflex joined 08:03 mikehh left, cosimo joined
dalek rrot/m0-prototype: 8091bba | cotto++ | t/m0/integration/m0_poke_caller.m0:
more comments in poke_caller
08:17
rrot/m0-prototype: d4f4d9a | cotto++ | src/m0/perl5/m0_assembler.pl:
add ARGV and ARGC to assembler, simplify register parsing
rrot/m0-prototype: 6d4fd21 | cotto++ | t/m0/integration/m0_poke_caller.m0:
fix typo in poke_caller
rrot/m0-prototype: c3af1b2 | cotto++ | / (4 files):
add argv support and an incomplete test
rrot/m0-prototype: d7a80e5 | cotto++ | t/m0/m0_assembler.t:
clean up some failing tests
rrot/m0-prototype: 54cd050 | cotto++ | t/m0/ (33 files):
add a whole mess of vim codas
cotto sleeps
08:19 cosimo left 09:02 mikehh joined
dalek rrot/leto/embed_grant: 2266398 | dukeleto++ | t/src/embed/api.t:
Add coverage to Parrot_api_flag
10:02
rrot/leto/embed_grant: 7c4b6f8 | dukeleto++ | t/src/embed/api.t:
Add a test for Parrot_api_reset_call_signature
rrot/leto/embed_grant: c9c5a00 | dukeleto++ | / (2 files):
Decorate some embed api functions and rerun headerizer
rrot/leto/embed_grant: 1d956c5 | dukeleto++ | t/src/embed/api.t:
Fix type conversion compile error
rrot/leto/embed_grant: 1e48904 | dukeleto++ | t/src/embed/api.t:
Add test coverage for Parrot_api_get_exception_backtrace
10:30 rurban_ joined 10:34 rurban left, rurban_ is now known as rurban 10:36 whiteknight joined 10:37 plobsing left 10:53 contingencyplan joined
whiteknight good morning, #parrot 11:09
11:32 mj41 joined 11:44 mj41 left 12:01 lucian joined
lucian hm, i'm trying to figure out if a guy is trying to scam me 12:07
12:37 ambs joined 12:43 contingencyplan left 13:01 redicaps joined
cotto msg dukeleto I'd like to pick your brain about what calculating the hash of a string (or any string processing) should look like in M0. 13:13
aloha OK. I'll deliver the message.
13:15 JimmyZ joined 13:18 mj41 joined 13:35 redicaps left 14:11 daniel-s joined
daniel-s hello 14:11
is there an easy way to print an integer as a binary value
like $I0 = 3
print $I0
would give you 0b10 14:12
moritz printf
nqp: pir::printf('%b', 3)
p6eval nqp: OUTPUT«error:imcc:syntax error, unexpected PREG, expecting '(' ('$P100')␤ in file '(file unknown)' line 36␤error:imcc:syntax error ... somewhere␤ in file '(file unknown)' line 103␤syntax error ... somewhere␤»
moritz hm
but I'm sure some form of printf exists, and can be used for that 14:13
14:14 dodathome joined
daniel-s nqp pir::printf('%b', 3) 14:19
nqp pir::printf(%b, 3)
moritz nqp: pir::print(pir::sprintf('%b', 3)) 14:28
p6eval nqp: OUTPUT«error:imcc:The opcode 'sprintf_p_p' (sprintf<2>) was not found. Check the type and number of the arguments␤ in file '(file unknown)' line 36␤»
moritz nqp: pir::print(pir::sprintf__SSP('%b', 3)) 14:29
p6eval nqp: OUTPUT«get_pmc_keyed() not implemented in class 'Integer'␤current instr.: '_block1000' pc 0 ((file unknown):1)␤»
moritz nqp: pir::print(pir::sprintf__SSP('%b', "3"))
p6eval nqp: OUTPUT«11»
moritz nqp: pir::print(pir::sprintf__SSP('%b', "5"))
p6eval nqp: OUTPUT«101»
14:46 mj41 left
whiteknight nqp: pir::say(pir::sprintf__SSP("%b", [3])) 14:47
p6eval nqp: OUTPUT«11␤»
moritz nqp: pir::print(pir::sprintf__SSP('%b-%X', [3, 3])) 14:52
p6eval nqp: OUTPUT«11-3»
14:55 lucian_ joined 15:00 bubaflub joined 15:23 ambs left 15:24 daniel-s left 15:43 klavs joined 15:49 klavs left
dalek sella: a4c3a05 | Whiteknight++ | t/winxed_test/Vector.t:
Add a quick example file using test_vector from winxed
15:55
sella/event_queues: fb67e32 | Whiteknight++ | src/event/ (2 files):
start reworking event to use queues
sella/event_queues: 7c59170 | Whiteknight++ | s (4 files):
First stab at Event library refactor. Break subscriber management out into a new Queue class.
15:56 whiteknight left 15:58 whiteknight joined 15:59 bubaflub left 16:08 lucian_ left 16:22 JimmyZ left 16:24 JimmyZ joined 16:38 JimmyZ left 16:39 JimmyZ joined 16:46 JimmyZ left 16:47 JimmyZ joined 17:09 Eclesia joined
Eclesia hi 17:09
I have a question about pir. how can loop on all files in a folder ? 17:11
whiteknight Eclesia: good question 17:18
Eclesia: There is an "OS" PMC, which you need to load. it is shipped with parrot but not used by default
it has a method for reading directory contents
dalek sella/event_queues: b1a28b0 | Whiteknight++ | src/event/ (3 files):
Several fixes so we can fire off basic events again
17:19
sella/event_queues: e8e2dc7 | Whiteknight++ | src/event/ (2 files):
Add some more functionality for working with queues: Trigger events for particular queues, add/remove queues, enable/disable queues, set queue accept funcs
whiteknight os.readdir()
er, os.readdir(<path>)
Eclesia whiteknight: to load this os pmc, in which library is it ? 17:20
whiteknight let me look at what the incantation is
Eclesia thanks 17:21
by the way, Is there some kind of doc of all libraries with availables objects and methods ?
whiteknight $P0 = loadlib "os" 17:22
$P1 = new 'OS'
$P2 = $P1.readdir(<path>)
Eclesia: not so much, no. Nothing unified and comprehensive 17:23
Eclesia: What are you writing?
Eclesia a syntaxe parser
whiteknight And you're writing it in PIR? 17:24
Eclesia (a bit more then that but actually)
whiteknight: I explored and tryed the tools available and also how winxed does it
but I don't really like any of those solutions
whiteknight I've written a sort of "standard library" for Parrot called Rosella. It has libraries for working with things like files and directories in a much nicer way than the OS PMC does 17:25
and it's better documented
Eclesia whiteknight: nice. it's not another syntaxe I hope ? 17:26
moritz what does "syntaxe" mean?
whiteknight No. I wrote the library in winxed, but it's usable from NQP, Winxed, PIR, or any other language
Eclesia whiteknight: you have a link to this rosella ? 17:27
whiteknight Here's a link to the FileSystem documentation: whiteknight.github.com/Rosella/libr...ystem.html 17:28
Eclesia moritz: I came from the java world, Pir, pseudo-perl, c++(winxed), makefiles ... plenty to learn
whiteknight I'm signing off for most of the rest of the afternoon. Eclesia: If you have any questions about Rosella, I'm always happy to answer them 17:36
17:36 JimmyZ left 17:37 whiteknight left 17:52 zby_home joined 17:55 theory joined
Eclesia hm ... what does this error mean : error:imcc:Bareword method name 'readdir' not allowed in PIR ? 17:57
method doesn't exist ?
benabik Eclesia: It should be 'readdir' 17:58
As in $P0.'readdir'(path) 17:59
With $P0.readdir(path), PIR looks for a variable named readdir that has a function name or handle.
Eclesia benabik: what are the '' for ?
benabik Eclesia: Literal string.
Eclesia but it's a method 18:00
benabik Methods aren't automatically variable names in PIR. They have to be looked up by name.
moritz .local string foo
Eclesia so I better always use those ''
moritz foo = methodname 18:01
$P0.foo() # calls $P0.'methodname'()
Eclesia ok 18:02
can be used for function reference I see
when I have the result of : folder = filesystem.'readdir'(path) 18:06
folder is a pmc
but I don't know what it actually is
what methods available on it ... and so on
is there a way to display a structure of the pmc ?
to see what I can do 18:07
dukeleto Eclesia: there is dumper.pbc 18:08
18:08 theory left
sorear I think Eclesia wants somthing more like .^methods() 18:08
dukeleto Eclesia: load_bytecode 'dumper.pbc' and then _dumper(foo) 18:09
Eclesia would like a real doc of all object in the pir library
dukeleto Eclesia: that will at least tell you which kind of PMC it is
sorear perhaps try $P1 = get_class $P0; $P2 = P1.'methods'(); _dumper($P2) 18:10
dukeleto Eclesia: docs/book/pir/
Eclesia: github.com/parrot/parrot/blob/mast...bjects.pod (which seems to have broken POD) 18:11
Eclesia: also, you can run perldoc on any file in src/pmc/*.pmc
Eclesia dukeleto: that's more a tutorial. I search for some kind of javadoc. with a list a classes, available methods .... stuff like that 18:12
a catalog
sorear dukeleto: the book/ is written using pod6, are you trying to use a pod5 formatter?
moritz last I looked it was written in PseudoPod, not pod6 18:14
dukeleto yes, that is in pseudopod, not perl 5 pod 18:18
Eclesia: if we don't have something like that, we should 18:19
Eclesia: running perldoc on each PMC in src/pmc/*.pmc is probably the closest to what you want
Eclesia dukeleto: i didn't found it, and whiteknight already give me this answer : (19:23:14) whiteknight: Eclesia: not so much, no. Nothing unified and comprehensive 18:20
dukeleto Eclesia: i agree, we don't have something like that, and we should. Do you have an example that we could follow? 18:21
Eclesia hm some kind of basic html page would do. A simple list. group classes by namespaces in a tree on the left and on the right a description of the class 18:22
benabik Hm. Stmt and the temporary registers really make checking the generated PIR for differences easier. Much less random register changes. 18:25
pmichaud++
Eclesia dukeleto: I'm not neutral, (used to javadoc structure) but a catalog nevermind how it's structured, as long as a list of everyhing is available
dukeleto: example : javadoc.geotoolkit.org/ . nothing eyecandys, lists everywhere :D 18:27
but at least you can search and find all informations in it 18:28
18:30 rurban_ joined 18:33 rurban left, rurban_ is now known as rurban
dukeleto Eclesia: thanks 18:38
dukeleto is fighting IMCC from the embed API. Buckets of blood and tears. 18:39
Eclesia imcc ?
dukeleto Eclesia: IMCC is parrots internal PIR/PASM parser
Eclesia: InterMediate Code Compiler
Eclesia: one of the oldest parts of parrot and the most painful to work with 18:40
Eclesia hehe, good luck. I won't go into this ^^
dukeleto Eclesia: that is for the best 18:42
dukeleto just made miniparrot coredump! Feeling special.
moritz dukeleto: spawning a thread while inside a HLL is enough for that, last I tried 18:43
dukeleto moritz: I am need to add code coverage to Parrot_sub_new_from_c_func in src/extend.c to finish my TPF grant, and it is turning out to be quite fun 18:46
s/am need/need/
dalek rrot/leto/embed_grant: a418dad | dukeleto++ | t/src/extend.t:
Fix formatting
18:58
rrot/leto/embed_grant: a0911db | dukeleto++ | / (2 files):
Fix bug in Parrot_sub_new_from_c_func cause by not using PARROT_CALLIN_(START|END) and attempt to add test coverage
Eclesia I am trying to define a constant in pir like this : 18:59
.const string X364_START = "\\u001B["
.const string X364_END = "m"
.const string X364_RED = X364_START . 0b31 . X364_END
I can't make those kind of concatenation ? 19:00
moritz no
there'a 'concat' opcode
remember that PIR is an assembly language
Eclesia moritz: what is the correct writing I should use then ? 19:02
string + byte + string ?
moritz $S0 = concat X364_START, '0b31' 19:03
$S0 = concat $S0, X364_END
Eclesia ok thanks 19:04
moritz: pastebin.com/pP5D7Nq5 still not good ... can not call functions for constants ? 19:09
moritz Eclesia: $S0 = $S0 . X364_END
Eclesia: still not good
Eclesia: in general it also helps if you tell us what errors you get 19:10
Eclesia error:imcc:syntax error, unexpected IDENTIFIER, expecting STRINGC or INTC or FLOATC or USTRINGC ('x364')
in file './X364.pir' line 1
error:imcc:syntax error ... somewhere
in file './X364.pir' line 1
dukeleto Eclesia: X364_START wasn't defined before you used it 19:14
Eclesia: hmm, it seems that you did define it 19:16
Eclesia I can't find a proper order to make it compile ...
dukeleto Eclesia: concat might not like string constants. You may need $S2 = X364_END and then give $S2 to concat
Eclesia dukeleto: it's not the concat he doesn't like
it's .const string X364_RED = x364(0b31) 19:17
when I remove it everything's fine
dukeleto Eclesia: you are calling the x364 function during the declaration. That isn't allowed
Eclesia: declare the string first, then assign to it
Eclesia: you can only assign during a declaration if it is "simple", i.e. no nested function calls or anything special 19:18
Eclesia: makes sense?
Eclesia dukeleto: I guess but it's a const so I'm supposed to initialize it
error:imcc:syntax error, unexpected '\\n', expecting '=' 19:20
in file './X364.pir' line 1
he want's a value
19:21 bubaflub joined, wagle left
Eclesia damn can't even use x364 color encoding ... 19:25
19:26 wagle joined
dukeleto Eclesia: try = '' and then assign wit = x364(0b31) 19:27
s/wit/with/ 19:28
bubaflub: wazzup
bubaflub hola dukeleto
how you doing?
Eclesia dukeleto: not possible. it wouldn't be a const if it was possible
dukeleto bubaflub: crossing my fingers that I have completed my TPF grant. So freakin' close. 19:29
Eclesia: arg. You are correct.
bubaflub dukeleto: great. any plans post-grant? 19:30
dukeleto Eclesia: do you require it to be a .constant, or would .local work for you?
bubaflub: enjoy not staring at backtraces and coredumps generated from the embed/extend stuff 19:31
bubaflub: and write various conf talks that I should have started already
bubaflub dukeleto: hahaha. that sounds like an improvement.
dukeleto: since this is the last year i'm eligible for GSoC i'm thinking about maybe doing some grant work. 19:32
Eclesia dukeleto: can't use .local . I want to access it from anywhere .local is only in a function
"\\u001B[" + (byte)31 + "m" <-- the impossible mission lol
dukeleto Eclesia: you are trying to assign a constant to a function call. The parser doesn't know that the value of that function call is always the same 19:34
Eclesia: i would just expand the call to x364(0b31) and type in the actual value
Eclesia dukeleto: how can I write a byte value in a string ?
dukeleto Eclesia: constants can't depend on function calls, even if we can see that the function always returns the same y for a given x 19:35
Eclesia: good question 19:36
Eclesia ^^ 19:37
that's why I use a function to do it
I have the byte values for my string : 27 91 51 49 109 19:39
dukeleto Eclesia: what are you trying to represent with 0b31 ? That isn't valid in PIR either
Eclesia I'm trying to print colors in the output console 19:40
for that we use x3.64 encoding, knowned by nearly all terminals
en.wikipedia.org/wiki/ANSI_escape_code
but I haven't been able to print anything with the pir 'say' function 19:41
looks like the output formating from parrot is different from the java one 19:43
dukeleto Eclesia: you can use \\xNNNN in double quotes 19:44
Eclesia: actually, that is just an alias for \\u 19:45
Eclesia: there is also \\c for control characters
Eclesia: they are described in docs/pir/book/ch04_variables.pod 19:46
Eclesia: you could make a function that returns the string you want, and then in each function you want to use that, do .local string redcode \\n redcode = get_red() 19:49
Eclesia: less than awesome, but it might get you on your way
Eclesia dukeleto: I was thinking, maybe I could create an object with local variable 19:50
this way I could write x364.red when I need it
Eclesia don't know how to create objects yet lol 19:52
Eclesia one problem after another
ha :D finally some color showing up 19:54
definitly there is difference in string concatenation between java <> pir 19:55
dalek rrot/leto/embed_grant: 3693897 | dukeleto++ | src/extend.c:
Add many missing PARROT_CALLIN_(START|END) macros to src/extend.c
20:03
dukeleto realizes that we have a release on tuesday 20:04
Eclesia: .local pmc foo \\n foo = new 'Hash' \\n foo['red'] = ... 20:05
Eclesia dukeleto: *sigh* can not create object in .const 20:06
dalek rrot/leto/embed_grant: cf41a69 | dukeleto++ | .gitignore:
Add more code coverage ejecta to .gitignore
20:07
dukeleto Eclesia: no, can't do that :)
Eclesia strange other think. I can't access const from another file ?
sorear you don't want to use const any more than you have to, it is/was hilariously badly designed
Eclesia thing*
here is the best I obtain : pastebin.com/7zM2Pjwh 20:11
$S5 = X364_RED() 20:12
say $S5
say "hohohoho"
you will see the text in red
sorear Eclesia: I think you should use global variables for this
$S5 = get_global "RED"
Eclesia sorear: what is this get_global ? 20:13
sorear it's an opcode that fetches named values from the local namespace
$S5 = X364_RED() essentially means $P0 = get_global "X364_RED" \\n $S5 = $P0()
Eclesia sorear: so how can I define RED in x364 namespace for example ?
sorear .sub 'init' :load :init \\n set_global "RED", "whatever" \\n .end 20:14
assuming you have .namespace ["x364"] at the top of your file
20:14 perlite left
Eclesia trying this lovely looking solution 20:15
20:15 perlite joined
sorear you may want to add :anon too 20:15
so nobody can accidentally call init()
Eclesia sorear: 20:17
error:imcc:The opcode 'set_global_sc_s' (set_global<2>) was not found. Check the type and number of the arguments
in file './X364.pir' line 6
20:17 ambs joined
sorear checks src/ops/var.ops 20:17
Eclesia pastebin.com/Rd5Dx3kY 20:18
sorear it looks like it needs to be set_global_sc_p
try $P0 = "value" \\n set_global "RED", $P0
it's funny how PIR is so popular
Eclesia do not like it more then that 20:19
sorear from watching the last 50 years of programming language development... I'm amazed that a language without EXPRESSIONS could be such a runaway success
Eclesia sorear: how can I access a global from another namespace ? 20:20
sorear depends on how far the other namespace is
Eclesia how far ? 20:21
sorear same HLL scope?
Eclesia don't understand chinese :D
dukeleto sorear: yes
20:21 dodathome left
sorear $P0 = get_hll_global ["x364"], "RED" 20:21
Eclesia error:imcc:The opcode 'get_hll_global_s_pc_sc' (get_hll_global<3>) was not found. Check the type and number of the arguments 20:22
in file 'Compiler.pir' line 33
sorear Eclesia: Parrot is designed as a system for running code in multiple languages concurrently
Eclesia: you need to store the result in a P-var
dukeleto anybody else see this intermittent t/pmc/threads.t failure? gist.github.com/1034700
sorear Eclesia: Parrot has a concept of a "current HLL", which is automatically added to names 20:23
Eclesia hll == high level language ?
sorear yes
Eclesia: so, if you write PIR code for Rakudo, .namespace ["Foo"] actually means .namespace ["perl6", "Foo"]
if you're not working under any HLL, it usually uses "parrot" 20:24
Eclesia so I should not use any namespace while I'm in pir
20:29 soh_cah_toa joined
Eclesia sorear: (sorry to ask again) but what is the correct call to acces a global ? 20:29
dukeleto Eclesia: get_hll_global
Eclesia dukeleto: error:imcc:The opcode 'get_hll_global_s_sc' (get_hll_global<2>) was not found. Check the type and number of the arguments 20:30
in file 'Compiler.pir' line 33
sorear Eclesia: You need to use a P register
dukeleto Eclesia: yes, that means that get_hll_global doesn't take a string and a string constant (s and sc)
20:30 theory joined
sorear Eclesia: "Check the type and number of the arguments" 20:30
dukeleto Eclesia: perldoc docs/compiler_faq.pod # get_hll_global is explained there 20:31
Eclesia sorear: if I obtain a $P then it's not a string value anymore ? 20:33
sorear it's a PMC wrapping a string value, yes
Eclesia I actually obtain the value "X364_ENCODE" when i print it
*damn*
sorear globals can only hold PMCs
use $P0 = box $S0 to wrap and $S0 = $P0 to unwrap 20:34
('$P0 = $S0' means something unrelated, so don't)
Eclesia hm ... it's not better then calling X364_RED() after all :(
sorear it'll be much faster 20:35
pir sub calls are twice as slow as perl 5 sub calls IME 20:36
Eclesia sorear: writing : 20:38
$P5 = get_hll_global ["x364"], "RED"
$S5 = $P5
each time I want some red text is painfull ... 20:39
jnthn__ So...why are you writing in assembly language? 20:40
Eclesia because I dont want to learn N language to write my own
jnthn__ heh. :) 20:41
dukeleto Eclesia: go learn about .macro
Eclesia: you can write a PIR macro to save your wrists :)
jnthn__ Writing so much in PIR is one of my main regrets about Rakudo.
We've finally managed to get off it.
Eclesia *another one, going to dye before writing my syntaxe parser* 20:42
dukeleto Eclesia: ack '\\.macro' docs/
Eclesia: if you want to use a core parrot language, NQP is a lot friendlier, and Winxed is now is Parrot core, but hasn't been in a public release yet
Eclesia PIR is more friendly then nqp 20:43
*that's my opinion* 20:44
moritz fsvo "friendly" :-)
dukeleto Eclesia: sure, I understand that. Friendliness perceived is a function of previous experience.
Eclesia: NQP is only friendlier than PIR if you are familiar with Perl 5/6. If you are familiar with assembly, PIR feels pretty comfortable.
Eclesia I'm from java ecosystem remember ^^ 20:45
dukeleto Eclesia: ah. Well Winxed looks much like javascript, so that might appeal to you 20:46
Eclesia (but did a bit of asm for pic microships, I guess that's why)
dukeleto hopes that he doesn't break master
dalek rrot: 87aa6b9 | dukeleto++ | t/src/embed/api.t:
Remove some unnecessary variables
rrot: b1f21f2 | dukeleto++ | t/src/embed/api.t:
Increase embed/api test coverage
rrot: 3f7b5d3 | dukeleto++ | src/extend.c:
Refactor duplicated context popping code into a macro
rrot: 46a1347 | dukeleto++ | t/src/embed/api.t:
Add coverage to Parrot_api_flag
rrot: 14a15f1 | dukeleto++ | t/src/embed/api.t:
Add test coverage for Parrot_api_unwrap_pointer
rrot: 2266398 | dukeleto++ | t/src/embed/api.t:
Add coverage to Parrot_api_flag
rrot: 7c4b6f8 | dukeleto++ | t/src/embed/api.t:
Add a test for Parrot_api_reset_call_signature
rrot: c9c5a00 | dukeleto++ | / (2 files):
Decorate some embed api functions and rerun headerizer
rrot: 1d956c5 | dukeleto++ | t/src/embed/api.t:
Fix type conversion compile error
rrot: 1e48904 | dukeleto++ | t/src/embed/api.t:
Add test coverage for Parrot_api_get_exception_backtrace
dukeleto darn.
dalek rrot: a418dad | dukeleto++ | t/src/extend.t:
Fix formatting
rrot: a0911db | dukeleto++ | / (2 files):
Fix bug in Parrot_sub_new_from_c_func cause by not using PARROT_CALLIN_(START|END) and attempt to add test coverage
rrot: 3693897 | dukeleto++ | src/extend.c:
Add many missing PARROT_CALLIN_(START|END) macros to src/extend.c
rrot: cf41a69 | dukeleto++ | .gitignore:
Add more code coverage ejecta to .gitignore
Eclesia dukeleto: if I use winxed (which is more friendly for me I agree) won't it be even more efforts for the compilation ? isn't winxed code translated in pir before compilation ?
dukeleto evidently, dalek didn't like that I forgot to do a --no-ff, dukeleto--
20:48 jsut joined
dukeleto Eclesia: sure, but you can generate bytecode once (.pbc file) and then run that many times, and never pay the parse cost, only the runtime cost 20:48
Eclesia hm... and I could use whiteknight rosella lib 20:49
dukeleto Eclesia: yes. Rosella is the bees knees. It saves you a lot of time and gives you the basics that everybody wants and needs.
Eclesia: what exactly are you working on, may I ask? 20:50
Eclesia something strange ^^ a multi-syntaxique programming model
dukeleto hopes that the above merge finishes his TPF grant, and waits for the official coverage reports to update 20:51
Eclesia I want to leave the Java world. so I thinked about different solutions, and ended with a document of ideas describing a standard projet organisation with several syntaxes and paradygms 20:52
And I want to see if it works
dukeleto Eclesia: interesting
Eclesia: is it on github?
Eclesia nope mercurial, bu only on a private server 20:53
but*
20:53 jsut_ left
dukeleto Eclesia: release early and often is my motto 20:53
Eclesia: also known as "publish or perish" in academia ;) 20:54
Eclesia it's a personal project.
dukeleto Eclesia: gotcha
Eclesia I know what it is to maintain a project alone : puzzle-gis.codehaus.org :p
dukeleto Eclesia: what exactly are you using Parrot for? Just trying to understand. 20:55
ttbot Parrot cf41a691 MSWin32-x86-multi-thread make error tt.taptinder.org/cmdinfo/22985
dukeleto darn.
Eclesia dukeleto: I am working in Geographic information systems. (GIS) but Java is getting more and more private, and JVM implementation are slowly disapearing. So before it's too late I want to have a replacement solution and a reliable core library for GIS. 20:57
dukeleto: that mean : having image readers and opengl 20:58
dukeleto: and somekind of java/C# language available
dukeleto: am I dreaming ? :-D 21:00
dukeleto Eclesia: cool. That sounds awesome. Would this interact with OpenStreetMap ?
tadzik squaak! o/
dukeleto Eclesia: sounds like a nice dream, I will do what I can to help 21:01
Eclesia dukeleto: sure, I already written java code to communicate with OSM
can code anything in gis, has long as I have solid core libraries 21:02
as*
dukeleto Eclesia: awesome. I would very much like to see Parrot and OpenStreetMap talk to each other
dukeleto attempts to fix master on win32 21:03
Eclesia osm is one of the easiest gis server schema ^^ wms, wfs, csw ... (all other ogc/osgeo spec) are harder
dukeleto Eclesia: good to know 21:04
dalek rrot: 782bf96 | dukeleto++ | src/extend.c:
Attempt to make the MSWin32-x86-multi-thread ttbot happy by ANSI-89-ification
21:06
dukeleto mj41++ # ttbots are useful
Eclesia dukeleto: imageshack.us/photo/my-images/580/c...redfd.png/ 21:08
dukeleto Eclesia: looks shiny 21:10
Eclesia more funny to look at in a polar projection. osm only provide a single projection, so on the client side we transform tiles when rendering 21:13
imageshack.us/photo/my-images/97/ca...e1jka.png/
well. time to go. see you later and thanks for the help dukeleto and sorear 21:14
21:14 Eclesia left
dalek a: 2792a9d | fperrad++ | lua/lib/luabasic.pir:
fix after github.com/parrot/parrot/commit/6a...2471331595

  (.annotate file)
21:16
bubaflub www.splitbrain.org/blog/2011-06/19-...l_requests - command-line script to examine GitHub pull requests 21:22
21:23 ambs left 21:33 contingencyplan joined, PacoLinux left
dalek rrot: 0893012 | fperrad++ | compilers/pct/src/POST/Compiler.pir:
[pct] properly escape annotation
21:41
21:42 PurityControl joined, fperrad left 21:47 Patterner left, PurityControl is now known as Patterner
dukeleto bubaflub: tools/dev/merge_pull_request.pl 22:25
bubaflub dukeleto: what sorcery is this?!?!
dukeleto bubaflub: my special kind
bubaflub dukeleto++
dukeleto yay, ttbot seems to be happy": 22:27
blarg: tt.taptinder.org/cmdinfo/23141
bubaflub nice, the windows build is fixed? 22:29
dukeleto bubaflub: what are you hacking on?
bubaflub dukeleto: GSoC stuff, eventually back to Math::Primality stuff. i've got a number of ideas to implement some nice algorithms - maybe not fast but certainly clean and verifiable
dukeleto: at work i'm doing some stuff with Catalyst; i'm also interested in maybe hacking on NYTProf - i saw an exchange on twitter about getting a stand-alone webserver bundled with NYTProf so you could view the results in a browser locally 22:30
dukeleto bubaflub: where are you in parrot-gmp-land? 22:32
bubaflub dukeleto: the PIR bindings, the inline docs, and the Winxed class are all generated from gmp.h and the documentation (gmp.html). test suite is more than half way done. all tests pass except for one that segfaults, which i'll look into shortly. 22:33
dukeleto: blogged yesterday (www.parrot.org/content/parrot-gmp-more-tests) about where i'd like to end up by midterm 22:35
dukeleto reads 22:37
bubaflub dukeleto: i'm heading out for a bit, but i'll be back in a few hours if you'd like to chat more / skype 22:38
dukeleto bubaflub: okey dokey 22:39
lucian: how goes puffin?
lucian dukeleto: uh, not great i guess
where to put names is not obvious in parrot, sadly 22:40
i'm working on improving the compiler (which can only do assignments with the object system so far) 22:41
but apparently i don't quite have good enough tests for the object system in the first place
dukeleto: a blog post will be delayed
i'll take a short 3-day vacation starting on tuesday
22:44 cjh left, cjh joined
dukeleto lucian: a very short blog post only takes a few mins... 22:44
lucian for which i will find time tomorrow :)
dukeleto lucian: and if you are hitting troubles, please send questions to parrot-dev too. Many useful and smart folks don't hang out on IRC much 22:45
lucian: let's try to skype after you get back from vacation 22:46
lucian dukeleto: perhaps i should. though i'm fairly convinced it just parrot being silly :)
s/it just/it's just/
dukeleto lucian: asking people often helps you figure it out yourself :) 22:47
lucian yes, most people said i should just use a hash
dukeleto lucian: hashes are nice and simple 22:50
lucian yes, but somewhat opaque
in fact, i could just use a python 'dict'
cotto ~~ 22:55
22:58 bubaflub left
dalek rrot: 4c05d38 | mikehh++ | MANIFEST.SKIP:
re-generate MANIFEST.SKIP
23:01
rrot: 037628f | mikehh++ | src/extend.c:
wrap macro arguments
23:14 whiteknight joined 23:33 daniel-s joined
NotFound ~~ 23:33
mikehh All tests PASS (pre/post-config, make corevm/make coretest, make world/make test, fulltest) at 3_4_0-290-g037628f 23:38
Ubuntu 11.04 i386 (g++)
stoopid t/pmc/threads.t failed first time around in testf with a segfault but passed when I re-ran fulltest 23:39
(and make testf) which takes quite a bit of time 23:40
I am pretty sure that the failures (very intermittent) are timer related (I nearly always run with TEST_JOBS=4) 23:41
23:42 ligne left
mikehh NotFound: what are you doin' up at this hour, (I am doing some test related work on a Server that is only available to me at this time) 23:44
23:45 perlite left
NotFound mikehh: just arriving home and relaxing a bit before going to sleep. 23:45
After 5 hours driving. 23:46
mikehh NotFound: I try and avoid too much of that, almost had to drive down to Edinburgh today, which is nearly 3 hours each way 23:48
NotFound mikehh: life sometimes make its own plans. 23:49
mikehh NotFound: you better believe it :-}
23:50 lucian left
nopaste "soh_cah_toa" at 192.168.1.3 pasted "Test Failure for pbc_disassemble" (100 lines) at nopaste.snit.ch/53338 23:50
soh_cah_toa any input on that would be appreciated 23:51
mikehh soh_cah_toa: the function of src/checkdepend.t is to make sure the makefile builds the necessary dependencies before it is used if running make -j(n) 23:57
so what it is telling you is that you need to specify other dependencies in the makefile 23:58
soh_cah_toa hmm...
i thought i listed all my dependencies though
well, obviously not but i don't know what else it depends on 23:59
mikehh you probably missed one of them