Re: Fwd: FOSDEM - perl 6 critic
Moritz Lenz writes: > Am 22.02.2011 16:57, schrieb Gabor Szabo: >> He, as a sysadmin would like to do the small tasks in a relatively >> small language. He would like to make sure the modules/applications >> he will download and will have to support are in such a relatively small >> language. > > Whatever Perl 6 will turn out to be, it won't be a small language. And just to complement the many answers: There *are* small variants of Perl6: Perlito and NQP. Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/>
Re: benchmarking against other languages
Guy Hulbert writes: > I am interested first in developing a generic framework around the > work already done for 'the benchmark game' (TBG*). I will pretend > that I am starting from scratch and define a protocol for adding > algorithms and exchanging information. > > I have been convinced that everything following has been done for > TBG but some of it is obscure. The details are hidden in CVS. > > I'd like to set things up so everything is fully automated. Perl6 > developers (and users :-) should be able to just run the benchmarks > in a "reasonable way" (one which halts :-) after installing the > latest rakudo release. Just a hint from my Perl5 benchmarking effort: I had to take quite some care to make benchmarking numbers stable. With every newly added library the numbers changed which made it difficult to have useful numbers over the lifetime of the benchmark suite itself. Feel free to look into http://cpansearch.perl.org/src/SCHWIGON/Benchmark-Perl-Formance-0.22/lib/Benchmark/Perl/Formance.pm and http://cpansearch.perl.org/src/SCHWIGON/Benchmark-Perl-Formance-0.22/ChangeLog especially around v0.20 to get some inspiration of why, how and when I forked plugins away, what I set to make a typical Linux system stable, etc., etc. It's all Perl5, but the collected ideas flew in from more general sources. If on the other side, you already have some more experiences on this topic I would love to hear comments and ideas to apply them to my Perl5 benchmarking. Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/>
Re: Production Release - was Re: Questions for Survey about Perl
"Stefan Hornburg (Racke)" writes: > Maybe we should focus on porting Perl 5 modules With the current size of CPAN this is IMHO not the way to go. A Perl5 embedding interface is more promising. Pugs had that in a not perfect but usable state. Not sure about Rakudo. An embedded Perl5 in Rakudo would even legitimate a special handling that does not need to be generic in the usual “all foreign-language vs. all Perl6-compilers” standard, because it's about Perl-on-Perl. Once I could easily access CPAN modules I would immediately start using Perl 6 for the daily routine work. The language has everything I need, I just can't hack all the things I regularly use from CPAN. Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/>
Re: Production Release - was Re: Questions for Survey about Perl
Daniel Carrera writes: > If they are critics to begin with, the size of the test suite will > not impress them. They could just as well conclude that Perl 6 must > have a million corner cases and gotchas that have to be tested. I > have never seen a language review that I thought was worth reading > that made a point out of the number of tests. The relevance of testing has changed over the last decade, so it is by itself quite a new trend, relative to programming in general. Today “test coverage” actually became a very strong argument for software. It become trendy on “normal” software, spilled over to formerly “untestable” software like Web applications and is even getting momentum on other difficult areas like Operating Systems. So I think the test suite is a strong Pro matching the zeitgeist. Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/>
Re: Production Release - was Re: Questions for Survey about Perl
Wendell Hatcher writes: > My point is make it a production release so peeps can push it to the > powers that be in the corporate world. Valid point. Will http://packages.debian.org/experimental/rakudo be continued? > This has been the longest production build in test in the history of > mankind. If this was a real world project it would have been dead > sometime ago. Don't worry too much. Python 3000 took about 8 years. (Though not sure about betas for testing.) Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/>
Re: Perl6 Modules - Documentation
Richard Hainsworth writes: > The number of modules available to proto has grown considerably. > > I am not aware that there is a convenient way of obtaining a short > description about each module, other than just the name? Just an opinion: imho every effort should go towards integrating CPAN in any way. Perl without CPAN feels like Kung-Fu on stack-heel shoe. Maybe any of those META2.0, cpanminus, CPAN::Packager, CPAN::Dpendency, MyCPAN::*, POD6 thingies could be assembled into something to integrate Perl6 with CPAN? And, yes, I consider it valid to have a Perl5 toolchain doing that. Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/>
Re: Perl 6 IDEs
"Víctor A. Rodríguez (Bit-Man)" writes: > Hi perlsixers, > > we've been working a bit on Perl 6 lately [1] and some work, even the > basic coding, would be great if we use some IDE. > I'm a regular Eclipse user and EPIC seems the natural choice for me, > but it doesn't support Perl 6 (yet). Also tied to install Padre on top > of Ubuntu but just went to nowhere :-P > > Did anyone tried any other Perl 6 aware IDE ?? There is a Perl6 aware cperl-mode.el for Emacs which works quite ok. Don't start a war on whether it's an IDE. I just wanted to mention it. Find it in the Pugs repository. Kind regards, Steffen -- Steffen Schwigon
Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5?
Parrot Raiser <1parr...@gmail.com> writes: > If Sun's propaganda about Dtrace : > http://www.sun.com/bigadmin/content/dtrace/ is anywhere near true Which I can confirm. DTrace *is* cool. Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: rakudo-current loop 2-3 orders of magnitude slower than perl 5?
Fagyal Csongor writes: > However, performance is an issue. I would not mind running into > bugs, writing some extra code to work around missing stuff, etc., > but right now it is just hard to find any projects (for me - YMMV) > where performance would not be a blocker. I suggest to start using it as replacement for sysadmin automation tasks. The same way Perl started to replace sh/sed/awk. This would not need all the funky OO or FP features you get with Perl 6 but many of those tasks are not speed critical and still of practical use and would already benefit from the syntax cleanup compared to Perl 5. Not that I had started doing this yet by myself but I'm more and more converging to it. :-) The very easy building of Rakudo since the last releases took most of the excuses out of the way. Thanks for that, by the way, Rakudo|Parrot developers, it's highly appreciated. Kind regards, Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: Rakduo Logo Proposal
Hi! Why not taking a camel with 6 humps? Just joking, could not resist. :-) Steffen -- Steffen Schwigon Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: Project Idea: Perl 6 Syntax Explainer
Moritz Lenz <[EMAIL PROTECTED]> writes: > Hi, > > considering the vast number of Operators and the like, I had the > idea to implement a tool where you can enter a small piece of p6 > syntax, and it explains what that might mean. (like a perldoc -f for > operators/syntax elements instead of functions) I really like the idea. > Now I'd like to hear your opinion: > * Is it useful at all? Yes. > * Is it possible to implement it satisfactory without building a > p6 compiler? It should ultimately be independent from building yet another compiler subproject. Else you don't find enough comrades to follow. I suggest not starting with an implementation but with the base description itself in any form. That might be a simple text file in pugs svn or a wiki page. That's step 1, IMHO. Do you think it's possible to extract and collect all the operators and descriptions from the synopses into one common place? If we had such a collection we would then format it in a second step into a structured collection and the third step is a frontend to that, the easiest part, IMHO. Step 1 is the real challenge, isn't it? Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: 99 problems in Perl6: 32 and a question on number coercion
gabriele renzi <[EMAIL PROTECTED]> writes: > Steffen Schwigon ha scritto: >> I looked at [1]. What's the purpose of "multi" in this case? >> (Maybe you wanted to write it as more than one subs, did you?) > > look the comment: > > # Yet, it should be possible to define it even for commutative rings > # other than Integers, so we use a multi sub. Damn, I ignored the comment as if it were my own. :-) Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: 99 problems in Perl6: 32 and a question on number coercion
Hi! gabriele renzi <[EMAIL PROTECTED]> writes: > Hi everyone! > > I solved the (easy) problem 32, implementing gcd($a,$b). > You can check the code in the repository or on the web[1] I looked at [1]. What's the purpose of "multi" in this case? (Maybe you wanted to write it as more than one subs, did you?) > But while writing this I noticed that a function written as > > sub gcd(Int $a, Int $b) > > still accepts float/rational values in input. > I think I read once that a variable of type Int would accept these > kind of assignment but that the value would be coerced to the new type > of the variable, i.e. > > my Int $a= 10.1 #=> 10 > > Could someone explain me what is the expected behaviour? Last time I experimented with this, the type system in Pugs looked unfinished. Type constraints were syntactically accepted but worked similar to typeless code in Perl5. I'm not sure about the current state. Anyway, in your example I hadn't expected a value coercion (from 10.1 to 10), but something like an error if the type doesn't match. But I can't find the right place in the synopses to verify it. Anyone with a clue here? Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: Embedded perl5 modules
Richard Hainsworth <[EMAIL PROTECTED]> writes: > Tried > use perl5:Wx::SimpleApp; > but the compiler complained it could not find SimpleApp.pm Did you see my other suggestion with an intermediate "WxHelper" (http://www.nntp.perl.org/group/perl.perl6.users/546)? It also doesn't really work but at least it gets you a step further. Try it and maybe you have the next idea as you maybe know Wx better than I do. Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/> Deutscher Perl-Workshop <http://www.perl-workshop.de/>
Re: Embedded perl5 modules
Richard Hainsworth <[EMAIL PROTECTED]> writes: >>Steffen said: >>Maybe an additional >> use perl5:Wx::SimpleApp; > Tried it. Doesnt work. In the meantime I tried my guess and also had to learn that. See also my experiments in my other answer. > *However, surely a perl6 program using a perl5 module should not > require a more complex calling structure/approach than the > equivalent perl5 module. > > Hence if > use Wx; > is sufficient for a perl5 program to find Wx::SimpleApp and Wx::Frame > packages (namespaces), then > use perl5:Wx; > should be sufficient for a perl6 program. > > No?? Of course you are right ... in a finished perfect world. But currently we have not yet arrived. Therefore I deduced my guess from the known issues with using Perl5-from-Perl6 regarding export/import. And when you write "use Wx;" and get all other packages "en passant", then Wx does some of that Exporter stuff. So Wx is a maybe a rather hard test for Perl5 integration. Did you have success using other Perl5 modules? I'm not sure about your target. If you want to learn Perl5 integration, maybe try something easier first. If you explicitly just need it with Wx, then maybe you still have to wait some time or find someone from the Pugs coders who might help. Maybe we should write a little test in the Pugs repository for that behaviour. Without Wx but with that indirect package export/import that Wx does. I'm just not sure where it belongs. Maybe near t/perl5/import.t --> go for it, if you dare. :-) Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Embedded perl5 modules
Steffen Schwigon <[EMAIL PROTECTED]> writes: > Richard Hainsworth <[EMAIL PROTECTED]> writes: >> use perl5:Wx; >> my $app = Wx::SimpleApp.new; >> my $frame=Wx::Frame.new(undef, -1, 'Hello world!'); >> $frame.Show; >> $app.MainLoop; >> >> The following is the result: >> $pugs wxtest.p6 >> *** No compatible subroutine found: "&Wx::SimpleApp" >>at wxtest.p6 line 2, column 1-28 >> >> Is the perl6 wrong? >> >> I have also tested >> use perl5:Wx ; > > Maybe an additional > > use perl5:Wx::SimpleApp; > > ? I'm just guessing... Hm. Generally I have much more success using Perl5 modules with Pugs 6.2.13. But maybe Wx is a bit harder. I tried to trick it with an additional Perl5 helper to not use the indirect namespaces, like this: WxHelper.pm (Perl5): package WxHelper; use Wx; sub new_SimpleApp { return Wx::SimpleApp->new(@_); } sub new_Frame { return Wx::Frame->new(@_); } 1; This adapted to your little program (Perl6): #! /usr/bin/pugs use perl5:Wx; use perl5:WxHelper; my $app = WxHelper.new_SimpleApp; my $frame = WxHelper.new_Frame(undef, -1, 'Hello world!'); $frame.Show; $app.MainLoop; But now I get sub must be a CODE reference at /usr/local/lib/perl/5.8.7/Wx/App.pm line 36. I don't know Wx, maybe you have an idea for this, e.g. another way to start a mini application. BTW, I tried it on Linux with GTK bindings. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Embedded perl5 modules
Richard Hainsworth <[EMAIL PROTECTED]> writes: > use perl5:Wx; > my $app = Wx::SimpleApp.new; > my $frame=Wx::Frame.new(undef, -1, 'Hello world!'); > $frame.Show; > $app.MainLoop; > > The following is the result: > $pugs wxtest.p6 > *** No compatible subroutine found: "&Wx::SimpleApp" >at wxtest.p6 line 2, column 1-28 > > Is the perl6 wrong? > > I have also tested > use perl5:Wx ; Maybe an additional use perl5:Wx::SimpleApp; ? I'm just guessing... Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Web development II: Code
Juerd <[EMAIL PROTECTED]> writes: > Some pseudo-code for illustration. Maybe we should put this on > version control or wiki Just to state this somewhere: if anyone needs a subversion repository for such Perl6 related stuff, I'm willing to setup svn repositories and users on our Dresden Perl Mongers server. Just ask me, now or in future. Might be good, for instance, if the projects feel too early or experimental to be hosted on major Perl/Pugs/Feather/Sourceforge resources. GreetinX Steffen -- Steffen Schwigon <http://renormalist.net> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Trying to make a new operator
Richard Hainsworth <[EMAIL PROTECTED]> writes: > Thanks for help. For anyone else, the following works. > > sub infix: {...}; > > (32 grew_by_to 48).say; > > sub infix: ($left, $right) { > return ($right/$left - 1) * 100 ~ '%'; > }; Thanks for reporting the solution back. And it even works with unicode operators. Looks like we finally really get our "ankh, pentagram, and that smiley teddy bear from that Grateful Dead album". (*) :-) Thanks to Unicode, thanks to Pugs. (*) The senior ones of us possibly remember the good old days: http://www.perl.org/yapc/2002/movies/themovie/ GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: the CGI.pm in Perl 6
Thomas Wittek <[EMAIL PROTECTED]> writes: > An other acceptable solution would be to create a backwards > compatible P6 CGI.pm and create a new Web.pm with an all new > interface, like Mark suggested. But then this new module cannot > profit of the popularity of the name "CGI.pm" and many people will > say "Ah, Perl6 web development is stuck at the 10 years old Perl5 > CGI.pm interface. I'll use (python|ruby( on rails)?|.+)". That would > be sad. IMHO even Perl people like me will think "Ah, Perl6 web development is stuck at the 10 years old Perl5 CGI.pm interface" just *because* of the name, regardless of a changed internal api. I would strongly expect the CGI module to do the same as it did for the last 200 years and create another name for any new school web development. Catalyst, Jifty, Acme, Acyou, SillyIdol, WhatEver. The name "CGI" smells like, erm, yes, C...G...I. If RoR would have sold itself with "CGI" in its name, it hadn't been that successful. In mankind's history, everything *not* named CGI had a chance to success, even PHP. It will be impossible to resurrect a hype around the word "CGI". Because of the word. Not the api. IMHO. Of course. :-) GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: cperl-mode.el: twigils and opers
Steffen Schwigon <[EMAIL PROTECTED]> writes: > I checked and indeed the twigils don't work. My test source file > (which worked correctly some time ago) also highlights wrong. It's for > sure a bug I introduced. I now did some things on cperl-mode (eg. syncing with original v5.20) and it seems highlighting of twigils generally works again. Please try again, but in the meantime with longer variable names, because ... > I can't promise that it also worked with "y" as variable > name. That's probably a second issue. That's indeed a different issue. Using short variable names y,tr,s,m,... with twigils still irritates it. Not yet solved. Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: cperl-mode.el: twigils and opers
Trey Harris <[EMAIL PROTECTED]> writes: > In a message dated Mon, 4 Sep 2006, Steffen Schwigon writes: >> First you could try an older revision, I recommend r7845 or r10822 of >> pugs repository. > > No, neither of those work. To see what I'm talking about, just create > a file containing: > > use v6-alpha; > > class Point { > has $.x; > has $.y; > } > > and try creating more code under the "has $.y" line, and notice that > indenting and highlighting after that point don't work because emacs > thinks it's in the middle of a y///. I checked and indeed the twigils don't work. My test source file (which worked correctly some time ago) also highlights wrong. It's for sure a bug I introduced. I can't promise that it also worked with "y" as variable name. That's probably a second issue. But it should also be possible to solve. > Well, a fork for cperl6-mode wouldn't be the worst thing... at least > then it would be possible to have working syntax highlighting and > indention for Perl 6. This time the issues should be solvable. Forking shouldn't be neccessary for this. I try to have a look at it this week. Sorry that I'm not as fast as pugs development normally feels. :-) GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: cperl-mode.el: twigils and opers
Trey Harris <[EMAIL PROTECTED]> writes: > [cperl-mode.el] As you already noticed cperl-mode.el is a very strange piece of software. It's probably misunderstood like astronomers in the Dark Ages. > Variables with twigils whose name matches something else are getting > recognized incorrectly. For example, $.x is getting interpreted as > $. followed by the x operator, $.system as $. and system, and so on. I already tried to do something about twigils and the dot syntax ($.foo, %.foo, ...) *should* already work. If not, I might have introduced bugs during rather strange merge sessions with original cperl-mode that sometimes happen. First you could try an older revision, I recommend r7845 or r10822 of pugs repository. Second, there are known issues with two, hm, how to say?, "different highlighting models" that seem to rival each other. Bind a key to re-fontify and see what happens. In my emacs config I use (global-set-key [f3] 'font-lock-fontify-buffer) and pressing f3 corrects the wrong highlighting. I don't know why that's the case. Dark Ages are calling. > Can anyone help fix cperl-mode with twigils? I will help, I already have some kind of that "thousand yard stare" when I look at it. I'm only just in the middle of one of those "lack of time" phases. Generally I currently feel quite alone with my patches. I already contacted local lisp heros in my town but they say: start to refactor some things (even with concrete code suggestions), but I didn't implemented them because of drifting away from original cperl-mode. Incorporating my patches is difficult because of at least one huge, silly copy'n'paste hack to make the new regex syntax possible. And my Lisp-Foo an not match with the "officialness" and the extreme backwards compatibility demands of the original cperl-mode. *Maybe* a clear fork away from the original cperl-mode would make sense. We could refactor with the help of other lisp coders and throw away backwards compatibility issues we don't know about. But it's a very big "maybe". Having one mode for all perl versions and for both major Emacs variants with high backwards compatibility is a big plus and there is much knowledge in original cperl-mode that progresses itself, even as we speak. Currently I wouldn't fork it. BTW, I work with XEmacs 21.4.7. What's your Emacs? GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Help getting pugs working?
Jeff Stampes <[EMAIL PROTECTED]> writes: > We're running Red Hat Enterprise 4, and I'm stuck at square one, > trying to get GHC running. You need ghc working to compile ghc, or > you need to bootstrap it. Did you already try one of the binaries from http://www.haskell.org/ghc/download_ghc_641.html ? > Is this really as hard as it seems to me? I used to think I was > reasonably bright It should be easy, it's just the starting step that can be tricky, inherently to bootstrapping in general. But I can not really believe that RedHat doesn't have any old version of haskell available somewhere. Have a second look, try the URLs above for binaries and then it's really just a sequence of configure, make, make install (and some hours of waiting between those steps). If in doubt, read http://dresden-pm.org/cgi-bin/twiki/view/PM/PugsFirstBloodEnglish#Haskell to get a general idea of the easiness, although it's not RedHat-driven. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Stubborn coworkers
Jeff Stampes <[EMAIL PROTECTED]> writes: > "My bigger concern with the Perl6 syntax is that they expect humans > to write it. This is a similar problem that Forth and Lisp had. > You see how widely used those are now..." It will always be difficult to compare Perl X against any other language. Perl5 and Perl6 look the same from a Lispish point of view. I would start with the fact that Perl5 *has* very widespread use and *is* still one of the mainstream languages. Once he accepts that fact, tell him Perl6 makes things better that are difficult in Perl5. So try to compare Perl6 with Perl5, not Perl6 with AnyOtherLanguage, because that's just the same old discussion since Perl's birthday. Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: a practical question
Richard Nabil Hainsworth <[EMAIL PROTECTED]> writes: > But I want to start doing real things. Which for me requires gui > toolkits. > > I have used Tk with perl5 and I am looking at WxWidgets. > > WxWidgets (and the more commercial Qt) exist as C++ classes, > although WxPerl is a set of wrappers around WxWidgets for perl5. > > So how to write an application in perl6 that uses (for the sake of > illustration) WxWidgets? I don't think there's a big knowledge base beside what the current Pugs hackers know. But if I were you, I would start a small step before, especially with experimenting with the "use perl5:Some::Lib;"-features and generally the current ways of intermixing Perl5 and Perl6. I would love to see a "Pugs Use Perl5 - First Blood" article somewhere, made from users for users. It's on my personal TODO list too and I will help you with experimenting, but I'm currently, erm, well, occupied with @otherstuff ("the same excuse as every year"). If you start experimenting and writing down something, expect me to follow you. If we know and document something in an easy understandable form, wxWidgets or any other lib can be the next step. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
RFF: test Emacs Perl6 mode
Hi! This is a small Request For Feedback. I want to hear if *anyone* who writes or experiments with Perl6/Pugs these days uses (X)Emacs to write his/her code. If so, would you please try out the enhanced cperl-mode from http://svn.openfoundry.org/pugs/util/cperl-mode.el Some additional help for the occasional Emacs user can be found here: http://www.renormalist.net/cgi-bin/twiki/view/Renormalist/CPerlMode As I said, all I want is some feedback, whether it works for you, which install problems you have or which perl6 syntax still breaks it. BTW, my Lisp-Foo isn't that great, so if anyone wants to help with this little project, feel free to contact me. Or just hack away on it from inside Pugs. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Mutil Method Questions
Thomas Wittek <[EMAIL PROTECTED]> writes: > So it looks like we can hide several multis with one sub: > [ example ] Maybe the type system in Pugs is not yet in such a final state to experiment with it in all that details. I can construct other examples or "reverse engineer" the neighbor discussion about foo("123) where it also doesn't behave as I would expect. > Maybe we should steal the ruby "principle of least surprise" here, > which I find a very good principle. I'm quite confident that Larry already stole all good principles he could find. If there would be a "Full Metal Perl" movie, the imdb quote collection would contain: "These are great days we're living, bros. We are jolly green giants, walking the Earth with Perl6. These principles we stole here today are the finest principles we will ever know. After we rotate back to the world, we're gonna miss not having any principle around that's worth stealing." GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Mutil Method Questions
Thomas Wittek <[EMAIL PROTECTED]> writes: > Steffen Schwigon schrieb: >> At least the many keywords seem to be necessary to map the complexity >> of different paradigms possible in Perl6. Multimethods are not just >> overloading as in C++. Second, the different keywords declare >> different behaviour you can choose. Just read S06, it's explained >> quite understandable. > > Hm, but wouldn't whose be equivalent? > > sub foo ($bar) { > $bar.say; > } > > multi sub foo ($bar) { > $bar.say; > } > > Aren't subs a subset of multi subs, meaning that every sub can be > expressed as a multi sub? > Is there anything a sub has in advantage of a multi sub? > So might not just every sub be a multi sub? > If the only difference is, that you _must not_ declare a sub twice with > different argument lists, I think that this one is relatively > unimportant and letting every sub be a multi sub seems to be more > consistent to me in opposite to this arbitrary looking distinction. > > Maybe I just phenomenally misunderstood multi subs, but unless I > did, I can't see why we want to have subs when we can have multi > subs that can do the same and even more. I understand your point and I confess I'm not sure. At least there seems to be a visibility difference. In S12 I found those two sentences: 1. [sub (or method) without a multi] [...] Only one such sub (or method) can inhabit a given namespace, and it hides any outer subs (or less-derived methods) of the same short name. 2. [subs or methods declared multi] [...] It does not hide any routines with the same short name but a different long name. In other words, multis with the same short name can come from several different namespaces provided their long names differ and their short names aren't hidden by a non-multi declaration in some intermediate scope. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Mutil Method Questions
Steffen Schwigon <[EMAIL PROTECTED]> writes: > multi sub talk () { say 'Loose Talk Is Noose Talk.'; } > multi sub talk (String $msg) { say $msg; } > multi sub talk (String $msg, Int $times) { say $msg x $times; } BTW, because we are just on-topic, can someone explain, when these types above are used. They seem pretty useless in my example but it looked that nice. :-) How do I extend the example to really check the parameter types. Some kind of "use strict" anywhere? GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Mutil Method Questions
"Chris Yocum" <[EMAIL PROTECTED]> writes: > Hi All, > At the risk of sounding a bit thick, I have a couple of questions > about Perl6's multi keyword and mutilmethod in general. This seems > like overloaded functions from C++ so why do we need a key word to > declare them rather than using something like C++'s name mangling? Is > there something that I am just missing here? Because of your question I had a look at Synopsis 6 (http://dev.perl.org/perl6/doc/design/syn/S06.html). I should do this more often. Maybe you should also have a look. It's always refreshing. At least the many keywords seem to be necessary to map the complexity of different paradigms possible in Perl6. Multimethods are not just overloading as in C++. Second, the different keywords declare different behaviour you can choose. Just read S06, it's explained quite understandable. > can we now write generic/overloaded functions in Perl6 without OO or > have I conflated OO with overloading incorrectly? However it's currently called, with multimethods you can elegantly "divide and conquer" your code into different subs instead of ugly "parameter checking if-cascades". multi sub talk () { say 'Loose Talk Is Noose Talk.'; } multi sub talk (String $msg) { say $msg; } multi sub talk (String $msg, Int $times) { say $msg x $times; } talk("Hi", 10); talk("Hello"); talk; GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: $1,000 prize for Perl 6 Wiki written in Perl 6
Ask Bjørn Hansen <[EMAIL PROTECTED]> writes: > Woah, we are getting really far away from talking about perl6 > here... Kind of a usenet law or corollary? "Every discussion about wikis ends in a discussion about the best wiki syntax." Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Fwd: 3 Good Reasons...
"Michael Mathews" <[EMAIL PROTECTED]> writes: > I'm glad you made that point. If I understand your statement, it's a > common "gain" cited by Perl 6 (actually Parrot) advocates: you can mix > languages. But a point I was trying to make was that while this is fun > for us developers, managers hate it, with very good reason. Having one > crucial part of a system written in, say Python, when the other 98%is > in Perl, is actually considered a Bad Thing. It means having to have > experts in two languages around at all times should anything go wrong. I don't think it's about hacking a project with two or more languages from scratch. I think it's about using strong libraries that emerged in other language worlds. In the Perl world it is common practice to find a wrapper on CPAN that makes a foreign language module (mostly C) usable. It's that common because of to the "gluey" nature of Perl and the mostly easy way to use C code. If that practice would expand to not mostly C libs, as it's usual today, but practically to a general use of much more libs from the outside world, that would be a Good Thing, because a lot of problems would be solved not just "once per language" but even really "once per universe". And within the Perl5/Perl6 world I think we don't even have to set all our money and propaganda on Parrot. Look at the Pugs project and read Audreys blogs to see how they couple the Perl5 and Perl6 world with a lot more tricks than only by bytecoding to Parrot. They do it right now and in both directions. Not always without hazzle, but it's just the beginning. Summa summarum: So I don't think it's about hiring the same number of language experts as the number of different languages you use. I think it's about making programming more borderless, making the use of libraries similar to todays typical use of whole programs, independently of the language it's written in. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: 3 Good Reasons...
"Michael Mathews" <[EMAIL PROTECTED]> writes: > So my question to the list is, in simple terms even an IT manager > could grasp, explain what problems Perl 5 has that Perl 6 fixes, > such that they would want to undergo the pain of ever switching. >From a Perl point of view: there should be no pain. At least that's a stated goal. >From a manager point of view: it's as use(ful|less) as ever to decide for a language independently of the problem to solve. If Perl5 does the job, stick with it. If Perl6 helps you somewhere, use it. If Visual Basic solves your problem because it's already built into the problem, just use it. Perl5 is already gluey enough to not force you into a decicion for *the only one* technology. Perl6 shouldn't change that. Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Simple Print/Say Question
"A. Pagaltzis" <[EMAIL PROTECTED]> writes: > * Steffen Schwigon <[EMAIL PROTECTED]> [2006-05-24 13:55]: >> "A. Pagaltzis" <[EMAIL PROTECTED]> writes: >> > * Martin Kjeldsen <[EMAIL PROTECTED]> [2006-05-24 12:25]: >> >> I understand this as the hash entry with key 'array' get >> >> assigned a array consisting of $count number multiplied by >> >> $scale. If that is right, we must be modifying $arg_for >> >> (%buckets) since we are adding an entry to the hash. >> > >> > $arg_for is a reference to a hash. The hash is modified, but >> > not the reference to it. >> >> It's probably an unimplemented/buggy feature of Pugs. > > Err I think you misread my mail. I meant that the code modifies > the hash, but does nothing to modify the reference, so there is > no need to make the reference read-write. In my understanding, the '->' makes an alias to the elements of the hash, which is different from being a reference. And the "is rw" modifies that alias (the loop element). You are right, in that the "is rw" shouldn't be needed because the loop element alias should be "rw" by default. Which in turn it isn't, because of the pugs bug. That's I think why the discussed problem and the pugsbug could be related. Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Simple Print/Say Question
"A. Pagaltzis" <[EMAIL PROTECTED]> writes: > * Martin Kjeldsen <[EMAIL PROTECTED]> [2006-05-24 12:25]: >> I understand this as the hash entry with key 'array' get >> assigned a array consisting of $count number multiplied by >> $scale. If that is right, we must be modifying $arg_for >> (%buckets) since we are adding an entry to the hash. > > $arg_for is a reference to a hash. The hash is modified, but > not the reference to it. It's probably an unimplemented/buggy feature of Pugs. I didn't completely follow every detail of your discussion but I know of a problem where aliasing only works readonly, currently. There is a pugsbugs-test for that problem. See http://svn.perl.org/perl6/pugs/trunk/t/pugsbugs/value_alias_readonly.t Currently one has to workaround that, e.g. work with hash elements and explicitly assign the result back via "%hash{$_} = ..." or similar. AFAIR. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Getting to hello world?
"James Peregrino" <[EMAIL PROTECTED]> writes: > You folks took me too literally :) I meant: Given a system without > pugs/parrot/haskell (I assume perl5 is required), what are the > things you need to install I just translated my german "Pugs First Blood" notes about how to compile Pugs. Try one of these topics on our Dresden Perl Mongers site: http://dresden-pm.org/cgi-bin/twiki/view/PM/PugsFirstBlood http://dresden-pm.org/cgi-bin/twiki/view/PM/PugsFirstBloodEnglish Maybe it helps. It isn't that hard but Feel free to add them to the FAQ if they are worth it. GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>
Re: Where can I find a Perl 6 langauge reference?
Thomas Wittek <[EMAIL PROTECTED]> writes: > Where is the best place to take a look at, when I want to start > experimenting with Perl 6 and pugs? As your email address looks german, maybe my (german) notes about compiling my first Pugs is helpful to you: http://dresden-pm.org/cgi-bin/twiki/view/PM/PugsFirstBlood GreetinX Steffen -- Steffen Schwigon <[EMAIL PROTECTED]> Dresden Perl Mongers <http://dresden-pm.org/>