Parrot 3.4.0 released | parrot.org | Log: irclog.perlgeek.de/parrot/today
Set by moderator on 17 May 2011.
lucian dukeleto: heh, now it actually works in parrot. just printed 3 00:01
bubaflub lucian++ 00:04
lucian this at least made me sure which testing framework i want 00:05
py.test can easily integrate external tools (in this case parrot)
00:27 kid51 joined 00:50 preflex left 00:53 preflex joined
tcurtis lucian++ 00:54
lucian thanks. i've realised that testing generated code is hard, and a little silly 00:55
tcurtis lucian: How are you doing your codegen, ooc? 00:56
lucian tcurtis: an AST walker written in python bitbucket.org/lucian1900/puffin 00:58
hmm. can i get 'parrot' to run a string instead of a file? 00:59
tcurtis lucian: Why did you decide on directly generating PIR? 01:04
01:05 davidfetter left
lucian tcurtis: the other option was winxed. i figured i'd have to override a lot of winxed semantics 01:05
tcurtis lucian: As far as I can tell, Winxed doesn't really have much in the way of semantics beyond those of Parrot itself. Why not PAST? 01:06
lucian tcurtis: can't get at PAST from python
tcurtis lucian: Would you use it if you were able to? 01:10
lucian tcurtis: i guess. ast->ast is shorter than ast->assembly
tcurtis: i'd need a textual representation for PAST that's easy enough to generate 01:13
tcurtis lucian: I'm considering writing a parser for such. I don't expect it would be especially complicated. 01:15
01:17 bubaflub left
lucian tcurtis: that might help. i'm not promising i'll use it, though :) 01:18
so far PIR seems ok
tcurtis lucian: no worries. Even if you don't, I expect someone might find use for it eventually.
lucian nods 01:20
01:20 bubaflub joined
lucian i don't know PAST very well to suggest a good format 01:20
s-exps, json and xml were suggested
yaml too
kid51 commit 8c04cc3e6: make test PASS on Darwin/PPC; make fulltest pass on linux/i386 01:24
01:26 mikehh left 01:39 bubaflub left 01:45 bubaflub joined, bubaflub left 01:53 lucian left, kid51 left
soh_cah_toa discovers the power of ctags and NERD tree 02:22
02:40 mikehh joined
cotto ohai 02:43
this feels like the first time I've been still all weekend
soh_cah_toa cotto: busy weekend? 02:45
cotto soh_cah_toa, unusually full 02:47
I'm glad I have Monday off.
full of good things though. I've got a small mountain of topics to blog about now. 02:50
02:54 woosley joined
soh_cah_toa cotto: m0 stuff, i presume? 02:58
cotto soh_cah_toa, among other things
soh_cah_toa, do you have any blockers? 03:04
soh_cah_toa cotto: hmmm...kinda maybe. i think i understand where to go now w/ breakpoints (see my blog). now i have to actually take that idea and make into something 03:07
cotto oh good. you blogged
soh_cah_toa++ 03:11
03:18 preflex left 03:20 preflex joined 03:21 hudnix left
cotto soh_cah_toa, who's Michael Fair? 03:23
soh_cah_toa cotto: no idea. he says he doesn't frequent irc much anymore but emails occasionally 03:24
cotto: he's crazy smart though. i'll forward that email 03:25
cotto soh_cah_toa, sweet
The name doesn't ring a bell, but I like smart people. 03:26
I keep hoping the smart will rub off on me, but I usually just end up confused and disoriented.
soh_cah_toa ha
it was nuts. he just popped up out of nowhere w/ this really long and detailed message about parrot and debuggers 03:27
cotto great
03:33 wagle_ left
soh_cah_toa btw, i've been meaning to ask someone...what are all these installable_* executables for? obviously, they are "installable" but don't you just run 'make install' to install these? 03:33
03:34 wagle joined
cotto those are the files that make install installs 03:36
so yes
soh_cah_toa so 'make install' creates installable_foo in addition to /usr/bin/foo? 03:38
cotto make creates the file, make install installs it 03:39
soh_cah_toa oh 03:40
that seems kinda weird though. what if i don't want them installed? now i have all these file cluttering my directory anyway. i don't think it was always like that, was it? i started seeing them around 3.3.0 03:41
cotto or not
I was wrong. make install builds and installs the installable_* files 03:42
soh_cah_toa installs them as /usr/bininstallable_* or /usr/bin/foo? after installing to /usr/bin does it still leave installable_* hanging around? i'd do it myself but i think i installed from rpm and don't wanna mess it up 03:45
cotto the location depends on how Parrot was configured, but the installable_* file do stick around in the build dir. 03:46
soh_cah_toa alright. good, i can get rid of these annoying things then 03:49
cotto anything that's generated by a make target can be safely deleted 03:51
soh_cah_toa would 'make clean' take care of that? i'm always afraid to run that command 03:53
cotto why?
yes 03:54
soh_cah_toa i'm afraid i'll mess things up and have to rebuild or reinstall or something. i never know what it "cleans". the Makefile only says "basic cleaning up." 03:55
cotto I have "maek" aliased to make in case I mess up. 03:56
sometimes I try to type maek and type make by accident 03:57
I don't understand the concern. If make clean or realclean deletes anything important, that's a bug. 03:58
soh_cah_toa it also means bye bye "something important" 03:59
cotto that's what git is for
if you have something important that's not in version control, that's also bad
dukeleto Interesting language I've never heard of before: lisaac.org 04:00
04:00 jsut_ joined
dukeleto has m aliased to make, for maximum laziness 04:00
and g for git
soh_cah_toa wow
yeah, that's lazy
dukeleto soh_cah_toa: if you think of how many thousands of times you type "git", typing "g" is a huge savings 04:01
cotto sites that have scrolling content make me sad
adding it to your bash completions isn't too hard, so you don't even have to sacrifice those
(it = "g as an alias for git") 04:03
soh_cah_toa aliases are great. i have proot aliased to take me back to the parrot root directory 04:04
cotto you only have one parrot root? ;)
04:05 jsut left
soh_cah_toa sproot is for soh-cah-toa/parrot, proot is for parrot/parrot 04:06
cotto ha 04:07
ah
I can't even type a two-letter word correctly.
soh_cah_toa sproot. that's sounds pretty ridiculous if you try to say it
cotto delightful word
soh_cah_toa you should alias h='ha' 04:08
cotto um... 04:09
soh_cah_toa yeah, i know. it's late 04:11
and on that note, i shall leave 04:13
see you tomorrow 04:14
04:14 soh_cah_toa left
dukeleto cotto: i wrote up a bunch of stuff about the M0 meeting. Need to digitize it. 04:19
04:19 woosley left
cotto dukeleto, awesome. I was trying to be lazy by making the gist my primary source, but I still ended up writing a bunch of notes during my free time today. 04:20
dukeleto cotto: do we want a bytecode verifier? www.informit.com/articles/article.a...p;seqNum=2 and www.ebb.org/bkuhn/articles/thesis/node8.html are good explanations 04:28
cotto I remember looking for links like those but not finding anything. 04:30
dukeleto cotto: here is how the Dalvik bytecode verifier works: www.netmite.com/android/mydroid/dal...ifier.html 04:32
cotto dukeleto, is that intended as a good or a bad example?
It'll be a good read either way. 04:33
dukeleto cotto: and here is the dalvik bytecode reference: www.netmite.com/android/mydroid/dal...ecode.html 04:35
cotto brain overflow; core dumped
dukeleto cotto: lulz 04:36
cotto: haskell bytecode verification! www.cs.princeton.edu/~rdockins/pres...show.xhtml
"You end up with an intermediate language capable of encoding 04:37
most of Haskell which has a strong metatheory."
sounds suspiciously like what we are doing with M0
cotto a bytecode verifier is starting to sound like more than a good idea 04:41
depending on whether we expect m0b to be distributed or not
dukeleto cotto: i was thinking, if we take a sha1 hash of some type of verification metadata, we could distribute "verified" code 04:42
cotto: i.e. verification wouldn't necessarily need to happen at runtime 04:43
cotto dukeleto, that idea suggested itself to me too 04:44
I suspect that it defeats the purpose of verification though.
The idea behind verification is that you know that this random m0b file you got with your copy of Bonzi Buddy is safe to run. 04:46
or that it at least won't crash the interpreter while it's stealing all your personal information 04:47
04:58 woosley joined 06:08 davidfetter joined, davidfetter left 06:17 Kulag left, Kulag joined 06:38 jsut joined 06:43 jsut_ left 06:45 fperrad joined 07:27 SHODAN joined 07:28 jsut_ joined 07:32 jsut left 07:36 mj41 joined 08:04 ligne left 08:22 he joined 08:30 bacek joined 08:57 jsut joined 09:02 jsut_ left 09:31 nopaste left, TonyC left, TonyC joined 09:34 woosley left 09:35 nopaste joined 09:38 lucian joined, nopaste left, TonyC left, TonyC joined 09:45 nopaste joined 09:53 bacek left 10:05 bacek joined 10:06 contingencyplan left 10:09 ligne joined 10:10 lucian left 10:12 lucian joined 10:28 bacek left 11:05 whiteknight joined
whiteknight good morning, #parot 11:19
or #parrot
lucian whiteknight: 'morning 11:28
whiteknight hello lucian
11:29 dodathome joined
lucian whiteknight: i have a compiler for a subset of python that can add numbers. ain't that grand ... 11:29
whiteknight lucian: yes, I saw that yesterday. Very nice 11:30
lucian whiteknight: meh :)
whiteknight lucian: it's only been a week into GSoC. Nobody expects the Taj Mahal 11:31
lucian i'm gonna start with the object system next, there's little point in following pynie's mistake
whiteknight at least, no yet :)
lucian whiteknight: i'll have a look at your rosella trick
whiteknight okay, it's interesting but I'm not currently happy with it 11:32
lucian (btw, pynie's mistake imo is not doing an object system earlier)
whiteknight right
lucian python is quite self-referential. objects need dicts, function calls need tuples, lists, dicts, etc.
i think i'll end up only using winxed for syntax support 11:34
and introduce some inline PIR in the compiler, so i can write the stdlib in python
whiteknight: i'd previously assumed special-casing compiler tricks would be hard, but it's not, at all 11:36
11:38 dodathome left
arnsholt lucian: Like whiteknight I'm suitably impressed with a compiler that can add numbers after a week 11:49
Compilers are fickle beasts =)
lucian arnsholt: well, a day. but don't, i'm not writing a parser bitbucket.org/lucian1900/puffin
it's really tiny
arnsholt Tiny is good. Easier to work with that way 11:54
lucian sure. i'm just writing a codegen for an existing parser 11:55
12:15 lucian left, lucian joined 12:23 lucian left 12:36 kid51 joined, lucian joined
lucian hmm, i'm starting to wish parrot bundled winxed 12:37
12:41 bacek joined 12:47 hudnix joined
whiteknight lucian: welcome to the group. We meet on wednesdays 12:53
lucian: I started adding some library routines inspired heavily by Python's os and sys modules
12:53 bluescreen joined
whiteknight I was reading my python book, decided it was a good idea, and put together a quick version of os.path.walk 12:54
lucian whiteknight: that's a bit ironic, most people dislike os's path bits
whiteknight I dislike Parrot's current OS PMC, so anything is a step up
lucian i see 12:55
whiteknight I thought os.path.walk was pretty nifty
lucian i guess i'm spoilt 12:59
try this: bla = os.path.join(os.path.expand('~'), '.local'); f = open(bla) 13:00
vs f = open(path('~/.local'))
tadzik what kind of thing is os.path.walk? Like File::Find in Perl, a directory traverser 13:01
lucian tadzik: don't know about perl's, os.path.walk is just a recursive walker 13:03
dalek sella: 5db9824 | Whiteknight++ | t/filesystem/ (2 files):
Add in some basic tests for File and Directory
sella: eee95de | Whiteknight++ | src/unstable/filesystem/Directory.winxed:
make sure directories have a trailing slash
sella: 6a3688b | Whiteknight++ | src/unstable/filesystem/Directory.winxed:
Add Directory.get_pmc_keyed, so we can look up contents by name
sella: a10746d | Whiteknight++ | / (2 files):
Add exists_keyed and delete_keyed vtables to Directory, so we can work on it more like a hash
sella: e808370 | Whiteknight++ | src/unstable/filesystem/Directory.winxed:
some docs for the new functions
13:08 ambs joined
lucian where could i get a precompiled winxed? 13:27
whiteknight I could send you one 13:29
or, I could send you the .pir
lucian whiteknight: pir is fine. it refuses to bootstrap on this netbook
i admit i don't really understand NotFound's wish to keep the boostrapping 13:30
i'd just dump C++ and ship compiled versions 13:31
whiteknight I have to decipher the makefile, to make sure I'm sending you everything 13:33
lucian right. thanks
oh, wait
silly me
no need to bother, i can use the x86 machine to build it first
then move the pir over 13:34
whiteknight oh, I just sent the mail 13:37
do you have setup.pir in your winxed repo? 13:38
or is that bootstrapped too?
lucian whiteknight: haven't checked, i just replaced it with the one built on x86 13:39
whiteknight ok
I don't think there is any way to reset a coroutine 13:42
and that makes me a sad panda
lucian uh, should there be? why not just make a new one? 13:43
oh, and i have a working winxed. finally
it should *really* be bundled with parrot
whiteknight my thoughts exactly
lucian what'd take to get that done? 13:44
whiteknight NotFound's blessing, dark magic
lucian NotFound: bless our endeavour, oh holy one
what kind of dark magic?
i thought nqp was bundled
whiteknight I don't remember the details. I'm out of sacrificial goats, so it doesn't matter anyway 13:45
lucian i see
whiteknight nqp is bundled. It's really not that hard to do
Bring up the topic this week at #parrotsketch 13:46
lucian if i remember, i will
whiteknight msg NotFound we would like to talk about snapshotting Winxed into Parrot, since so many GSOC students are using it. Let me know what you think 13:48
aloha OK. I'll deliver the message.
nopaste "kid51" at 192.168.1.3 pasted "Quoted verbatim from the front page of news.google.com" (1 line) at nopaste.snit.ch/48685 13:49
whiteknight awesome 13:51
13:53 hudnix left 13:54 Limbic_Region joined 13:56 kid51 left 14:00 SHODAN left
cotto ~~ 14:45
14:45 lucian left 14:46 lucian joined 14:55 gbacon joined
lucian is there a winxed vim plugin? 15:03
eh, js is alright 15:12
whiteknight: i don't think i'll use your prototype 15:40
15:48 bubaflub joined
bubaflub ~ 15:48
lucian i can't make heads or tails of winxed error messages 16:13
dalek p: 1c65083 | jonathan++ | src/6model/reprs/P6opaque.c:
Update P6opaque to more fully handle box/unbox of native types.
16:17
16:26 bluescreen left
whiteknight lucian: yeah, winxed error reporting leaves much to be desired 16:40
lucian: I don't expect you'l be able to use the rosella version verbatim, but I think you can steal some ideas from it 16:41
lucian: and feel free to ask questions if any detail doesn't make a lot of sense
16:41 bluescreen joined 16:43 mj41 left 16:54 lucian left 16:55 lucian joined
cotto dukeleto, ping 17:27
whiteknight, also ping
whiteknight PONG
pong
(sorry for yelling)
cotto whiteknight, on Saturday chromatic mentioned an interesting possibility for gc. he suggested that it be made essentially a link-time option, i.e. that the .o file for the requested gc would be linked into libparrot 17:28
whiteknight cotto: yeah, I've considered that before too
cotto also, that we make macros the interface to the GC rather than functions that limit optimization possibilities 17:29
whiteknight our current system of function pointer indirection is very bad
cotto for the gc, quite
whiteknight you're still going to need a standard function API for the .o file to be linked against
but yes, we can do much better
cotto not necessarily a function api
whiteknight a linker isn't going to work with macros 17:30
somewhere along the line we need functions to link by name
cotto no, but the object file can be generated just fine with macros as part of the C code
17:31 lucian_ joined
whiteknight yes 17:31
cotto I'm not seeing the problem, apart from requiring a bunch of fairly monotonous code changes. 17:34
whiteknight no, there's no problem 17:35
cotto on
17:35 lucian left
cotto ok 17:35
whiteknight I could put together something benchmarkable soon
brb, I have to take the kid to the park 17:36
cotto It might be a good task to increase the bus number on the gc.
whiteknight be back in ~1hr
cotto have fun
or don't. your call
lucian_ anyone using winxed's HLL syntax? i can't figure it out and the example doesn't even compile 17:44
17:44 lucian_ is now known as lucian 17:55 mj41 joined 17:56 davidfetter joined 18:02 contingencyplan joined
whiteknight lucian: no, I haven't used it yet 18:08
dukeleto ~~ 18:09
lucian whiteknight: guess i'll have to wait for NotFound, which cannot be found
dukeleto cotto: pong
lucian btw, if you're interested in python's object system, this is great www.cafepy.com/article/python_types...c-concepts
whiteknight lucian: hmm, that looks like a weird bug 18:10
lucian whiteknight: try running examples/hlltest.winxed 18:11
it has an unbalanced brace
and i don't know what else is wrong with it
cotto dukeleto, what we've been thinking about for m0b security is more like checksumming. If m0b is going over the wire (still an open question) and a mitm can intercept it, it'll be fairly easy to modify the file and re-sign it. 18:14
I like the idea of an embedded checksum to verify that the file didn't get corrupted, but we shouldn't call that security. 18:15
If we want actual security such that a m0b file can't be tampered with without evidence, we'll need something more.
lucian cotto: i don't understand the need for that
cotto: why not leave security to the transporting protocol? 18:16
18:17 davidfetter left
whiteknight yeah, that's my opinion too. Encryption and signing are part of the transportation protocl 18:19
protocol
checksumming is interesting to verify against transmission errors, but nothing more than that should be built in to M0
cotto whiteknight, I'm coming to that conclusion too. 18:20
whiteknight we aren't going to come up with anything as good as existing standards like SSL or PGP
cotto no argument there
whiteknight nor any set of stuff as flexible as existing protocol options 18:21
cotto that also gets into the issue of key distribution
lucian i do however think that w/e bytecode parrot ends up with as an equivalent to java bytecode should certainly be endianess-agnostic 18:22
cotto lucian, it's still not fully decided if we expect m0b to be distributed. If we do, it should run everywhere. 18:24
dukeleto cotto: SSL and PGP still have the key distribution problem, so that is a straw man ;)
cotto: i am fine with M0 just having checksumming, for now 18:25
lucian cotto: well, what else should be distributed as executables?
cotto flash--
lucian dukeleto: i disagree even with that :)
dukeleto cotto: because baking in proper crypto will take a nontrivial amount of time
lucian dukeleto: again, i don't see why checksuming should be done in an assembly/bytecode format 18:26
dukeleto lucian: because harddrives corrupt data, network protocols fail, OS kernels have bugs, and neutrinos occasionally flip a bit 18:27
lucian whiteknight: a winxed tutorial/ref would really be useful, i can't figure out which are class attributes and which are instance attributes
dukeleto: sure, but why do it there? why not on top, like everything else? 18:28
whiteknight lucian: yes, adequate documentation is not one of the strong points of winxed
dukeleto lucian: i have no idea what you mean
cotto lucian, laziness
dukeleto goes back to his writing cave
lucian why not just hand parrot the bytecode, after checksuming it?
s/parrot/the interpreter/
18:33 soh_cah_toa joined
dukeleto lucian: Use case: I distribute an application written in some Parrot language. I want to distribute bytecode. The user wants to verify that the bytecode was not mangled in the process of downloading it. 18:34
lucian dukeleto: is it considered undesirable to leave it to the user? 18:36
i'm trying to think of advantages and disadvantages to embedding it in the bytecode
dukeleto lucian: yes, leaving it to the user is undesirable 18:37
lucian wow, how useful "syntax error ... somewhere "
dukeleto imcc-- 18:38
lucian imcc-- indeed
dukeleto cotto: this is my rough draft: github.com/leto/writing/blob/maste...meeting.md 18:42
lucian are Object attributes always private?
cotto reading now 18:44
dukeleto lucian: not that i know of 18:46
cotto dukeleto, it'd be good to specify some of the reasons we ripped out the old jit. It's a fading memory at this point and many more recent developers are likely to be unfamiliar with the rationale.
lucian dukeleto: i'm trying to access one in winxed and i get "error:imcc:The opcode 'getattribute_p_ic_sc' (getattribute<3>) was not found."
dukeleto cotto: sure. I will add some deets 18:47
lucian: that signature for getattribute doesn't exist i.e. PMC = getattribute integer_constant, string_constant
lucian: you need to box or autobox something 18:48
s/autobox/unbox/
lucian dukeleto: hmm. i'm trying to print a Hash. is that naughty ?
cotto dukeleto, " that their were many"
18:48 hudnix joined
lucian i think pdd15 lies a lot 18:51
dukeleto lucian: patches welcome 18:52
cotto: reload. Added details about JIT and fixed some grammerz
lucian dukeleto: ah, but that means i'd have to figure out what exactly is true :) 18:53
cotto hands lucian some work gloves 18:54
dukeleto lucian: indeed. But we take our PDDs seriously, so we want them to be correct. But figuring out *what* is correct is sometimes quite complicated.
cotto The closer we get to integrating M0 with libparrot, the more important it'll get to have 6model in core. It's not an immediate blocker, but has the potential to be. 18:55
dukeleto, looking better 18:56
dukeleto, "fact tha too much" 18:57
dukeleto installs ispell 18:58
lucian cotto: i think i'd welcome 6model right about now
18:59 jsut_ joined, jsut left
cotto <3 ispell 18:59
ambs <3 jspell 19:02
dukeleto i guess it is a sign of the times that i had to teach my spell checker more words than it found incorrectly spelled. 19:21
19:24 mj41 left 19:28 Limbic_Region left
lucian boostrapping myself out of the Object tarpit is really annoying 19:32
jnthn__ Tell me about it. :P 19:34
jnthn__ had to bootstrap nqp out of it...
lucian jnthn__: i guess i'll try 6model, i have a week scheduled for deciding 19:35
jnthn__: how should i go about doing that?
is it this github.com/rakudo/rakudo/tree/mast...metamodel? i'm a bit confused 19:36
jnthn__ lucian: That's nqp's meta-objects 19:37
lucian: They use the 6model core.
lucian: You have two options.
1) Write your meta-objects in NQP, thus in terms of NQP's meta-objects. This is what Rakudo is doing.
2) Just use the 6model core directly.
lucian i guess i'd rather do 2). any pointers?
i don't really know where to start 19:38
jnthn__ Actually reading through src/metamodel/ will give you an idea of what meta-objects look like 19:39
The main thing to realize is that knowhow and the stuff within it maps to a bunch of calls on a KnowHOW.HOW meta-object, which is the only one in the 6model core.
So you can piece together your case meta-objects as a series of method calls and do it from any language that lets you access PIR ops and load nqp_ops 19:41
s/case/base/
lucian hmm. so is all of 6model in the rakudo repo?
jnthn__ No 19:42
none of 6model is in the Rakudo repo :)
It's all in the nqp repo.
wait wait
lucian here github.com/perl6/nqp-rx?
jnthn__ When you said src/metamodel/, which repo did you mean?
github.com/perl6/nqp/ 19:43
gah
I shoulda noticed
lucian ah, so github.com/perl6/nqp/tree/master/src/6model
jnthn__ it's not even called that in the nqp repo
OK, so github.com/perl6/nqp/ is the repo you want.
Not nqp-rx or Rakudo one
github.com/perl6/nqp/tree/master/src/how is the meta-objects for NQP that you may find interesting to read through. 19:44
github.com/perl6/nqp/tree/master/src/6model is the 6model core.
19:44 bluescreen left
jnthn__ github.com/perl6/nqp/blob/master/s...elobject.h is one of the most educational files in there. 19:44
lucian jnthn__: so 6model is a C parrot extension 19:46
and i'd have to modify said extension to match python's object system?
are there any docs on this?
jnthn__ lucian: No, the idea is mostly that you write meta-objects using 6model. 19:47
lucian i'll have a look at nqp's
right, so there's this pm DSL for defining meta-objects? 19:48
jnthn__ The code in src/how/ is just NQP code. 19:49
You could define yours in that too, but it's not required.
It wouldn't surprise me if you could find a way to use 6model from Winxed.
lucian i'm still a bit confused :) 19:50
jnthn__ :)
lucian so nqp comes with a C extension called 6model
jnthn__ So the idea is that the 6model core is really like a set of very simple building blocks.
It doesn't know what a class is, or a subset type, or a role, or whatever.
lucian right. and what API does 6model offer? 19:51
jnthn__ The only things it knows about are representations (how we lay an object out in memory), a couple of types of performance-enhancing caches and the prototype-y metaobject (known as KnowHOW, for Perl 6-y reasons...).
lucian right, sounds good 19:52
jnthn__ So a starting point is to use the KnowHOW meta-object to start defining your own meta-objects that does your language's version of OO.
YOu'd also pick a representation that is suited to how your language wants to store attributes.
Basically, type = representation + meta-object.
lucian sure, makes sense 19:53
jnthn__ Actually 6model is built to support representation poly, but not many languages actually need that. What it does mean is you're not stuck using a storage model that doesn't suit your language.
lucian i don't care much about storage model efficiencu
i basically just need hashes and arrays 19:54
jnthn__ Well, it's not just efficiency.
It's also semantics.
Languages that view an object as basically a hash, so attribute foo in a sueprclass is the same as attribute foo in a subclass, fall neatly into "just use a hash".
But for other languages those are two different attributes and need two different storage slots.
That's a representation difference. 19:55
lucian sure, but it's not a big deal 19:58
whiteknight jnthn__: on a related note, one of my biggest difficulties in reading 6model source is the problem of terminology. my mind doesn't think in terms of the words Perl6 uses
lucian what i'd like to now is how to actually use 6model
whiteknight jnthn__: is there a handy cheat-sheet for what the various things in 6model mean?
19:58 bluescreen joined
lucian jnthn__: i can't figure out from reading the source what sort of API 6model offers, and to what language, for example 19:59
19:59 ligne left
jnthn__ whiteknight: No, but that's probably a good idea. 19:59
whiteknight jnthn__: for example, is the REPR the metaobject, or is that the REPR or the STable? 20:00
and what is a HOW, and a WHAT
lucian i agree with whiteknight here, i also find perl6's terminology odd
jnthn__ Well, it's not all Perl 6 terminology either.
STable isn't Perl 6 terminology. I needed a name for the concept. :)
whiteknight when it gets moved into Parrot, we're either going to need a handy translator, or we're going to want to change what some things are called to a more language-agnostic lexicon
jnthn__ OK, so I need to write a glossary. :)
whiteknight jnthn__: pretty pretty please, with karma on top :) 20:01
dukeleto ++jnthn # 6model glossary
jnthn__ will get started on multi-dispatch refactor for Rakudo, and then do a bit more docs later on :) 20:02
whiteknight jnthn__: In case you were't aware, I am bumped off the 6model-to-parrot project and am focusing on profiling first 20:04
jnthn__: so when I get back to 6model, I'll have many many questions for you. I'm keeping a log of questions, which always seems to be growing :)
jnthn__ whiteknight: pmichaud has also threatened me with lots of questions in the coming days :) 20:05
whiteknight jnthn__: well, when he starts peppering you with them, I may want to watch and take notes 20:06
jnthn__ whiteknight: It'll at least end up as an FAQ. :)
whiteknight jnthn__++
pmichaud I'm expecting to redevelop lolcode in nqp in the next few days 20:08
hopefully as a tutorial, including the 6model aspects
whiteknight that would be awesome
jnthn__ pmichaud: object oriented lolcode :D
whiteknight right now it's just LOL-Oriented 20:09
jnthn__ HOW A dog WORKZ
HAZ tail
CAN bark()
... :)
whiteknight runtime type reflection with IM IN UR dog EXAMININ UR tail 20:10
jnthn__ dog DOEZ WUT? 20:11
whiteknight LOL NO
lucian bah, heavily self-referential object systems are really a pain to boostrap 20:19
i have 'object', which references 'type', which references 'object', which needs type from __builtins__, which is a model, which is an object, which has a type 20:20
s/model/module/
IM IN UR 'IM IN UR' EXAMININ UR 'EXAMININ UR' ...
20:22 perlite_ joined 20:23 baest left
whiteknight lucian: it is hard. that's why we pay the GSoC students to do it :) 20:24
lucian heh 20:25
tadzik tricky bastards
lucian hmm, apparently CPython fakes it bigtime
20:25 perlite left 20:26 perlite_ is now known as perlite
lucian that bastard Guido cheated :) 20:28
also, refcounting really is evil 20:29
whiteknight yessir 20:31
lucian and now watch carefully, as i pull the hat out of the rabbit out of the hat 20:36
any tips on "too few positional arguments: 1 passed, 2 (or more) expected" ? 20:37
20:40 bubaflub left
whiteknight is not sure he wants to see lucian pull the hat out of the rabbit 20:41
lucian: that is an arity failure on a PCC call. Could be a sub called with too few args, or a method executed without an invocant
since the invocant is the first arg
20:41 bubaflub joined
lucian whiteknight: ah, found it. a constructor. how do i pass arguments at construction in winxed, if you don't mind? 20:42
whiteknight lucian: new My.Example.Class(args) 20:43
constructors use the short-name of the class
so in the example above, the constructor would be "function Class(args...)"
lucian ah, so not passed to 'init'
thanks
whiteknight lucian: and I never mind answering questions
lucian: actually now that you mention it, I don't know how init_pmc would be called in winxed 20:44
lucian apparently it gets called at construction if you have function init[vtable]()
whiteknight yes, init[vtable]() would get called init_pmc[vtable]() would not 20:45
I have to figure out how to do that
var c = class My.Example.Class \\n var obj; \\n ${ new obj, class, initpmc }; \\n obj.Class(args...); 20:46
although that's hideous
lucian quite
i'm really starting to hate PIR's effects on HLLs
whiteknight msg NotFound is there a non-ugly way to call init_pmc[vtable]() in winxed?
aloha OK. I'll deliver the message.
whiteknight lucian: that's what I've been saying for years 20:47
PIR creates assumptions that other languages need to deal with
lucian nods
while writing the compiler part, i've been thinking of generating pbc
whiteknight we shouldn't have init_pir. We should maybe, *maybe* have a slot somewhere for storing a constructor PMC
init_pmc*
does 6model have storage for constructors? 20:49
lucian whiteknight: i'm trying to think of a case where a constructor should be anything other than just another function/method 20:50
whiteknight lucian: in some languages the constructor is not callable as a method after the language is created 20:51
lucian whiteknight: wouldn't hiding it still be better~?
whiteknight of course, we could achieve the same result if we could give constructors names which are not valid identifiers in the HLL
jnthn__ So you stash the constructor in the meta-object or something. :) 20:52
whiteknight .sub '!!CONSTRUCTOR!!'
jnthn__ has $!ctor;
lucian whiteknight: how about lisps? :)
whiteknight lucian: what about them?
lucian whiteknight: *everything* tends to be a valid identifier there
whiteknight lucian: .sub
.sub ')()())CONSTRUCTOR()()(' 20:53
lucian touchƩ
whiteknight it's doable, just not pretty
Rosella uses '!!!' as the prefix for attributes that I want to be invisible to user code
NQP and Winxed can't access them without dropping into inline PIR, for instance 20:54
I don't do that with methods just because there is no good way to define methods with weird names in Winxed
lucian hmm 20:55
doesn't [anon] do something?
whiteknight makes it so you can't look up something in the namespace 20:56
but if it's a method, it would still be findable with find_method
lucian i see
21:01 ShaneC joined
lucian whiteknight: how can i call super's constructor? 21:14
it doesn't seem to happen automatically
whiteknight as a method
no, it doesn't happen automatically
lucian so self.superclassname() ? 21:15
ah, that seems to work. thanks
whiteknight yes
Rosella used to have a construct_r function to recursively call constructors on all parent classes with the same args, but that wasn't too useful 21:16
lucian hmm. i agree with calling it explicitly, but i disagree with the method of finding it 21:17
whiteknight right, a super() method would be nice
lucian i guess Class doesn't support multiple inheritance?
or just super as a reference to the parent 21:18
whiteknight I could prototype something like that together, if you thnk you would want it
21:18 gbacon left
lucian nah, it works and i'm fine with it 21:18
whiteknight ok
lucian does rosella have any utils for printing things better? printing a hash is frustratingly useless
whiteknight it should, but it doesnt 21:20
there is a dumper module somewhere that can print out arbitrary neste structures
github.com/parrot/parrot/blob/mast...dumper.pir 21:21
21:21 ShaneC left
whiteknight probably "load_bytecode('dumper.pbc')" 21:21
lucian thanks, i'll try that
whiteknight then call it with "_dumper(thing)"
lucian nods
i think i've found a semi-elegant way to express boundless recursion 21:22
whiteknight do tell
do { tell(); } while(Whiteknight.is_listening());
lucian :) 21:23
www.cafepy.com/article/python_types...he-objects
the picture is helpful
for type's self-reference, i just use a self-reference ...
whiteknight ok
lucian i'll have to check when type() is called if i'm recursing, and that's about it
i can't believe it took me 30mins to realise i need no more magic 21:24
whiteknight magic--
lucian useful, that dumper 21:27
should be a PIR keyword, along with say
21:29 ambs left 21:34 theory joined 21:46 Psyche^ joined
lucian whiteknight: another one: is 'self' rebound in winxed closures? 21:49
21:50 PacoLinux left 21:51 Patterner left, Psyche^ is now known as Patterner 21:58 bluescreen left 22:01 ambs joined
cotto dukeleto, I'm going to be updating the M0 spec with a bunch of changes in the next hour or so. Do you have anything pending? 22:04
22:05 ligne joined 22:08 fperrad left
cotto dukeleto, ping 22:20
dukeleto, unping 22:21
dukeleto cotto: unpong 22:23
cotto dukeleto, I was thinking about the memory ops that we decided to add, but answered my own question
22:24 bacek left
cotto if a chunk from gc_alloc is reachable, a competent gc won't nuke it 22:24
dukeleto cotto: sure
cotto: i added the list of next actions and a few more paragraphs to the end of github.com/leto/writing/blob/maste...meeting.md
cotto dukeleto, just to verify, we decided to add sys_alloc, sys_free and gc_alloc as permanent ops, right? 22:25
dukeleto, I saw
dukeleto, make sure to put 6model as Parrot's core object metamodel in there sometime around noop integration. 22:26
dukeleto cotto: i think so. those will prevent the bytecode from depending on the gc currently being used, right?
cotto is performing a i/o on dukeleto
dukeleto does IO 22:27
cotto: i am going to add links to the blog post and then ship it
cotto dukeleto, it should. we may find that we need a richer set of controls, but that's a minimum
dukeleto++
also, "exit" was the temporary op that we couldn't think of 22:28
dukeleto cotto: ever heard of this? www.eecs.umich.edu/gasm/index.html 22:29
cotto: ah! good catch
cotto dukeleto, nope
lucian dukeleto: theoretically, it works
the issue is whether it has the potential for efficiency
(in general, for any turing-like machine i meant)
NotFound ~~ 22:34
22:34 ambs left
lucian NotFound: hi, i've been using winxed and have questions 22:35
NotFound lucian: shot 22:36
lucian NotFound: what's the syntax for .hll ? the example that comes with winxed's broken
NotFound Looks like I broke it in a recent change. Let me look at it. 22:37
sorear how does Winxed compare to PIR performance-wise? 22:40
lucian also, what's the syntax for calling methods on pmcs? self.hashvalue() for example doesn't work
sorear: same
22:40 elmex left
NotFound lucian: found and fixed, thanks. 22:41
cotto dukeleto, eliminating the variable table brings up a question since we're storing both string and numeric data in the variables segment.
dukeleto, how do we want to make sure both types can be loaded correctly?
lucian NotFound: oh, great. and is the syntax just namespace HllName [HLL] ?
NotFound sorear: in most usages I've done, the difference is negiglible. 22:42
lucian: yes, but remember that is an experimental feature, be ready for problems.
22:42 pjcj left
lucian NotFound: ok 22:42
whiteknight sorear: Winxed translates very cleanly to PIR code, so the two seem to have very similar performance
22:42 pjcj joined
lucian NotFound: in the worst case, i'll take winxed's output and move to PIR 22:43
NotFound lucian: How doe you have the 'self' of a PMC?
lucian NotFound: it's an object
since Objects are pmcs, i'd expect to be able to call pmc methods
dalek nxed: r1023 | NotFound++ | trunk/winxedst1.winxed:
fix a problem in the optimize phase of Modifier, lucian++
NotFound lucian: yes, you can, but The object that you are using has such method? 22:45
lucian NotFound: no, but the base PMC does 22:46
dukeleto cotto: please give me an example. I don't quite understand your quesiton.
NotFound lucian: oh, understood now. It should work, let me see an example that fails. 22:47
lucian NotFound: i'll write one, one sec
cotto dukeleto, sure. We're storing int 42 and string "forty-two" in the table. Loading the int is easy because we just copy the word into a register, but if we do that for the string we'll just get the first few bytes. 22:49
dukeleto, if we use a pointer for both, int manipulation will be inefficient
NotFound lucian: Now that I look at it, hashvalue is a vtable function, not a method. 22:50
lucian NotFound: i see. and how can i call those in winxed?
NotFound Mmmmm AFAIK there is no direct way to invoke it from pir. 22:51
lucian NotFound: oh. so i can't call vtable functions?
gist.github.com/999602 22:52
NotFound lucian: No, just the ones that have a pir op that directly calls it.
dalek rrot: 9f4f83c | dukeleto++ | docs/pct/gettingstarted.pod:
[doc] Fix some broken links in our PCT getting started doc
22:53
lucian NotFound: hmm. thanks
NotFound lucian: you can, for example, use the Parrot_PMC_hashvalue function via NCI.
lucian NotFound: and one more thing: would you be willing to include precompiled pir/pbc with winxed?
NotFound A bit convoluted, but should work.
lucian and/or have that snapshoted in parrot?
bah 22:54
NotFound lucian: I do.
lucian oh, you do? i must've missed that ...
i tried building winxed on my 800mhz 400mh ram netbook and it failed :)
NotFound lucian: if you install winxed with plumage, it uses a precompiler pir version to compile itself.
22:55 pjcj left, pjcj joined
lucian i see. so i should figure out plumage 22:55
oh, is it setup.pir ?
NotFound About including a snapshot in parrot, no problem for me. 22:56
lucian: setup.pir invoke it. You can use: parrot setup.pir install
The precompiled pir for the compiler and the driver are in the pir directory. 22:57
lucian found it
i guess i'm biased, i think parrot should really have a system language
hmm, i still get Null PMC access in find_method('optimizeargs') with "namespace Python [HLL] {..." 22:58
22:59 GodFather joined
NotFound lucian: the precompile versions is synchronized by hand. Until I update them, the recent fixes are not on it. 22:59
lucian NotFound: ah, i see
NotFound One moment....
lucian i can just make, i guess
NotFound make preinstall do that job.
lucian btw, i really like winxed :) 23:00
NotFound Full bootstrap is a risky business ;)
lucian i have an almost correct and almost working object model for python in 79loc
NotFound Good 23:02
whiteknight NotFound: I would really like to see Winxed be snapshotted in Parrot repo
We should bring it up in #parrotsketch tomorrow
(I won't be there, but my vote is strong +1)
cotto dukeleto, I'm thinking it may be necessary to have a separate copy_val and copy_ref ops for interacting with the variables table.
NotFound whiteknight: No problem for me, and also a +1 23:03
dukeleto cotto: hmm, perhaps.
lucian docs.parrot.org/parrot/latest/html/....pmc.html, find "hashvalue" 23:04
that's what i was trying to call
cotto dukeleto, either that or put some metadata into the variables (now a.k.a. constants) table.
dalek nxed: r1024 | NotFound++ | trunk/pir/winxed_compiler.pir:
update installable compiler
NotFound lucian: several PMCs have the sections in its POD doc highly outdated. vtable functions aren't called "methods" since log time ago, but... 23:05
lucian i see. bah
the address would serve me just fine as well. just need a unique number for an object 23:06
cotto NotFound, yeah. We've been trying to eliminate that for a long time, but it still persists. 23:07
NotFound lucian: I think rakudo had that same problem, don't know what are they using now. 23:08
lucian right now all objects have the very unique number 42
NotFound Is a good number, at least.
sorear looks like Rakudo uses $I0 = get_addr self 23:10
NotFound cotto: I think is a good time to quote the Jedi teachings...
bubaflub dukeleto: ping - question about some C-types and their equivalent NCI types
cotto NotFound, you want me to run around with a muppet on my back?
dukeleto bubaflub: pong
NotFound cotto: Yes please, an upload it to youtube. 23:11
23:12 GodFather left
cotto NotFound, you provide the muppet... 23:12
lucian NotFound: and ops i can only call with inline PIR, right?
NotFound cotto: I'll give you one at the first world winxed users conference.
lucian: yes 23:13
bubaflub dukeleto: i'm seeing an 'unsigned long int' in the source - that's just a long and hence an 'l' NCI type, right?
cotto NotFound, I'll be there.
NotFound lucian: that 79 loc are pure winxed, or using rosella prototype class? 23:18
lucian NotFound: pure winxed 23:19
NotFound Amazing
lucian nah, it's incomplete
dalek p: e08c5ca | jonathan++ | docs/6model/ (2 files):
Add a little 6model documentation.
lucian and it's that short because i'm not trying to use Objects much
for example, getting an attribute is obj.getattr('attribute')
the syntax is completely irrelevant since i'll be generating code to call these things 23:20
i can generate w/e i want
NotFound My experience with python is limited, I can't judge.
lucian NotFound: if you're interested www.cafepy.com/article/python_types...he-objects 23:22
NotFound lucian: I've read some articles on the subject, but reading articles is not enough experience, and I have other priorities. 23:25
lucian sure
in short, everything is an object, and objects are backed by hashes 23:26
bubaflub lucian: in python world is has == dictionary ? 23:27
NotFound I suppose the hard part can be using appropiate shortcuts in the most speed critical parts.
bubaflub lucian: s/has/hash/
lucian bubaflub: yes, dicts are hashes 23:28
NotFound: i don't care at all about speed right now
maybe later i will, but correctness is top priority 23:29
NotFound Good
lucian hmm "int a = ${get_addr s};" doesn't work 23:31
NotFound lucian: no, winxed pir ops are not expressions. You should use; int a; ${ get_addr a, s }; 23:32
lucian ah, i see
and it works! thanks 23:33
NotFound You can use expressions in the operands in most case, though. 23:35
whiteknight you can use expressions in the operands for inline pir? 23:37
NotFound whiteknight: in 'in' operands, in general yes, but it may be some exception. 23:38
whiteknight awesomeness
lucian here's what i'm doing bitbucket.org/lucian1900/puffin/sr...ect.winxed 23:39
NotFound That is the reason for not allowing key operands, syntax conflicts with expressions.
whiteknight lucian: is Puffin on github now?
lucian whiteknight: no
whiteknight lucian: where is it hosted? It should be somewhere public 23:40
lucian look up
whiteknight oh, bitbucket?
lucian yep
NotFound lucian: looks good
whiteknight why bitbucket, if I may ask?
lucian whiteknight: it's a good hg host 23:41
whiteknight ...and why hg?
lucian just because
it's more popular than git among python folk, i guess
i prefer it too, and so does the PSF
NotFound: btw, is there any string interpolation or similar in winxed? 23:42
adding strings isn't exactly fun
whiteknight lucian: okay, good enough reason
NotFound lucian: you can use a parrot StringBuilder
lucian whiteknight: i guess i could mirror it on github if you really wanted
NotFound: hmm, i'll try that. thanks 23:43
NotFound lucian: winxed compiler itself does that.
lucian i see. good
whiteknight lucian: the instructions email I sent out after the acceptance deadline mentioned that the code should be hosted at github 23:44
lucian: I'll talk to dukeleto about it, I'm not against making an exception if it makes integration with PSF code easier
NotFound I must leave now, good night.
lucian NotFound: g'night 23:45
whiteknight: ah, i must've missed that
whiteknight: done github.com/lucian1900/puffin 23:50
by the magic of hg-git.github.com/