»ö« | perl6-projects.org/ | nopaste: sial.org/pbot/perl6 | evalbot: 'perl6: say 3;' | irclog: irc.pugscode.org/ | UTF-8 is your friend! Set by Tene on 14 May 2009. |
|||
jnthn | lichtkind: The problem is that the class is globally modified. | 00:04 | |
In place. | |||
lichtkind | which is unclean | ||
jnthn | A form of action at a distance. | ||
Aye. | 00:05 | ||
OK, sleep for me... | |||
dobru noc | |||
00:11
omega joined
|
|||
omega | hms, did I flood? | 00:12 | |
lambdabot | omega: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
omega | ahh, it seems not :p | ||
00:14
amoc left
00:16
nihiliad1 joined
|
|||
lichtkind | dobrou | 00:20 | |
00:20
lichtkind left
00:21
nihiliad1 left
00:24
amoc joined
00:26
nihiliad left
|
|||
snarkyboojum | laku noc even | 00:37 | |
or dobar noc | |||
00:49
nihiliad joined
00:50
kate21de1 left
00:55
unitxt_ joined,
nihiliad left
01:01
eternaleye left
01:02
FurnaceBoy joined
|
|||
FurnaceBoy | The requested URL /pugs/docs/01Overview.html was not found on this server. | 01:02 | |
01:05
amoc left
01:06
unitxt left
|
|||
TimToady | looks like it should be docs/Pugs/01Overview.html | 01:09 | |
sjohnson | hot day today | 01:12 | |
01:16
amoc joined
01:20
eternaleye joined
01:23
amoc left,
amoc joined
01:27
Chillance joined
01:31
blas left
|
|||
DanielC | S22 says that YAML will be "available standard in Perl 6". What Synopsis talks about this? | 01:34 | |
JDlugosz | Hi guys. | 01:35 | |
01:47
unitxt joined
01:54
synth left
01:57
unitxt_ left
02:04
DemoFreak left
02:06
justatheory joined
|
|||
DanielC | @tell pmichaud The problem with the k-nucleotide benchmark is definitely the ++. If you replace for loop by a "loop ($i=0; ...; $i+=1)" and change the "%table{...}++" to "+=1" the program runs 3 times faster. | 02:10 | |
lambdabot | Consider it noted. | ||
02:13
azawawi joined
|
|||
azawawi | hi | 02:13 | |
02:13
frew|work joined
|
|||
DanielC | o/ | 02:15 | |
02:17
DanielC is now known as DanielC_zzzz,
jonathanturner joined
02:20
DanielC_zzzz left,
justatheory left
02:23
araujo left
02:24
araujo joined
02:25
araujo left
02:26
araujo joined
02:31
synth joined,
synth left
02:43
araujo left
02:44
araujo joined,
araujo left
02:45
araujo joined,
araujo left
02:46
araujo joined,
araujo left,
snarkyboojum left,
azawawi left
02:47
araujo joined
02:49
araujo left
02:50
meppl left
02:54
alanhaggai joined
02:56
araujo joined
03:01
wknight8111 joined
03:07
Chillance left
03:11
alanhaggai left
03:38
justatheory joined
03:40
agentzh left,
agentzh joined
03:44
wknight8111 left
03:50
xinming_ is now known as xinming
04:18
snarkyboojum joined
04:19
FurnaceBoy left
04:29
cotto left
04:46
cotto joined
04:56
justatheory left
05:01
charsbar_ joined
05:10
snarkyboojum left
05:11
fridim_ joined
05:13
cotto left
|
|||
pugs_svn | r26975 | lwall++ | [Cursor] switch to specced action api (tag separate from method name) | 05:18 | |
05:32
cotto joined
05:43
kate21de joined
05:52
xinming_ joined
05:59
brunov left
|
|||
pugs_svn | r26976 | lwall++ | [S11] introduce declarators "need" and "defines", components of "use" | 06:09 | |
06:09
xinming left
06:12
snarkyboojum joined
|
|||
JDlugosz | anybody around? | 06:13 | |
06:15
unitxt left
06:17
unitxt joined
06:22
alexn_org joined
|
|||
Tene | JDlugosz: I am. | 06:38 | |
JDlugosz | I don't think I've run into you before. | ||
Tene | I've seen you around a bit. I haven't been very vocal lately. | 06:39 | |
Busy with work and the girlfriend. | |||
JDlugosz | Been with Perl 6 long? | 06:40 | |
Tene | about two or three years, I think. | ||
JDlugosz | What have you worked on or been involved with? | 06:41 | |
Tene | so, depends on what you cpmare it to. :) | ||
Rakudo, Parrot, Web.pm | |||
06:42
ejs1 joined
|
|||
JDlugosz | Well, I read the Apocolypses when they came out one at a time, and figured it would be available soon. Sooner than this! It was a little over a year ago that I was disapointed in the progress to date. | 06:42 | |
Tene | I drift around... I did a lot of exceptions stuff a while back. Recently I've been focusing on HLL interop. | ||
Got Rakudo working together (kinda) with Cardinal, the Ruby compiler I wrote a year ago. | 06:43 | ||
JDlugosz | When Kodak closed, I took a sabatical and decided to make a serious contribution. | ||
Tene | What are you interested in working on? | ||
JDlugosz | What's the attraction of Ruby? Years ago it seemed to not hold up to Perl. | ||
Tene | I wrote a ruby compiler because nobody else had written one and I didn't know ruby. | 06:44 | |
I think. It was long enough ago that I don't remember my motivations too well. | |||
It's been pretty abandoned for a while now, but it was an easy target for me to add HLL interop stuff to. | |||
JDlugosz | My ongoing interest is to develop a real formal specifcation. I'm also interested in type theory and the new "roles" idea, and ramifications of generics and interplay between typed and untyped code. Whew! | ||
Care to read what I'm working on now? | 06:45 | ||
Tene | I'll take a look at it, and read it if it catches my eye. | 06:46 | |
JDlugosz | <www.dlugosz.com/Perl6/web/info-mode...C.html> | 06:47 | |
Tene | Ah, yes, I saw this on the ml. | ||
06:47
eMaX joined
|
|||
JDlugosz | HLL interop is tricky business. Look at the hype of C#. They claim "write in any language" but they mean Java with your choice of syntax. You have to program to their wimpy capabilities, and totally loose what makes a language unique or powerful. | 06:48 | |
06:48
alexn_org left
|
|||
Tene | Yes, very tricky. | 06:50 | |
My attempts right now are definitely wrong. | |||
I spent a long time thinking about it, and didn't really get anywhere at all, so now I'm trying to implement *something* in hopes that it will either help me work out something better or attract the interest of someone who can do a better job. | 06:51 | ||
JDlugosz | Ever use a program called Inkscape? | ||
Tene | Occasionally. | ||
JDlugosz | Not what it's cracked up to be, it seems. Too brittle, strange bugs, etc. | 06:52 | |
Tene | Yeah, sounds familiar. | ||
06:52
cotto left
|
|||
JDlugosz | Windows that don't behave, browse dialogs that are non-standard and don't remember the path you wanted... | 06:52 | |
I just discovered I lost some work, from a file I was fighting to copy/paste from. | 06:53 | ||
Had to google discussions to figure out how to copy from one document to another! | |||
Tene | Sounds like some of my first HLL interop attempts. :) | 06:54 | |
06:54
LadyLunacy joined
|
|||
JDlugosz | the open dialog shows all the files twice. | 06:54 | |
Tene | Interesting. | 06:55 | |
JDlugosz | You might find my type stuff interesting. | 06:57 | |
06:59
cotto joined
07:01
skids left
07:05
viklund joined
07:09
LadyLuna1y left
|
|||
Tene | Nice... I now have PIR library loading working from Rakudo and Cardinal. | 07:26 | |
I need to figure out the makefile rules for this, though... | |||
07:26
alexn_org joined
07:36
unitxt left
07:37
unitxt joined
|
|||
JDlugosz | PIR? | 07:51 | |
Tene | Parrot assembly. | 07:52 | |
JDlugosz | That's what I thought. Just misparsed your grammar there. Thought it was for Rakudo and for something else. | 07:53 | |
So what do you think of F-Bounded Polymorphism? Imagine getting that to interoperate with any lesser language! | 07:54 | ||
07:54
ejs1 left
|
|||
Tene | use Foo:lang<parrot>; | 07:54 | |
JDlugosz | I mean, how can Java for example use a class that doesn't follow it's "isa" relationship rules? | 07:55 | |
08:12
alexn_org left
08:15
iblechbot joined
08:20
unitxt left
08:36
M_o_C joined
08:38
ejs left
08:53
alexn_org joined
09:00
tulcod joined
09:02
abra joined
09:15
eMaX left
09:17
agentzh left,
alexn_org left
09:24
DemoFreak joined
09:35
agentzh joined
09:43
fridim_ left
09:44
viklund left
09:57
viklund joined
09:59
pmurias joined
10:10
sjohnson left
10:13
amoc left
10:15
amoc joined
10:17
frew|work left
10:21
M_o_C left
10:23
sjohnson joined
10:36
iblechbot left
10:37
DanielC joined
|
|||
DanielC | moin | 10:40 | |
10:49
snarkyboojum left
10:54
amoc left
10:56
amoc joined
11:06
kane__ joined
11:13
masak joined
|
|||
masak | happy summer salutations, #perl6 people. | 11:14 | |
11:15
elmex_ joined
|
|||
DanielC waves | 11:15 | ||
11:15
Whiteknight joined
11:17
cotto left
|
|||
masak | hm, it all comes down to module recognition in Rakudo. | 11:18 | |
everything else comes after that. | |||
11:18
meppl joined
|
|||
DanielC | What comes down to module recognition? | 11:18 | |
masak | DanielC: module management, and CPAN or a CPAN replacement. | 11:19 | |
DanielC | Rakudo doesn't support modules an packages yet? | ||
11:19
cognominal left
|
|||
masak | DanielC: in my opinion, the discussion we're having about that is very useful, but it won't produce much code, because Rakudo doesn't implement modules as per S11 yet. | 11:19 | |
and won't for at least a few months. | |||
DanielC | :-( | ||
masak | DanielC: it does support modules, but not as per S11. | 11:20 | |
DanielC | I was hoping for something tangible. You know.. round tuits and all. | ||
masak | that's what I'd like too. | ||
that's why I'm thinking about what's blocking us right now. | |||
11:22
elmex_ is now known as elmex
|
|||
masak | questions like "what's the least amount of coding that would allow us to store two modules with the same name, but with different versions? or different authors?" | 11:22 | |
at the very least, we could write some spectests for this. that would definitely help. | |||
11:22
explorer__ joined
|
|||
DanielC | Daniel Ruoso says that the package format is the most critical step, so perhaps it is possible to make progress there. But I'm no expert on package formats. I just suggested some improvements on S22. | 11:23 | |
DanielC hopes they are improvements | |||
masak | I'm by no means an expert either. in what way does the package format affect the way we store modules so that Rakudo can access them? | 11:24 | |
DanielC | I don't know. | ||
I don't know a lot about either subject. | 11:25 | ||
masak | the big step for Rakudo, I think, is that modules might not be able to sit directily on the disk any more. | ||
they might have to be stored in a database somewhere. | |||
that's a big change. | |||
DanielC | Hmm... that doesn't sound like "the Unix way" or "the Perl way". | ||
masak | indeed not. | 11:26 | |
an alternative (perhaps) is something like URL encoding. | |||
DanielC | Why can't we use regular directories to organize modules? e.g. /<auth>/<version>/Foo/Bar.pm | 11:27 | |
masak | DanielC: because modules can have arbitrary Unicode names. | ||
and not all file systems appreciate that. | |||
11:28
unitxt joined
|
|||
DanielC | That doesn't sound like a big problem. Just use some standard encoding like the URL encoding you said. | 11:28 | |
masak | yes. | ||
but it's exactly these small problems that I think we should start with. | |||
they are concrete, they can be solved today, even before Rakudo gets there, and they can be made to work and show us what the next set of real problems are. | 11:29 | ||
DanielC | Most of the time, for most practical purposes, the module names are going to be ascii anyways. | ||
masak | sometimes amrchair discussions about frameworks bore me. | ||
DanielC | And even when they are not, lots of programming languages have tools for url encoding/decoding so the data would remain very accessible. | ||
masak | yes. | 11:30 | |
if it's at all practical not to involve a database, I think we should try to stay in the file system. | |||
DanielC | yeah | ||
And I agree with picking small concrete problems we can start with today. | 11:31 | ||
pochi | does that mean I can't create a module 動物.pm and copy it into the module path without URL encoding it first? | ||
DanielC | pochi: What if the filesystem doesn't support unicode? | ||
pochi | what happens if one tries to copy a unicode named file to a non-unicode filesystem anyway? | 11:32 | |
DanielC | I dunno | ||
Do we know of any non-unicode filesystem? Can we test? | |||
masak | pochi: either the encoding would be uniform on all systems, and then you couldn't. or it'd be a matter of local configuration (when building Rakudo, say), and then you could if your system was configured like that. | 11:33 | |
DanielC: old DOS systems ought to be non-unicode. | |||
DanielC | ext3 seems to have no problem with Unicode. I just created a file called 動物.pm. | ||
pochi | masak: the latter sounds good | ||
masak | pochi: yes, but it has the drawback that you shouldn't indiscriminately copy Perl 6 libraries from one system to another. | 11:34 | |
they might be configured differently. | |||
perhaps not such a large drawback, but still. | |||
DanielC | masak: Or Rakudo could try both paths... but then again, that could lead two conflicts (same module stored twice, once as unicode and once as URL encode). | ||
masak | DanielC: that sounds like a hack due to lack of planning. :) | 11:35 | |
I wouldn't do that if I didn't really have to. | |||
DanielC | yeah... it seems to cause a lot of problems. | 11:36 | |
Btw, I can think of another reason not to copy Perl 6 libraries around. The first computer could have the library stored as parrot bytecode and the second computer could have an implementation of Perl 6 that doesn't understand Parrot. | 11:38 | ||
masak | indeed. | ||
std: use Dog:ver(Any):auth(Any); | |||
p6eval | std 26976: OUTPUT«ok 00:02 35m» | ||
masak | rakudo: use Dog:ver(Any):auth(Any); | ||
p6eval | rakudo 764684: OUTPUT«Can't find ./Dog in @*INCin Main (src/gen_setting.pm:438)» | 11:39 | |
masak | hm, but it parses? interesting... | ||
maybe it wouldn't be too far-fetched to fork Rakudo on github and try some stuff for realz. | |||
pochi | shouldn't "Any" be "*"? | ||
masak | now _that_ thought excites me! | ||
pochi: I got that example from S11. | |||
rakudo: use Dog:<1.2.1>; | 11:40 | ||
p6eval | rakudo 764684: OUTPUT«Can't find ./Dog in @*INCin Main (src/gen_setting.pm:438)» | ||
masak | yep, Rakudo already parses the colonpairs after the module name. | 11:41 | |
Rakudo++ | |||
phenny: tell mberends I'm toying with the idea of creating a Rakudo branch and adding the ability to load versioned/authored modules. it would lead to questions about module semantics, directory structure, perhaps distribution. what do you think? | 11:45 | ||
phenny | masak: I'll pass that on when mberends is around. | ||
11:45
M_o_C joined
11:47
huma left
11:55
lichtkind joined,
payload left
11:59
viklund left
|
|||
jnthn | hi all | 12:02 | |
masak | jnthn: o/ | 12:03 | |
jnthn | hej masak :-) | 12:04 | |
masak: Happy to see that you're interested in working on getting something solid together on versioned etc libraries. :-) | 12:06 | ||
masak | I am. | ||
jnthn: is there a policy on branching of Rakudo? | |||
jnthn | Branches don't affect anyone who isn't explicitly interested in playing with the branch. | 12:07 | |
So just go ahead. | |||
masak just goes ahead | |||
lichtkind | hello | 12:09 | |
is syntax infix:{+} { ... } legal | 12:10 | ||
masak | lichtkind: I wouldn't think so. | ||
DanielC | there is a syntax that is *similar*, I just need to remember what it is... | ||
masak | lichtkind: the <+> form autoquotes, and that corresponds to {'+'} | ||
lichtkind | so you have to use masak true thanks | 12:11 | |
DanielC | masak: Is infix:<+> the same thing as infix:{'+'} ? | ||
masak | DanielC: if the latter is legal, yes. | ||
DanielC | and they mean the same... | ||
DanielC can't imagine what else it could mean, but prefers to ask. | 12:12 | ||
masak | well, that's what 'the same thing' implies, that they mean the same. :) | ||
lichtkind | no you got it entiely i understood now | ||
DanielC | masak: I missed the "if" in your reply, so I parsed your sentence wrong :) | ||
masak | phenny: tell mberends github.com/rakudo/rakudo/tree/ver-auth-modules -- jnthn++ gave the go-ahead. :) | 12:13 | |
phenny | masak: I'll pass that on when mberends is around. | ||
lichtkind | is prelude and STD.pm the same thing? | ||
masak | lichtkind: no. | ||
lichtkind: prelude is a set of 'core' subs and methods written in Perl 6. | |||
lichtkind: STD.pm is a Perl 6 grammar. | 12:14 | ||
masak jacks out of the Intertubes for a while | |||
12:14
M_o_C left,
masak left
|
|||
lichtkind | masak: that i read but i cant imagine where one thing ends and other begins | 12:14 | |
12:14
M_o_C joined
12:16
|MoC| joined,
M_o_C left
12:18
Whiteknight left
|
|||
DanielC | masak: On the topic of versions and file systems... do you know of ':' and '.' are valid file name character in most file-systems? The package Foo::Bar version 1.2 could be stored literally as 'Foo::Bar-v1.2.pm' | 12:18 | |
masak: Earlier I said /<auth>/<version>/Foo/Bar.pm but clearly that doesn't make any sense. Two unrelated modules with the same version number would end up together. | 12:19 | ||
12:20
payload joined
|
|||
jnthn | DanielC: No, they're not. | 12:21 | |
DanielC: I don't know anywhere . doesn't work, but : is a problem. | 12:22 | ||
DanielC | Alternatively: /<auth>/Foo/Bar-<version>.pm | ||
Avoids the :: | |||
jnthn | (On Windows at least.) | ||
DanielC | (and still has version after "Bar") | ||
jnthn | DanielC: I don't know. I'm not sure if auth, name and version are the only meta-data we'll ever care about. | ||
So something more extensible is probably wise. | 12:23 | ||
12:24
mikehh left
|
|||
DanielC | jnthn: I can easily imagine us caring about the platform (Perl 6 vs Parrot). | 12:24 | |
And given that Perl can even use stuff written in other languages, even today ("use ruby"), we might even have true Ruby modules stored. | 12:25 | ||
jnthn: I'm having trouble thinking of something extensible that doesn't make the modules inaccessible (e.g. storing them in a database). | 12:27 | ||
inaccessible = difficult to access to third-party tools, in particular Unix commands like 'find'. | 12:28 | ||
jnthn | Yes because no way can we build the tools we'd need! | 12:29 | |
:-S | |||
FWIW, as a Windows user, I don't really care about accessibility via Unix commands. | |||
DanielC | jnthn: I was thinking in terms of "the Unix way" (plain text, etc) | ||
One thing I like about Unix/Linux is that the system is generally accessible. I can hack it. | 12:30 | ||
No registry. Config files are plain text. Things like that. | |||
jnthn | You can still do something database-y and keep it generally accessible/hackable. | ||
Think Sqllite. | 12:31 | ||
*Sqlite | |||
Already lots of languages with bindings to it. | |||
DanielC | If Rakudo used a database, sqlite would be my top choice. | ||
It is the most accessible of the databases I know. | |||
jnthn | From the (limited) amount of thought I've givne this, it's felt to me that something database-ish is the way to go, and I'd much rather see us use something existing like sqlite than create yet another third party format. | 12:32 | |
DanielC | absolutely (reusing sqlite). | 12:33 | |
Last thing this world needs is a vanity database just for Perl. | 12:34 | ||
jnthn: If we use sqlite, then sqlite support must be part of the standard library. You can't install with Sqlite support module without sqlite support... | 12:35 | ||
jnthn | DanielC: Aye, though it'd need to be part of Rakudo's rather than Perl 6's. | 12:37 | |
DanielC | Is it ok for Rakudo to have a standard library that differs from Perl 6? | ||
jnthn | I figure all implementations will have some extra little bits specific to their needs. | 12:38 | |
And it depends how you define standard library too. | 12:39 | ||
They'd still have a consistent setting, and I guess that's what really matters. | |||
DanielC | I guess that the Rakudo distribution could come with DBI and DBD::SQlite by default... | 12:40 | |
jnthn | Dunno, this is details... | 12:41 | |
I'm mostly hoping that @other will fill in the gaps on this stuff. | |||
DanielC | k | ||
jnthn | So I don't have to think about it too much. :-) | ||
DanielC | :-) | ||
The alternative to including DBD::SQlite is for Rakudo to come with its own, separate support for SQlite, but I can't imagine how that could possibly be useful. | 12:42 | ||
pmurias | is there anything interesting happening on August 6th (other than the trainings)? | 12:43 | |
DanielC | jnthn: Here is one thing I like about the SQlite idea: It resolves the unicode problem we were discussing earlier (did you see the discussion). | 12:44 | |
jnthn | DanielC: Glanced over it. | ||
DanielC | If you use SQlite you don't have to worry about what characters the filesystem supports. | ||
jnthn | pmurias: Is that the day after YAPC::EU? | ||
pmurias: If so - potentially a Parrot Developer Summit also. | |||
DanielC | masak: Have you followed this discussion about SQlite? What do you think? | 12:45 | |
jnthn | pmurias: Beyond that not aware of anything. | 12:46 | |
lichtkind | macro summe { 3 + 4 } does it return an AST containing 7 or 3+4 ? | ||
12:46
amoc left
|
|||
lichtkind | i mean i i dont quote will it executed? | 12:46 | |
DanielC | lichtkind: I don't know, but if the compiler is smart, I would hope that it would just use 7. | 12:47 | |
12:47
sri_kraih joined
|
|||
lichtkind | DanielC: thanks but i dont mean optimasition but whot syn says | 12:47 | |
DanielC | Ok. I don't know what the syn says. | 12:48 | |
12:49
ZuLuuuuuu joined
12:50
mberends joined
|
|||
DanielC | o/ ZuLuuuuuu mberends | 12:50 | |
mberends waves: wow, lurking on the backlog is interesting, as always :) | 12:51 | ||
phenny | mberends: 11:45Z <masak> tell mberends I'm toying with the idea of creating a Rakudo branch and adding the ability to load versioned/authored modules. it would lead to questions about module semantics, directory structure, perhaps distribution. what do you think? | ||
mberends: 12:13Z <masak> tell mberends github.com/rakudo/rakudo/tree/ver-auth-modules -- jnthn++ gave the go-ahead. :) | |||
mberends | wahey! | ||
12:53
Chillance joined
|
|||
pmurias | jnthn: yes, that's the day after YAPC::EU | 12:53 | |
jnthn: is the Parrot Developer Summit open to all or only parrot developers? | 12:54 | ||
ZuLuuuuuu | hello DanielC | 12:55 | |
12:55
sri_kraih_ left
|
|||
mberends | before opting for anything sql-flavoured to manage module metadata, be aware that sql language comptatibility slows the inner data access routines by an order of magnitude. Google avoids SQL and XML for anything performance sensitive, and we definitely need to be that here. | 12:55 | |
jnthn | pmurias: I'm not 100% sure it will actually happen yet, I didn't yet book my flights etc. If it does, I think it will be mostly for discussing Parrot-level issues and planning Parrot dev generally rather than just stuff specific to Perl 6. I doubt it'd be a secretive-cabal-ish style meeting though...if you're interested in Parrot and want to come I'd not see a probem with that. | 12:57 | |
And of course, Parrot issues relavent to Rakudo will certainly be some of what is discussed. | 12:58 | ||
DanielC | mberends: I thought Google used MySQL. | 12:59 | |
mberends | DanielC: your're joking, right? | 13:00 | |
DanielC | No, I'm not. | ||
However, I might be wrong. | |||
But hasn't Google even submitted patches to MySQL? | 13:01 | ||
mberends | If Google could use MySQL, they'd have bought the company. But Sun did, instead. | ||
DanielC | www.mysql.com/customers/view/?id=555 | ||
They are listed as a customer. | |||
www.informationweek.com/news/intern...=199201237 | 13:03 | ||
mberends | DanielC: interesting, I shall dig into what they use it for. | ||
13:04
amoc joined
|
|||
mberends | my concern if from another angle, several database engines were superbly fast until they got an SQL language interface on top, that slowed things down considerably. The reason, general purpose accessibility, is not warranted for Rakudo. | 13:05 | |
DanielC | jnthn: Were you thinking of storing the actual module in SQL or just some reference to a file on disk? (e.g. the name of the file on disk could be a hash sum of its metadata). | 13:06 | |
jnthn | DanielC: Just meta-data. | 13:07 | |
DanielC | ok | ||
I think that's the most reasonable. | 13:08 | ||
mberends | DanielC: the SQLite alternative is much faster and more appropriate, but I'm still doubtful about making Rakudo depend on such a complex subsystem | ||
jnthn | The other thing to figure into all of this is pre-compilation. | ||
That is, for efficiency the module installation process should probably compile modules to PBC. | |||
DanielC | mberends: I understand. masak expressed similar concerns, and so did I. But jnthn makes good points. | 13:09 | |
jnthn | well, *an* other, not *the* other. | ||
DanielC | PBC = Parrot Byte-Code right? | ||
jnthn | DanielC: Yes. | ||
Not a big deal, just something to keep in mind. | |||
pmichaud | good morning, #perl6 | 13:10 | |
lambdabot | pmichaud: You have 1 new message. '/msg lambdabot @messages' to read it. | ||
pmichaud | @messages | ||
lambdabot | DanielC said 11h 7s ago: The problem with the k-nucleotide benchmark is definitely the ++. If you replace for loop by a "loop ($i=0; ...; $i+=1)" and change the "%table{...}++" to "+=1" the program | ||
runs 3 times faster. | |||
DanielC | yet another thing to think about is that the user must be able to specify multiple sqlite databases (so the can store modules in his home directory) | ||
jnthn | mberends, DanielC: I'm not so much attached to Sqlite, more that we don't re-invent a wheel we don't have to. | ||
pmichaud | (sqllite versus filesystem) | 13:11 | |
mberends | DanielC: that would be no problem | ||
DanielC | jnthn: ok | ||
pmichaud | Last year at YAPC::NA I spent an hour or so talking to a representative from $large_financial_company about module access in Perl 6 (more) | ||
In his company, they absolutely need the capability to have versioned modules | |||
Which was why he cornered me for an hour to discuss it | 13:12 | ||
One of the points he wanted to make was that the filesystem was almost certainly not fast enough to be able to handle it | |||
mberends | jnthn: a Berkeley DB level of database (essentially a disk based hash) would perform far more efficiently | ||
pmichaud | at least, the filesystem alone wasn't enough to do it. | ||
mberends | but the WinFS disaster should have lessons for us | 13:13 | |
jnthn | mberends: *nod* | ||
pmichaud | This wasn't speculation on his part, it was actual experience. In fact, they came up with their own set of module management for Perl 5 (basically abusing @INC and all sorts of other things) because the facilities Perl 5 and CPAN provide weren't nearly capable of scaling to handle it. | ||
mberends | pmichaud: *very* interesting | 13:14 | |
DanielC | pmichaud: Interesting. But if an SQlite database told you the direct path of the file you need, then it would be fast enough, right? | ||
pmichaud | DanielC: Likely, yes. | ||
DanielC | pmichaud: Do you still have his contact email? It sounds like he could contribute much to this discussion. | ||
mberends | DanielC: SQLite itself will internally be slower that we are likely to expect | ||
13:16
cognominal joined
|
|||
DanielC | mberends: Do you know anything better? | 13:16 | |
mberends | our own future custom solution ;) | ||
DanielC | :) | ||
pmichaud | DanielC: Yes, I could likely contact him; OTOH, he and his company wasn't much interested in being publicly known for working on Perl | ||
DanielC | pmichaud: Sure, but he can join IRC, we won't know his name or his company. | 13:17 | |
pmichaud | I might let him know that discussions are taking place and invite him to monitor | 13:18 | |
This person was sufficiently high level that I doubt he'd be able to spend much time hanging around on IRC. | |||
DanielC | pmichaud: Maybe he can delegate to an underling who knows what they need. | ||
pmichaud | Good point. | ||
13:19
cotto joined
13:20
amoc left
13:21
amoc joined
|
|||
mberends | just knowing that the @INC and filesystem solution *can* be improved successfully, is a very important fact. It sets standard Perl 5 up as a target for us to outperform. | 13:21 | |
btw, I think that burying our heads in the sand about performance is not going to last much longer, so optimizing is no longer premature in whatever we add to Rakudo. | 13:23 | ||
13:23
wolverian joined
|
|||
pmichaud | mberends: oh, we're already on it. | 13:23 | |
mberends | :) I see that too. | ||
pmichaud | I suspect that by the end of the day Rakudo performance will have doubled over what it was this time last week. | 13:24 | |
(as measured by "time to execute spectests") | |||
jnthn | Wow. | 13:25 | |
mberends | pmichaud++: I know you care a lot about performance. | ||
pmichaud | and perhaps even more if jnthn+'s dispatch improvements land today :-) | ||
jnthn | pmichaud: I need to find the energy to debug segfaults. | 13:26 | |
pmichaud | jnthn: no pressure on this end -- was just a comment :-) | ||
jnthn | pmichaud: I'm suffering a little with some kind of cold-ish virus that seems to be sapping a lot of my energy at the moment. :-| | 13:27 | |
jnthn has slept for 10 hours two nights running... | |||
pmichaud | jnthn: ouch, sorry to hear that. Hope things improve very soon. | 13:28 | |
mberends | jnthn: get well soon, what else can we say? | ||
jnthn | Anyway, I'm very much wanting to land the dispatcher soon. :-) | ||
Excluding some exit-time segfaults, I'm down to two test files with issues (one easy, one hard). | |||
So it's *close*. :-) | 13:29 | ||
(If anyone is curious to know what's taking so long, I've got a 1500+ line diff against head.) | 13:30 | ||
(Which should give an idea of the order of magnitude of the refactor.) | |||
lichtkind | is there any difference between macro summe { '3 + 4' } and macro summe { 3 + 4 } ? | ||
mberends | lichtkind: surely just the same as if you placed the macro contents in the code calling the macro, so the first could not be used as an array subscript for example, but the second could. | 13:33 | |
bloonix | rakudo: say $*OUT "foo" | ||
p6eval | rakudo 764684: OUTPUT«Statement not terminated properly at line 2, near "\"foo\""in Main (src/gen_setting.pm:0)» | ||
bloonix | rakudo: say $*ERR "foo" | 13:34 | |
p6eval | rakudo 764684: OUTPUT«Statement not terminated properly at line 2, near "\"foo\""in Main (src/gen_setting.pm:0)» | ||
bloonix | is the syntax wrong? | ||
lichtkind | mberends: so basically would first return the compiled string and seconf 7? | ||
mberends | bloonix: yes, you're using Perl 5 style | 13:35 | |
lichtkind: yes, I think so | |||
lichtkind | mberends: but your not shure ? :) | ||
mberends | lichtkind: I mainly understand what I use in Rakudo, and macros have not arrived yet. I haven't read the macro sysnopis recently, that's what I mean. | 13:37 | |
lichtkind | mberends: i do read but have problems anyway :) | ||
DanielC | mberends: SQLite may not be fast, but the database table shouldn't be very large. I can't imagine someone having 10,000 modules installed. | ||
lichtkind | mberends: thanks | 13:38 | |
bloonix | rakudo: $*OUT.say("foo") | 13:39 | |
p6eval | rakudo 764684: OUTPUT«foo» | ||
mberends | DanielC: if we specify what goes into and come out of the database, SQL is not part of the requirement | ||
DanielC | mberends: ok... | ||
mberends: So you want to use a custom non-SQL database? | 13:40 | ||
mberends | DanielC: not absolutely, but they are likely to be more efficient | 13:41 | |
and I'm desperate to find the most efficient solution for the computer here, not for the Rakudo developer ;) | 13:42 | ||
DanielC | The upshot is that it may be hard to write your own script to read the "Rakudo Registry". | 13:43 | |
mberends | we can discuss abstract designs in terms of tables, columns, indexes and so on. | ||
DanielC: yes. it will be enough for Rakudo to be the interface to this "Registry" | 13:44 | ||
If anything else can get access, it will be nice but not essential. | 13:45 | ||
DanielC | ok | ||
pmichaud | DanielC: fwiw, the person I was talking with did have thousands of modules installed. | 13:47 | |
maybe not 10,000, but definitely at least 4-digits. | 13:48 | ||
DanielC | pimchaud: Ok. And since Perl 6 will also have module versions, the same customer might have the full 10,000 in Perl 6. | ||
mberends | as masak++ wrote a few hours ago, the full implementation of the 'use' command is the problem in a nutshell. Installers, repositories etc are just supporting infrastructure that is allowed to be less efficient in execution that the 'use' command. | ||
DanielC | I wonder how quickly SQLite can go through 10,000 records. | 13:49 | |
mberends | we'll build some test cases. performance testing is essential here. | 13:50 | |
it will help to visualize it at the lowest possible level: how many file I/O's must the perl6 process do for a 'use' command. CPU and memory are ample, filesystems are huge, but drives are slow. | 13:55 | ||
DanielC | yes | 13:56 | |
pmichaud | fwiw, I should point out that there are three primary reasons why I've been saying that Rakudo wouldn't be attempting module versions until the August time frame | 14:01 | |
(1) in terms of "where to put modules" (in the filesystem), that really depends somewhat on being able to work with an installed Parrot, which thus far Rakudo hasn't been able to do. I expect that to change this week. | 14:02 | ||
lichtkind | mberends: but gerrally speaking macros are evaluated at compiletime and result is returned as an AST? | ||
or has anybody else here clues about p6 macros? | 14:03 | ||
pmichaud | More to the point, Parrot imposes its own ideas of where loadable modules should go, and so we (on the Rakudo side) have to keep those considerations in mind. And Parrot hasn't fully defined its API for that yet. | ||
lichtkind | mberends: s/gerally/generally/ | ||
pmichaud | (2) The specification itself needs more brainstorming about what is/is not required. That's been happening this week on #perl6 and the mailing list, which is good. | 14:04 | |
mberends | lichtkind: I'm going to brush up my macro-fu in the Synopses to answer that ;) | ||
lichtkind | mberends: thanks | 14:05 | |
14:05
skids joined
|
|||
mberends | buubot: spack macro | 14:06 | |
buubot | mberends: S02-bits.pod:16 S03-operators.pod:8 S04-control.pod:5 S05-regex.pod:8 S06-routines.pod:36 S09-data.pod:3 S11-modules.pod:6 S12-objects.pod:7 S29-functions.pod:2 | ||
pmichaud | (3) I hadn't envisioned that managing versioned modules was going to be significant for anyone before August. I can understand that module packaging and distribution might be important, but being able to handle multiple versioned modules didn't seem like it was a likely high priority (Perl 5 lives without it, for example) | ||
14:07
sri_kraih left
|
|||
mberends | pmichaud: we'd better get with the (1) program before bikeshedding then | 14:08 | |
pmichaud | mberends: well, I'm fine if we start exploring things. | 14:09 | |
DanielC | I'm surprised that Parrot puts restrictions on where a module can go. | ||
pmichaud | DanielC: I was surprised about that too. | ||
DanielC: "restrictions" is perhaps too strong a word -- "expectations" might be better. | |||
i.e., parrot expects languages to store their modules in a subdirectory of the parrot tree | 14:10 | ||
(which I think probably won't be what ultimately happens) | |||
I think I've planted the seed/idea that each individual compiler should be responsible for its module management, with a common API to handle cross-language module loading, but it's not official yet. | 14:11 | ||
DanielC | pmichaud: Any restrictions on the file name? Can the module Foo::Bar be stored in something like /parrot/perl6/1ffae822021bc | ||
pmichaud | DanielC: that's still to be determined, a bit | 14:12 | |
from a personal perspective, I find hash keys to be lousy filenames, though. | |||
I'd still like to be able to figure out what a file is from looking at a directory listing. | |||
DanielC | I can't say I love them. I'm just thinking of the DB idea. | 14:13 | |
pmichaud | a DB can still map to a human-understandable name. | ||
DanielC | true | ||
mberends | the middle road is something like how Windows maps long file names to 8.3 | ||
not everything from Redmond is bad | 14:14 | ||
pmichaud | anyway, my personal feeling is that there ought to be several achievable middle steps between "what we have today" and "full S11 support". | ||
DanielC | pmichaud: If the module name is Foo::動物.pm we an URL-encode the entire string, append metadata an make that the fie name. | ||
$filename = urlencode("Foo::動物.pm") ~ "-$version-$auth" | 14:15 | ||
pmichaud | well, I'd hope there at least some level of directory hierarchy there | ||
also probably need to url encode $version and $auth, too | |||
and $auth is really long to be putting in a filename, not sure we need that | 14:16 | ||
DanielC | Can two modules have the name but different authority? | ||
pmichaud | of course. | ||
But just because I don't like hashes as filenames doesn't mean they should be forbidden at all | |||
14:17
_Chillance_ joined
|
|||
mberends | tokens for $version and $auth would be fine, database mapped | 14:17 | |
pmichaud | using Web::Foo-1ffae822021bc would be fine for me | ||
I can look at that name and say "oh, that's Web::Foo" | |||
DanielC | $filename = urlencode("$module-$version") ~ ShortHash($auth) | ||
yeah | |||
Web::Foo-v1.2.0-1ffae822021bc looks good. | 14:18 | ||
pmichaud | 11:19 <masak> DanielC: in my opinion, the discussion we're having about that is very useful, but it won't produce much code, because Rakudo doesn't implement modules as per S11 yet. | ||
I disagree somewhat with masak++ here, fwiw. | |||
I think we can start producing code before Rakudo has finished S11 | 14:19 | ||
indeed, I think the two have to be designed together | |||
DanielC | :-) | ||
pmichaud | or at least take both components into consideration | ||
thus my comment about "achievable middle steps" -- that's what we should be aiming for. I'd be very happy to see us start with a completely filesystem-based module loader for a while, until some of the other parameters become known. | 14:20 | ||
DanielC | ok | 14:21 | |
mberends | rakudo has a ver-auth-modules branch to try things out | ||
pmichaud | I saw that, excellent. | ||
At the moment I'd like us to just come up with a consensus opinion about module location, and perhaps a simple module-to-filename mapping. | 14:22 | ||
(it can be rakudo specific) | |||
DanielC | $filename = urlencode("$module-$version"); for (@all_other_metadata) { $filename = ShortHash($_) } <-- this is automatically extensible. | ||
s/$filename = ShortHash($_)/$filename ~= ShortHash($_)/ | 14:23 | ||
DanielC is assuming that ~= exists | |||
pmichaud | my feeling (and I could be wrong about this) is that the demarcation between "what all Perl 6-compliant implementations must do" and "what is reserved to the implementation" is a very fuzzy concept at the moment | ||
as far as module management is concerned | 14:24 | ||
mberends | nod, because it's not specified anyway | ||
pmichaud | I think I'm saying that it's not specified because we don't want to commit ourselves too soon to a particular view | 14:25 | |
DanielC | I like the " Web::Foo-1.2-1ffae21bc" idea. It is transparent, and it doesn't prevent us from adding a database layer later if that's faster than using the file system. | ||
pmichaud | Also, I noticed there was some discussion yesterday about how one might specify a module to a command-line installer. | 14:26 | |
I think there might be something to be said to using the same syntax that is part of a 'use' statement :-) | |||
pochi | could it be a hybrid system? look in db first, if not there then search the fs? | ||
mberends | pochi: you could argue equally for the reverse order | ||
pmichaud | could it be a hybrid system? Sure, I can imagine that. | 14:27 | |
DanielC | pochi/mberends: That might miss the performance benefit of using a DB. | ||
mberends | in fact the DB will always know everything, but it may not win on performance | ||
pmichaud | "cpan install Module::Foo:ver<1.2.*>:auth<cpan:JRANDOM>" | 14:28 | |
pochi | it would add the module it found on the fs to the db, so that the next time the module is use()'d it would find it in the db. | ||
pmichaud | pochi: that assumes write permission to the db | ||
DanielC | pmichaud: What would that do? Install *all/any* modules that match 1.2.* ? | ||
pmichaud | DanielC: I would think it would use the same criteria as a use statement. | 14:29 | |
"cpan install Module::Foo" # give me latest / most appropriate version of Foo | |||
"cpan install Module::Foo:auth<cpan:JRANDOM" # give me latest version of Foo coming from cpan:JRANDOM | |||
mberends | DanielC: therefore the latest 1.2.* | 14:30 | |
DanielC | Sounds good. | ||
pmichaud | in other words, we already have a syntax for identifying a module, we ought to (re)use it | ||
DanielC | Sounds very good, actually. Very useful. | ||
"give me the latest version of the branch that I know works with my program" | 14:31 | ||
pmichaud | furthermore, that syntax is nicely extensible. :-) | ||
DanielC | yes | ||
mberends | I like the idea of initially coding what works without a database, and then adding the lightest possible database only when there's a proven need. | 14:32 | |
DanielC | +1 | 14:33 | |
14:33
Chillance left
|
|||
pmichaud | there was also some discussion about whether modules should re-use the existing CPAN infrastructure or make a new one | 14:34 | |
I don't think it should be an either-or choice | |||
I think whatever is built should be able to interface nicely with CPAN, but not limit us to that. | |||
(that statement, of course, is meant as a "in the long run" sort of thing, not necessarily what we do in the first steps) | 14:36 | ||
14:36
iblechbot joined
|
|||
mberends | the idea that the existing CPAN is Perl's killer app is so important, it would be folly to ignore. And yes, decentralized repositories are the new archive network. | 14:37 | |
pmichaud | and there's more than one way to decentralize :-) | 14:39 | |
afk for a bit | 14:40 | ||
lichtkind | mberends: true | 14:41 | |
mberends: did youz check s05? | |||
mberends | as obra_++ wrote on May-28, we are welcome to try to distribute our Perl 6 projects via CPAN, and download/install with our proto tool | 14:42 | |
DanielC | mberends: I hear that Berkeley DB is faster than SQLite but it does not support SQL. | ||
mberends | lichtkind: I'm reading S06 first, it has more relevant info | 14:43 | |
skids | Has anyone attempted to spec a robust replacement for -w? If it's done soon enough module authors might actually standardize on one warning flag set. And we could add a flag for "this is inefficient" so when people complain about performance, the fist question is "what does it say when you turn efficiency warnings on?" | ||
mberends | DanielC: that makes sense | ||
DanielC | RPM uses Berkeley DB... | 14:44 | |
14:45
finanalyst joined
|
|||
DanielC | Berkeley DB is now owned by Oracle, but it seems to have a compatible license (Sleepycat License). | 14:46 | |
skids | ]\ | ||
mberends | Perl 5 tied hashes also fitted Berkeley DB very nicely | ||
14:46
fridim_ joined
|
|||
DanielC | BerKeley DB website: "Extreme performance—eliminates the overhead of SQL and interprocess communication" | 14:47 | |
mberends | there are also versions with more open licensing | 14:48 | |
DanielC | Ok. I didn't know that. | ||
skids scolds cat | |||
s1n | @seen masak | ||
lambdabot | I saw masak leaving #perl6 2h 34m 6s ago, and . | ||
pmurias | having the storage backend pluggable could be a good idea | 14:49 | |
14:50
pmurias left,
ZuLuuuuuu left
14:51
icwiener joined
14:54
LadyLuna1y joined
14:58
shinobi_cl joined
15:03
DemoFreak left,
_Chillance_ left,
Chillance joined
15:10
wolverian left,
LadyLunacy left
|
|||
pugs_svn | r26977 | pmichaud++ | [t/spec]: Change rakudo fudge from 'todo' to 'skip'. | 15:13 | |
15:20
nihiliad joined
|
|||
mberends | lichtkind: S06 'Macros' distinguishes between compile time and run time calls to macros, without and with the &, but you probably found that anyway. | 15:24 | |
lichtkind | yes | 15:25 | |
mberends: but i dont understand consequences | |||
you mean runtime i get 7 comtiletime 3+4 ? | |||
15:26
ab5tract joined
|
|||
DanielC | m/[\. || \d]/ matches a dot or a digit. How do I match anything that is *NOT* a dot or a digit? In other words, what is the opposite of the preceding regex? | 15:27 | |
15:27
beggars joined
|
|||
DanielC | m/<-[\. || \d]>/ does not seem to do it. | 15:30 | |
pmichaud | you don't need || inside of character enumerations | 15:35 | |
DanielC | k | ||
pmichaud | Rakudo doesn't support \d inside of character enumerations yet | 15:36 | |
you can always do | |||
DanielC | 0..9 ok? | ||
pmichaud | <!digit> <-[.]> | ||
slightly faster might be [ \D && <-[.]> ] | |||
DanielC | I don't understand the first one. To me it looks like a match for a non-digit followed by a match for a non-dot. | 15:37 | |
pmichaud | the ! makes it zero-width | ||
<!digit> means "don't match a digit at this point", but doesn't consume anything. | |||
it's basically the same as <!before \d> | 15:38 | ||
DanielC | k | ||
pmichaud | std: say pi() | ||
p6eval | std 26977: OUTPUT«Undeclared routine: pi used at 1 ok 00:02 35m» | ||
DanielC | The firs one works, but /[\D && <-[.]>]/ gives an error: Statement not terminated properly | 15:39 | |
pmichaud | maybe just one & | ||
DanielC | yeah | ||
that works, thanks | |||
lichtkind | mberends: do you think that effect the return value of the macro if its called runtime oder compiletime? | ||
mberends | lichtkind: no. (still writing another reply) | 15:40 | |
lichtkind | mberends: wont stress you take your time | 15:41 | |
15:41
shinobi_cl left
|
|||
mberends | just the generated code. calling a macro at compile time should inline the definition at the point of call. preceding the macro name with & must cause the compiler to generate a runtime call to the code defined in the macro, thus treating it as a subroutine. | 15:43 | |
DanielC | my $filename = urlencode($module); | 15:44 | |
for %metadata.sort.kv -> $k,$v { | |||
$v = $v ~~ m/[\D & <-[.]>]/ ?? $v !! md5($v).substr(0,5);; | |||
$filename ~= "-$k:$v"; | |||
} | |||
mberends | lichtkind: s/ just the generated code. // | ||
DanielC | Extensible naming scheme for modules. | 15:45 | |
Ex: Foo::Bar-auth:92de1-ver:1.2.0 | |||
lichtkind | mberends: so macro s {3+4} say 2 * s(); expands to say 2 * {3+4 } | 15:47 | |
mberends | DanielC: not bad | ||
DanielC | :) | ||
pmichaud | ...assuming that all Perl 6 implementations have a md5() builtin :-| | 15:48 | |
and that 5 chars of the md5 hash is sufficient to avoid a collision | 15:49 | ||
mberends | lichtkind: it may expand to 2 * ( 3+4 ), because the { } are just macro constructing | ||
DanielC | pmichaud: I thought the naming scheme only had to be implementation-specific. As long as *Rakudo* has any reasonable hash function... | ||
mberends | DanielC: we may choose a more compact hash, and yes, implementations do not have to be interoperable. | 15:51 | |
DanielC | pmichaud: 5 hex chars => You can expect a collision after ~1e15 distinct values. | ||
pmichaud | DanielC: good counterpoint, thanks. | ||
lichtkind | mberends: true but to be hygeninical clean which syn states macros are by default it has to be in its own namespace ie block | ||
pmichaud | DanielC: (~1e15) where did you come up with that figure? | 15:52 | |
DanielC | sqrt(16^5) => birthday paradox | ||
IIRC | |||
pmichaud | that assumes md5 keys are evenly distributed in the first 5 hex digits, though. | ||
DanielC | Yes, and they should be, to a good approximation. | 15:53 | |
pmichaud | why is that? | ||
DanielC | because md5 was designed to be a cryptographically secure hash function. | ||
Any lack of randomness would be considered a break. | |||
pmichaud | in the entire hash, yes. | ||
not necessarily in the first five digits. | |||
DanielC | If there any subset of the hash is not random, the hash is not random. | 15:54 | |
If any subset of the hash is not evenly distributed as in a random function, that automatically constitutes an attack on the hash. | 15:55 | ||
s/attack/break/ | |||
pmichaud | anyway. | ||
I'm not sure I entirely agree (and md5 has been broken), but I'll grant your point for now. | 15:56 | ||
15:56
alester joined
|
|||
DanielC | md5 is broken => someone found a way to find collisions that is better than the birthday attack | 15:56 | |
15:57
|MoC| left
|
|||
DanielC | The attack is complex. Are we worried about an elaborate attack to get two modules with the same set of hashes? | 15:57 | |
pmichaud | I'm worried about two modules ending up with the same key. | 15:58 | |
DanielC | At most, it would have to be an intentional attack. | ||
It will not happen by chance, other than through the birthday paradox (ie. sqrt(16^digits)) | 15:59 | ||
pmichaud | Again, I'm not sure I agree to the first 5 characters of precision. | ||
our keys aren't randomly distributed. | |||
sorry, I miswrote. | |||
our module names aren't randomly distributed. | |||
DanielC | that has nothing to do with hashes. | ||
a random function will produce random output on non-random input. | 16:00 | ||
otherwise what's the point? | |||
pmichaud | hashing isn't a "random function" | ||
16:00
M_o_C joined
|
|||
DanielC | yes, it is | 16:00 | |
That's the most central property of hashing | |||
well... pesudo-random | |||
pseudo-random = statistically equivalent to random | 16:01 | ||
lichtkind | mberends: so macro s { '3+4' } say 2 * s(); expands to say 2 * '3+4' ; which still is 14 ? | ||
pmichaud | the keys aren't "random", they just don't have any particular probability distribution | ||
mberends | we only have to worry about the risk of collisions behind a specific module name. | ||
pmichaud | and that can be true for the key as a whole without having to be true for all substrings of the key | ||
mberends | lichtkind: yes, that's what I believe :) | 16:02 | |
pmichaud | anyway, I'll drop it here. | ||
DanielC | If it makes you feel better, we can use sha256, but I tell you that the change is pointless unless you are worried about intentional attacks. | ||
pmichaud | The purpose isn't cryptographic security, it's avoiding collisions. | 16:03 | |
mberends | even md5 is overkill, and most hash indexing schemes have a fallback for collisions | ||
DanielC | intentional attacks = someone intentionally wanting to submit two modules with different (say) authorities that hash to the same file name. | ||
pmichaud | that's my point, I'd like to see a fallback for collisions. | ||
DanielC | pmichaud: avoiding collision is one of the central properties of a cryptographic hash. | ||
mberends | the fallback, seldom invoked, can use the contents of the files | 16:04 | |
DanielC | pmichaud: The three properties of a cryptographic hash are (1) collision-resistance, (2) second pre-image resistance and (3) pre-image resistance. | 16:05 | |
pmichaud | (I said I'm dropping it, so that's what I'm doing.) | ||
DanielC | sorry | ||
mberends | DanielC: imagine a very compact hash, resulting in collisions 1% of the time. We can still design a fallback system around that and have only a 1% average inefficiency. | 16:07 | |
pmichaud | okay, I'll bring it up just to clarify. | 16:08 | |
I don't mind if we use md5. I don't mind if it doesn't have a fallback to begin with. But at present I don't have a good md5 implementation in Parrot/Rakudo, so something else might be easier. | |||
more importantly, it may need to be fast-to-compute until there's an indexing system behind it. | 16:09 | ||
DanielC | CRC is fast to compute... (not a cryptographic hash though) | 16:10 | |
mberends | good enough though, even CRC-16 | ||
DanielC | Are we worried about intentional attacks or just about accidental collisions? | ||
mberends | the latter | ||
pmichaud | I'm only worried about accidental collisions. | ||
DanielC | Any hash should work then. | ||
mberends | yes | ||
pmichaud | there are other (better) mechanisms we can use for detecting/avoiding intentional attacks. | 16:11 | |
i.e., involving attacks on the file itself, not just its name. | |||
DanielC | I first wrote MD5 because it is the simplest hash that is popular and is second-pre-image resistant. | ||
pmichaud | sure, I would've chosen md5 first also, except that I know that md5 isn't immediately available in Rakudo. | ||
DanielC | But CRC is cool too. | 16:12 | |
I understand. | |||
pmichaud | although I _think_ that parrot may be using md5 internally these days for some things, in which case we might be able to easily expose it to Rakudo. | ||
16:13
xinming_ is now known as xinming
|
|||
pmichaud | std: undef() | 16:14 | |
p6eval | std 26977: OUTPUT«Undeclared routine: undef used at 1 ok 00:02 35m» | ||
16:16
mikehh joined
|
|||
DanielC | If we are going for fast, the Adler-32 checksum is even faster than CRC, and is easy to implement. en.wikipedia.org/wiki/Adler-32 | 16:19 | |
pmichaud | I tend to vote for simple first. | ||
i.e., it's good not to over-design before we know what we need. | |||
DanielC | At first blush, Adler-32 seems like the simplest. | 16:20 | |
pmichaud | sounds good to me. | ||
DanielC | It is a 32-bit sum. Assuming that the output is evenly distributed (and that's definitely an assumption now) it would take ~65,000 authorities to find a collision in the authority field. | 16:22 | |
pmichaud: Do you think it'd be hard to change the algorithm later on? | 16:25 | ||
pmichaud | no. | ||
the other question is: "how often do we think that the :auth will be the distinguishing characteristic for module names"? In these early days, I'm thinking "not often" | 16:26 | ||
DanielC | I just read that Adler-32 is especially week for short messages. So collisions will happen much sooner than ~65,000 modules. | ||
pmichaud | we should know how we'll handle it when we get there, but I can envision baby steps where we don't worry about it. | ||
DanielC | So Adler-32 may be a good choice "for now" because it's easy, but for deployment it might be better to pick something else. | 16:27 | |
lichtkind | mberends: but my most important issue is what is in the AST a macro returns the whole routine body or the return value? | 16:32 | |
mberends | DanielC: you're only hashing the authority, not the module name, so that would be 64k authorities per module. I would vote for Fletcher-16, Adler's predecessor. I used it once in C, long ago. | ||
DanielC | mberends: It would be a lot less than 64k, but yes, it would be per module. In fact, it would be per module + version. | 16:33 | |
mberends | lichtkind: I think that's the distinction between compile time macro calling and run time macro calling. The compile time substitutes the return value, the run time substitutes the macro body. | 16:34 | |
16:35
ZuLuuuuuu joined
|
|||
mberends | DanielC: indeed, and we need to distinguish only a handful of authorities | 16:35 | |
DanielC | mberends: Yes. | ||
lichtkind | mberends: now i get it big thanks | ||
mberends | lichtkind: thanks to you too, I didn't know that much when you began asking :) | 16:36 | |
lichtkind | haha | ||
DanielC | Fletcher-16 is faster but less reliable than Adler-32, right? | ||
mberends | collides a bit more often | ||
ISTR it's about 13 effective bits out of 16 | 16:37 | ||
DanielC | ok | ||
mberends | 8k authorities per module + version | ||
TimToady | that's not how macros work | ||
DanielC | assuming that's randomly distributed, that gives us 90. | ||
TimToady | nothing ever substitutes the macro body | 16:38 | |
mberends | lichtkind: heads up! | ||
DanielC | 90 authorities before we expect a collision via the birthday paradox. | ||
TimToady | a macro returns only a string or an AST | ||
a string is inlined (in its own scope) and reparsed | |||
lichtkind | mberends: what does mean that? i hope you particpate also in the p6 tut in which will lead my search (still german only) | 16:39 | |
TimToady | if you have { 3+4 } it would be stringified to '3+4' and reparsed | ||
an AST is just inserted | |||
16:39
alester_ joined
|
|||
DanielC | mberends: 13 random bits => 90 authorities before we get a collision (birthday paradox). | 16:40 | |
lichtkind | TimToady: so it doesnt matter if i write in the macro 3+4 or '3+4' but the difference if the macro is parsed or is reparsed? | ||
TimToady | run time doesn't change this, but assumes a sub {} around the AST (which, for a string return, would have to be compiled) | ||
16:40
alester left
|
|||
TimToady | there are only two possibilities, AST and everything else | 16:40 | |
16:40
FurnaceBoy joined
|
|||
mberends | DanielC: yes | 16:40 | |
TimToady | and everything else is assumed to be stringified | ||
mberends | DanielC: that would be 1 collision per 90 distinct (module+version) instances that have multiple authorities. Still unimaginably remote. | 16:42 | |
16:43
cotto left
|
|||
DanielC | mberends: It does sound unlikely in practice. Generally there is only 1 authority per module... | 16:43 | |
mberends | nod | ||
16:43
Psyche^ joined
|
|||
DanielC | mberends: On the other hand, do we really need the extra speed of a 16-bit sum? Is there any real harm in using a 32-bit sum? (Fletcher-32, Adler-32,CRC-32). | 16:45 | |
16:45
justatheory joined
|
|||
mberends | it results in shorter names for the filesystem | 16:46 | |
DanielC | 32-bits => 5 characters base 64. 16-bit => 3 characters base 64 (I think). | 16:48 | |
mberends | each base64 char is 6 bits | 16:51 | |
DanielC | So that means 6 characters vs 3 characters. | 16:52 | |
Foo::Bar-auth:92de10-ver:1.2.0 | 16:53 | ||
Foo::Bar-auth:a12-ver:1.2.0 | |||
lichtkind | TimToady: the is reparsed trait triggers the decision that a string is returned? | ||
DanielC | I don't think the extra 3 chars make a big difference. | 16:54 | |
TimToady | has nothing to do with whether a string is returned, but what the supplied rule is expected to parse | 16:55 | |
16:55
Patterner left,
Psyche^ is now known as Patterner
|
|||
lichtkind | TimToady: thanks that was the crucial bit to me, i understood it yesterday the other way around | 17:00 | |
17:00
rewt joined
|
|||
lichtkind | TimToady: so macro s is reparsed { '3+4' } say 2 * s(); result would be 10 ? | 17:03 | |
17:09
frew|work joined
|
|||
mberends | DanielC: base64 could also give you Foo::Bar-auth:AnYtXt-ver:1.2.0 | 17:10 | |
DanielC | mberends: yes | ||
And usually, it will. | |||
mberends | :) | ||
17:12
alester_ left
|
|||
DanielC | The Fletcher algorithm is really easy: ($A,$B) = 0; for @blocks -> $D { $A += $D; $B += $A } | 17:13 | |
dalek | kudo: 50ec44e | pmichaud++ | (3 files): Use iso-8859-1 (fixed-width) instead of utf8 for parsing when we can. |
||
kudo: 0b9c9a3 | tene++ | (2 files): Track changes in HLL library loading API. |
|||
mberends | DanielC: that may be why I once used it :) | 17:14 | |
DanielC | Fletcher16 and Fletcher32 are the same algorithm, with different block size. | ||
:) | |||
mberends | it was probably on PC-DOS, so 16 bit :) | 17:18 | |
DanielC | buubot: split | ||
hm... | |||
DanielC wants to find the simplest way to split a string into characters. | |||
mberends | buubot: spack split | 17:19 | |
buubot | mberends: S02-bits.pod:5 S03-operators.pod:2 S05-regex.pod:6 S06-routines.pod:2 S19-commandline.pod:9 S29-functions.pod:13 | ||
DanielC | thanks | ||
17:20
kane_ joined
|
|||
DanielC | sub Fletcher16($str) { | 17:21 | |
my ($A,$B) = (0,0); | |||
loop split //, $str -> $chr { | |||
$A = ($A + ord $chr) % 256; | |||
$B = ($B + $A) % 256; | |||
} | |||
return (chr $A) ~ (chr $B); | |||
} | |||
DanielC thinks that's about right. | |||
s/loop/for/ | 17:22 | ||
17:23
bloonix left
|
|||
DanielC | Hmm... still need to convert the output to hex or base 64. | 17:23 | |
mberends | part of the debate was about Unicode chars in names, so ord $chr will probably overflow 256. | 17:24 | |
DanielC | hm | ||
indeed | |||
mberends | but nevermind, it's close and a good first shot :) | ||
DanielC | :-) | 17:25 | |
17:26
bloonix joined
|
|||
DanielC | s/256/255/ | 17:29 | |
17:29
ejs joined
17:30
Traveler8 joined
17:35
kane__ left
|
|||
DanielC | rakudo: say ord "動" | 17:39 | |
p6eval | rakudo 764684: OUTPUT«21205» | ||
DanielC | On my computer it says 229. Why? | 17:40 | |
sjohnson | kanji for "move" | 17:42 | |
DanielC | Any idea why my local Rakudo's ord function gives 229? | 17:43 | |
pochi | rakudo: say "動".chars | ||
p6eval | rakudo 764684: OUTPUT«1» | ||
pochi | it probably doesn't think of it as unicode? | 17:44 | |
DanielC | rakudo: say "動".bytes | ||
p6eval | rakudo 764684: OUTPUT«ResizableStringArray: Can't shift from an empty array!in method Any::bytes (src/gen_setting.pm:242)called from Main (/tmp/HfNytq7uAt:2)» | ||
DanielC | Did I call the wrong method? | ||
mberends | DanielC: there may be differences between text from a script file and from your console, ie outside of rakudo | 17:45 | |
DanielC | mberends: Indeed, you are right. | 17:46 | |
mberends | .bytes is fairly new and possibly untested for some inputs. | ||
DanielC | I just put it in a file and now it gives the right answer. | ||
pmichaud | Parrot doesn't always know how to read things as utf8 from the command line or from the console input | 17:47 | |
17:50
[particle] joined
17:53
sri_kraih joined
|
|||
DanielC | Does Perl 6 have an integer division operator? | 17:59 | |
18:00
wknight8111 joined
|
|||
DanielC | int $a/$b will do. | 18:00 | |
mberends | DanielC: are you working on a Unicode hash now? | 18:03 | |
DanielC | yeah | 18:04 | |
sub Fletcher16($str) { | |||
my ($A,$B) = (0,0); | |||
for split //, $str -> $chr { | |||
my $val = ord $chr; | |||
$A = ($A + $val % 255) % 255; | |||
$B = ($B + $A) % 255; | |||
if $val > 255 { | |||
$A = ($A + int $val/255) % 255; | |||
$B = ($B + $A) % 255; | |||
} | |||
} | |||
return int2hex($A*256 + $B); | |||
} | |||
But I think my "split" line is broken. | |||
rakudo: say split //,"hello" | 18:05 | ||
p6eval | rakudo 0b9c9a: OUTPUT«Statement not terminated properly at line 2, near "//,\"hello\""in Main (src/gen_setting.pm:0)» | ||
pmichaud | // isn't a valid pattern | 18:06 | |
DanielC | :-( | ||
pmichaud | try '' | ||
DanielC | rakudo: say split '',"hello" | ||
p6eval | rakudo 0b9c9a: OUTPUT«hello» | ||
DanielC | rakudo: say (split '',"hello").perl | ||
pmichaud | rakudo: say (split '', 'hello').perl | ||
p6eval | rakudo 0b9c9a: OUTPUT«["h", "e", "l", "l", "o"]» | ||
DanielC | excellent. | ||
sjohnson | rakudo: say split '', "happy house".join " " | ||
p6eval | rakudo 0b9c9a: OUTPUT«Statement not terminated properly at line 2, near "\" \""in Main (src/gen_setting.pm:0)» | ||
pmichaud | rakudo: say 'hello'.split('').perl | 18:07 | |
p6eval | rakudo 0b9c9a: OUTPUT«["h", "e", "l", "l", "o"]» | ||
sjohnson | rakudo: say (split '', 'hello').join "-" | ||
p6eval | rakudo 0b9c9a: OUTPUT«Statement not terminated properly at line 2, near "\"-\""in Main (src/gen_setting.pm:0)» | ||
pmichaud | sjohnson: method calls required a : or ( ) for params | ||
(the .join) | |||
sjohnson | rakudo: say (split '', 'hello').join("-") | ||
p6eval | rakudo 0b9c9a: OUTPUT«h-e-l-l-o» | ||
sjohnson | >_> | 18:08 | |
<_< | |||
DanielC | rakudo: say ("hello".split('').map {.ord}).perl | ||
18:08
[particle]1 left
|
|||
p6eval | rakudo 0b9c9a: OUTPUT«Statement not terminated properly at line 2, near "{.ord}).pe"in Main (src/gen_setting.pm:0)» | 18:08 | |
pmichaud | std. say 'hello'.join '-' | ||
std: say 'hello'.join'-' | |||
p6eval | std 26977: OUTPUT«##### PARSE FAILED #####Syntax error (two terms in a row?) at /tmp/wNVLmQIjDh line 1:------> say 'hello'.join'-' expecting any of: POST infix or meta-infix infix stopper method arguments postfix postfix_prefix_meta_operator | ||
..standard stopper statement mod… | |||
pmichaud | std: say 'hello'.join '-' | ||
p6eval | std 26977: OUTPUT«##### PARSE FAILED #####Syntax error (two terms in a row?) at /tmp/xyC66rM6M3 line 1:------> say 'hello'.join '-' expecting any of: infix or meta-infix infix stopper standard stopper statement modifier loop terminatorFAILED 00:02 35m» | ||
DanielC | rakudo: map { ord $^a } "hello".split('') | 18:09 | |
p6eval | rakudo 0b9c9a: OUTPUT«Statement not terminated properly at line 2, near "\"hello\".sp"in Main (src/gen_setting.pm:0)» | ||
DanielC | :-( | 18:10 | |
pmichaud | need a comma between params | ||
DanielC | rakudo: map { ord $^a }, "hello".split('') | ||
p6eval | rakudo 0b9c9a: ( no output ) | ||
DanielC | :-) | ||
pmichaud | rakudo: say map { .ord }, "hello".split('') | ||
p6eval | rakudo 0b9c9a: OUTPUT«104101108108111» | ||
18:11
frew|work left
|
|||
DanielC | On my computer it gives : too few arguments passed (1) - 4 params expected | 18:11 | |
rakudo: say map { .ord }, "hello".split('') | 18:12 | ||
p6eval | rakudo 0b9c9a: OUTPUT«104101108108111» | ||
DanielC | ah, I know... | ||
stupid shell. | |||
mberends | quotes, huh? | ||
DanielC | yeah | 18:13 | |
mberends | afk & # birthday beers @neighbours | 18:15 | |
DanielC | pmichaud: Does Rakudo support #(( ... )) multi-line comments? | 18:16 | |
pmichaud | rakudo: say #(( not this )) "yes, it does"; | 18:17 | |
p6eval | rakudo 0b9c9a: OUTPUT«yes, it does» | ||
DanielC | Mine says: Can't use embedded columns in column 1 at line 3, near "((\n\tmy $fi | ||
pmichaud | oh, that should say "embedded comments" | ||
DanielC | But mine is a multi-line comments. | ||
pmichaud | multi-line comments aren't allowed to begin in column 1 | ||
18:18
jdv79 joined,
jdv79 left,
abra left
|
|||
DanielC | ? | 18:18 | |
pmichaud | S02 | ||
18:18
jdv79 joined
|
|||
DanielC | So I need to add a space before #? | 18:18 | |
lichtkind | mberends: still there? | ||
DanielC | pmichaud: I added a space before # and now it works. | ||
mberends | yes | 18:19 | |
pmichaud | S02: "An embedded comment is not allowed as the first thing on the line." | ||
jdv79 | anyone know if there is any online version of the talk entitled "The Art of Ballistic Programming" by L. Wall? | 18:20 | |
pmichaud | should be | ||
mberends | lichtkind: pong | ||
pmichaud | it was broadcast live when he gave it at MIT | ||
lichtkind | mberends: so if i understood larry correctly | 18:21 | |
mberends: so macro s is reparsed { '3+4' } say 2 * s(); result would be 10 ? | |||
mberends | lichtkind: I'm confused, because I would expect 14. but I'm really going now. Prost! | 18:22 | |
lichtkind | prost | ||
mberends: 14 would be in parsed mode | |||
skids | pmichaud: Apparently he wasn't mic'd well so only the slides came across. | 18:26 | |
18:26
jdv79 left,
jdv79 joined
|
|||
jdv79 | if anyone answered me could you answer again - my dsl line just died:( | 18:27 | |
DanielC | mberends / pmichaud: Unicode implementation of Fletcher-16 located in perl6-examples/misc/Fletcher.pl | 18:28 | |
I haven't tested it much. | 18:29 | ||
18:30
sri_kraih left
|
|||
lichtkind | anybody here with clue about p6 macros? | 18:33 | |
18:39
sri_kraih joined
|
|||
skids | jdv79: From what I heard, they tried to tape that talk, but the audio didn't come out. | 18:41 | |
18:47
finanalyst left
18:48
justatheory left,
Traveler8 left
19:06
DemoFreak joined
19:07
cls_bsd left
19:09
LadyLuna1y left,
LadyLunacy joined,
cls_bsd joined
19:10
LadyLunacy left
|
|||
DanielC | rakudo: "he_" ~~ /<-alpha -\_>/ | 19:11 | |
p6eval | rakudo 0b9c9a: OUTPUT«perl6regex parse error: Error parsing enumerated character class at offset 29, found '\'in Main (src/gen_setting.pm:0)» | ||
DanielC | Grr... I'm really struggling with the new regexes. | 19:12 | |
I want to match anything that is not alphanumeric and not an underscore. | |||
rakudo: "he_" ~~ /<-alpha -[_]>/ | 19:14 | ||
p6eval | rakudo 0b9c9a: ( no output ) | ||
DanielC | rakudo: "he_" ~~ /<-alpha -[_:-]>/ | ||
p6eval | rakudo 0b9c9a: OUTPUT«perl6regex parse error: Unescaped '-' in charlist (use '..' or '\-') at offset 32, found '-'in Main (src/gen_setting.pm:0)» | ||
DanielC | rakudo: "he_" ~~ /<-alpha -[_:]>/ | ||
p6eval | rakudo 0b9c9a: ( no output ) | ||
DanielC | rakudo: "he_" ~~ /<-alpha -[-_:]>/ | 19:15 | |
p6eval | rakudo 0b9c9a: OUTPUT«perl6regex parse error: Unescaped '-' in charlist (use '..' or '\-') at offset 30, found '-'in Main (src/gen_setting.pm:0)» | ||
DanielC | rakudo: "he_" ~~ /<-alpha -[\-_:]>/ | ||
p6eval | rakudo 0b9c9a: ( no output ) | ||
DanielC | rakudo: if "ab_" ~~ /<-alpha -[\-_:]>/ { say "y" } else { say "n" } | 19:16 | |
p6eval | rakudo 0b9c9a: OUTPUT«n» | ||
19:17
ejs1 joined
19:29
Maghnus left
19:30
Maghnus joined
19:31
eMaX joined
19:42
Fuad joined
|
|||
Fuad | Hello | 19:42 | |
Matt-W | hello | 19:59 | |
jnthn | hi Fuad :-) | 20:00 | |
20:02
viklund joined
|
|||
Fuad | howdy,jnthn:) | 20:03 | |
20:07
Eevee joined
|
|||
DanielC | rakudo: my @friends = ( {name=>"Joe"}, {name=>"Mike"} ); say @friends[0]{name}; | 20:07 | |
p6eval | rakudo 0b9c9a: OUTPUT«Could not find non-existent sub name» | ||
pmichaud | <name> | 20:08 | |
undeclared barewords are treated as subroutine calls in p6 | |||
DanielC | Am I supposed to put quotes around it? | ||
rakudo: my @friends = ( {name=>"Joe"}, {name=>"Mike"} ); say @friends[0]{'name'}; | |||
p6eval | rakudo 0b9c9a: OUTPUT«Joe» | ||
DanielC | ah | ||
pmichaud | you can either do @friends[0]{'name'} or @friends[0]<name> | ||
DanielC | thanks | ||
<name> is shorter. | |||
pmichaud | That's one of the reasons it's there :-) | ||
DanielC | Why does <name> work? I thought <> was a list constructor? | 20:09 | |
pmichaud | not precisely | ||
<name> is the same as ('name') | |||
which isn't a list | |||
jnthn | <name age> gets a hash slice though. :-) | ||
pmichaud | <abc def> is the same as ('abc', 'def') | ||
which is a list | |||
jnthn | %h<name age> that is | ||
iirc | |||
DanielC | ok... | ||
pmichaud | parens and angles don't construct lists | 20:10 | |
just like (3) is not a list | |||
neither is <3> | |||
DanielC | ok... | ||
pmichaud | (caveat: (3) might be a list now.) | ||
(there's some spec changes taking place) | 20:11 | ||
(regardless, %hash<name> is equivalent to %hash{'name'} | |||
and %hash<name age> is equivalent to %hash{'name', 'age'} | |||
jdv79 | skids: thanks | 20:13 | |
20:14
ejs1 left
20:25
wknight8111 left
20:26
eMaX left
20:27
cotto joined
20:32
eternaleye left
20:37
ejs left
|
|||
DanielC | @karma | 20:38 | |
lambdabot | You have a karma of 5 | ||
DanielC | Hmm... I don't get karma points for committing to perl6-examples. Oh well. | 20:39 | |
pmichaud: Is a module always one file? | 20:40 | ||
20:42
eternaleye joined
20:44
Fuad left,
M_o_C left
|
|||
pmichaud | I think Infinoid was going to switch dalek to report perl6-examples changes | 20:45 | |
DanielC | I thought he had already done it... | 20:46 | |
Anyways, is a module always one file? | |||
I'm just wondering if a module can contain many files. | 20:47 | ||
21:05
hanekomu joined
21:08
fridim_ left
21:10
hanekomu_ joined
21:26
hanekomu left
21:51
frew|work joined
21:53
volalba joined
|
|||
volalba | who studies CS here | 21:54 | |
21:57
iblechbot left
21:58
volalba left
22:12
jferrero joined
22:21
explorer__ left
22:27
tulcod left
22:41
volalba joined
|
|||
DanielC | This channel is quiet today. | 22:44 | |
22:45
volalba left
|
|||
jnthn | Sunday. | 22:48 | |
DanielC | I guess. | ||
pochi | they're all celebrating whit sunday | 22:49 | |
DanielC | I'm looking at the Rakudo source code. It's hard to find anything written in Perl. It's all Parrot. | 22:50 | |
literal | check the setting | ||
src/setting | |||
DanielC | ah, yes | ||
Lots of .pm files there. What is this directory for? Why is it called settings? | |||
literal | not settings, but "the setting" | 22:51 | |
aka. "the prelude" | |||
DanielC | ok | ||
22:51
hanekomu_ left
|
|||
literal | basically, the initial Perl 6 environment | 22:52 | |
see S32 on perlcabal.org/syn/ | |||
DanielC | Ok, I see where it defines 'class Object' | ||
I see the basic classes here. | |||
pmichaud | the other perl stuff is in src/parser/ | 22:53 | |
src/parser/actions.pm is the bulk of the compiler | |||
literal | I believe the idea is that this is the standard library which Perl 6 will provide by default, but in some environments people will swap it out for something else | ||
pmichaud | src/parser/grammar.pg is the grammar | ||
DanielC | pmichaud: What is a .pg file? | 22:54 | |
pochi | perl grammar? | ||
DanielC | It looks like Perl code. | ||
pmichaud | yeah, something like that. | ||
it's Perl code, at any rate, with a little bit of embedded PIR | |||
DanielC | One of these days I'll learn about the grammar features of Perl 6. | 22:55 | |
pmichaud | early on one of the Parrot architects wanted to distinguish grammars from other files, so .pg got chosen and we never really switched. | ||
DanielC | I have never learned a grammar programming language, or whatever they're called. | ||
pmichaud | in Perl 6 it's just regular expressions | ||
(very advanced regular expressions, but just regular expressions) | 22:56 | ||
DanielC | That's interesting. | ||
DanielC makes a mental note to read all of S05 | |||
S05 is... long. | |||
pmichaud | yes, there's a lot there. | 22:57 | |
DanielC | This 'rule' feature looks very nifty. | ||
You can make hierarchical regular expressions... | 22:58 | ||
skids | the enraging part is "i know i read something that did exactly what i want in S05, but can't find it now" :-) | ||
22:58
kate21de left
|
|||
DanielC | Can rules be recursive? For example, in a Lisp grammar you might define an element to be a number, a string, or a list of elements. | 22:59 | |
skids | DanielC: more than hierarchal, regexes are subs and grammars classes | ||
pmichaud | DanielC: yes, rules can be recursive. | 23:00 | |
DanielC | cool | ||
So you can define a natural number to be either 0 or 1 + a natural number :-) | |||
skids | DanielC: if you really want to fry your brain, read STD.pm | ||
DanielC | where can I find STD.pm ? | ||
skids | in the pugs repository | 23:01 | |
DanielC | Ok. Maybe later. | ||
literal | under src/perl6/ | ||
skids | yes, read s05 first :-) | ||
DanielC | :-) | ||
literal | svn.pugscode.org/pugs/src/perl6/STD.pm | ||
DanielC | I've scanned up and down S05 a lot, but I haven't read everything. | ||
*click* | 23:02 | ||
skids | he just couldn't resist, poor devil. | ||
DanielC | Mental note: figure out what a 'token' is in Perl. | 23:03 | |
pmichaud | it's a regex with backtracking turned off by default | ||
DanielC | What is a twigil? | ||
pmichaud | (a token is a regex with backtracking turned off by default) | 23:04 | |
literal | the * in $*VARIABLE | ||
skids | Second character after a sigil | ||
DanielC | What is backtracking? | ||
literal | en.wikipedia.org/wiki/Backtracking | ||
DanielC | Sorry if I'm asking too many stupid questions. | ||
*click* | |||
skids | You'll know when we start linking with lmgtfy.com :-) | 23:05 | |
DanielC | :-) | ||
In STD.pm I see twigils like . ! ^ : * + ? Does that mean that I might find $+VAR, $!VAR, $:VAR, etc ? | 23:06 | ||
skids | yep. | ||
literal | well, $+VAR is deprecated, I think | ||
DanielC | It's amazing that Perl would have that many variables. | 23:07 | |
skids | Twigils are for special purposes. | ||
literal | it's not really different variables, but different scoping usually | ||
skids | e.g. $!var is always an instance attribute. | ||
23:07
ZuLuuuuuu left
|
|||
DanielC | ok | 23:08 | |
Is $* always a file handle? | |||
$*FOO | |||
literal | nah | ||
DanielC | Seemed like a reasonable guess ($*IN) | ||
skids | It's scoping. | 23:09 | |
literal | it's a global/contextual variable | ||
$*IN is global to your process, for example | |||
pmichaud | well, not always :-) | ||
DanielC | So $*FOO is visible in all files, whereas a regular global is only visible in the current file? Is that right? | 23:10 | |
pmichaud | $*FOO refers to the innermost dynamic scope that declared $FOO as a context var | ||
if no such scope, then it looks in the process environment and some other places | |||
DanielC | How is a context var different from other vars? | 23:11 | |
pmichaud | it's one that can be searched via the calling stack | ||
it's like an environment variable in the shell | |||
DanielC | ok | ||
pmichaud | my $FOO is context; some_sub(); # inside of some_sub, $*FOO would refer to the $FOO I just declared | 23:12 | |
my $IN is context = open('file.txt', :w); say 'hello'; # outpus 'hello' to file.txt | |||
*outputs | |||
23:13
beggars left
|
|||
DanielC | In the $FOO example, why wouldn't you just use a global variable? | 23:13 | |
pmichaud | It's another way of controlling scope and reducing global variable conflicts. | 23:14 | |
Basically $*FOO means "the contextual $FOO defined by one of my callers | |||
DanielC | Is it mainly to remind you that the thing you are looking at is a global variable? | 23:15 | |
rakudo: my $a = 2; sub foo() { say $a }; foo() | |||
pmichaud | more than a reminder | ||
p6eval | rakudo 0b9c9a: OUTPUT«2» | ||
pmichaud | oh, I see what you're saying. | 23:16 | |
it's more like this: | |||
sub foo() { say $*a }; { my $a is context = 2; foo() } | |||
DanielC | ah | ||
pmichaud | that's how print() can refer to a $*IN that isn't in print's lexical scope | 23:17 | |
it's in print's callers' lexical scope(s) | |||
DanielC | rakudo: sub foo() { say $*a }; { my $a = 2; foo() } # should error | ||
p6eval | rakudo 0b9c9a: OUTPUT«Use of uninitialized value» | ||
DanielC | yeah | 23:18 | |
That's very neat. | |||
pmichaud | ("is context" isn't implemented in rakudo yet) | ||
and rakudo still treats $*a as globals, per an earlier version of the spec. | |||
DanielC | ok | ||
It's a very neat feature. So you can avoid making more truly-global variables. | 23:19 | ||
23:21
viklund left
|
|||
DanielC | sub count() { $*cnt++ }; sub bar() { my $cnt is context = 10; count(); count() count() } | 23:21 | |
DanielC missed one ; | 23:22 | ||
pmichaud | in that case it would need to be "is context<rw>" | ||
DanielC | sub count() { $*cnt++ }; sub bar() { my $cnt is context rw = 10; count(); count(); count() } | ||
That's an interesting feature. I've never seen anything like that. | 23:23 | ||
23:28
justatheory joined
23:44
DanielC left
23:51
snarkyboojum joined
23:52
justatheory left
23:56
icwiener left
23:57
snarkyboojum left
|