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: Changing permissions on temporary directories during testing
See the test suite for File::Flat, I put a ton of work into making sure it worked, and a lot of code doing filesystem stuff. Adam K James E Keenan wrote: Let's say that I'm writing a test suite for a Perl module which creates files and then, optionally, moves those files to predetermined directories. To test this module's functionality, I would have to see what happens when the user running the tests does not have write permissions on the destination directory (e.g., test whether an appropriate warning was issued). But to do *that*, I would have to change permissions on a directory to forbid myself to write to it. This code is intended to achieve that goal but doesn't DWIM: my ($file, $workdir, $destdir); { $workdir = File::Temp::tempdir(); chdir $workdir or die Cannot change to $workdir; $file = system(touch alpha); $destdir = $workdir/other; chmod 0330, ($destdir) or die Cannot change permissions on directory; # dies on preceding line rename $file, $destdir/$file or die Cannot move $file; } Is there any other way to do this? Or am I mistaken in even attempting to try it? Thanks. Jim Keenan
Re: Changing permissions on temporary directories during testing
James E Keenan wrote: Let's say that I'm writing a test suite for a Perl module which creates files and then, optionally, moves those files to predetermined directories. To test this module's functionality, I would have to see what happens when the user running the tests does not have write permissions on the destination directory (e.g., test whether an appropriate warning was issued). But to do *that*, I would have to change permissions on a directory to forbid myself to write to it. This code is intended to achieve that goal but doesn't DWIM: my ($file, $workdir, $destdir); { $workdir = File::Temp::tempdir(); chdir $workdir or die Cannot change to $workdir; $file = system(touch alpha); $destdir = $workdir/other; chmod 0330, ($destdir) or die Cannot change permissions on directory; # dies on preceding line rename $file, $destdir/$file or die Cannot move $file; } Is there any other way to do this? Or am I mistaken in even attempting to try it? Thanks. How portable does this need to be? My inclination is not to mess with file permissions in a test suite if you can avoid it. I'd probably just mock/override rename to report failure in the module under test: BEGIN { *Module::Under::Test::rename = sub { 0 }; } use Module::Under::Test; For system interaction tests, I prefer to fake failures rather than try to manufacture them. Regards, David
Parrot Bug Summary
Parrot Bug Summary http://rt.perl.org/rt3/NoAuth/parrot/Overview.html Generated at Mon May 22 13:15:02 2006 GMT --- * Numbers * New Issues * Overview of Open Issues * Ticket Status By Version * Requestors with most open tickets --- Numbers Ticket Counts: 82 new + 206 open = 288 Created this week: 5 Closed this week: 7 --- New Issues New issues that have not been responded to yet 1 - 2 weeks old 39132 [TODO] pirtidy - call for help 2 - 3 weeks old 39092 [TODO] Autogenerate functions in *.h files from source 39088 [TODO] Add conditional GCC attributes to functions 39056 [BUG] vtable override doesn't work in sub-subclasses 39052 namespace-related failure in t/pmc/objects_74.pir 39051 Test failure in t/pmc/objects_62.pasm (attributes) 39050 Build failure in compilers/pge/pgc.pir 39043 [TODO] Dynamic PMCs should not include 'parrot/parrot.h' 3 - 4 weeks old 39018 t/pmc/complex failures on Solaris 8/SPARC 39004 [PDD] review pdd25_threads.pod 39003 [PDD] review pdd24_events.pod 39002 [PDD] review pdd23_exceptions.pod 39001 [PDD] review pdd22_io.pod 39000 [PDD] review pdd19_pir.pod 38999 [PDD] review pdd18_security.pod 38998 [PDD] review pdd17_basic_types.pod 38997 [PDD] review pdd16_native_call.pod 38996 [PDD] review pdd15_objects.pod 38995 [PDD] review pdd14_bignum.pod 38994 [PDD] review pdd13_bytecode.pod 38993 [PDD] review pdd12_assembly.pod 38992 [PDD] review pdd11_extending.pod 38991 [PDD] review pdd10_embedding.pod 38990 [PDD] review pdd09_gc.pod 38989 [PDD] review pdd08_keys.pod 38988 [PDD] review pdd07_codingstd.pod 38987 [PDD] review pdd06_pasm.pod 38986 [PDD] review PDD05_opfunc.pod 38985 [PDD] review PDD04_datatypes.pod 38984 [PDD] review pdd02_vtables.pod 38983 [PDD] review PDD01_overview.pod 38969 parrot source does not conform to standards 38967 Parrot 0.5.0 4 - 5 weeks old 38964 .sub names can't be Unicode. 5 - 6 weeks old 6 - 7 weeks old 38887 Result of INFINITY or NAN stringification is platform dependent 7 - 8 weeks old 38823 [BUG] solaris 10 w gcc 8 - 9 weeks old 38788 make test results 9 - 10 weeks old 38764 Test results of parrot on Freebsd 10 - 11 weeks old 38691 OSX bus error in punie-clone 11 - 12 weeks old 12 - 13 weeks old 38594 [BUG] source line numbers 13 - 14 weeks old 14 - 15 weeks old 38469 [BUG] -O1 branch optimization 15 - 16 weeks old 38432 Exception thrown from constructor leads to oddness 16 - 17 weeks old 17 - 18 weeks old 18 - 19 weeks old 19 - 20 weeks old 38131 Configuration system should detect symlinks availability 20 - 21 weeks old --- Overview of Open Issues Platform Severity Tag Lang Win32 3abandoned 05005threads 0 BASIC0 sco 0fatal 0notok 0 Zcode0 riscos0High 0ok0 Amber0 qnx 0low 1Patch11 punie1 powerux 0medium0regex 0 bc 0 other 0none 0sendToCPAN0 urm 0 os390 0Normal1Todo176 tcl 25 os2 0unknown 0unknown 0 scheme 0 openbsd 1Wishlist 3utilities 0 ruby 0 next 0 notabug 0 python 0 Solaris 0 library 0 plot 0 sunos 0 install 1 ook 0 svr4 0 bounce0 m4 0 VOS 0 Bug 19 jako 0 vms 0 compiler 0 forth0 uts 0 configure 0 cola 0 unknown 0 core 0 bf 0 unix 0 dailybuild0 befunge 0 unicosmk 0 docs 0 Lisp 0 unicos0 duplicate 0 sysv 0 wontfix 0 svr5 0 netbsd0 mswin32 0 dynixptx 0 dos 0 dgux 0 dec_osf 0 darwin0 cygwin_nt 0 cygwin0 bsdos 0 All 2 freebsd 0 generic 0 gnu 0 MacOS X 0 macos 0 machten 0 mac 0 lynxos0 Linux 0 irix640 irix 0 HPUX 0 aix 0 --- Ticket Status By Version New or OpenResolved
Re: Getting to hello world?
On Ubuntu it was quite straigt forward, I think this is everything I needed: sudo apt-get install subversion sudo apt-get install ghc6 mkdir ~/src cd ~/src # To compile Parrot svn co https://svn.perl.org/parrot/trunk parrot cd parrot perl Configure.pl --prefix=$HOME/parrot --cc=cc --cxx=CC --link=cc --ld=cc make make test make install # added the following to ~/.bashrc and ran source ~/.bashrc export PATH=$HOME/parrot/bin:$PATH export LD_LIBRARY_PATH=$HOME/parrot/lib/ export PARROT_PATH=$HOME/work/parrot # To compile Pugs I use the following: cd ~/src svn co http://svn.openfoundry.org/pugs perl Makefile.PL make I have not installed it anywhere # Now I can use it ./pugs -e 'say Hello world' Gabor
Re: [perl #39173] Multi-Dispatch Incompatible with :flat Params
On Mon, May 22, 2006 at 12:22:26AM +0200, Leopold Toetsch wrote: On May 21, 2006, at 23:10, chromatic wrote: foo([,] eager @onetothree); # array flattened before foo called Hmm, seems that another call signature bit is in order then, which looks into flattening arrays for multi dispatch purposes. Why not just specify that :flat always expands before MMD dispatch? I don't see much of a use case for the current behavior. -- Chip Salzenberg [EMAIL PROTECTED]
Re: [perl #39173] Multi-Dispatch Incompatible with :flat Params
On May 22, 2006, at 20:28, Chip Salzenberg wrote: Hmm, seems that another call signature bit is in order then, which looks into flattening arrays for multi dispatch purposes. Why not just specify that :flat always expands before MMD dispatch? I don't see much of a use case for the current behavior. Good idea. Done that - r12753. Thanks all for the input, leo
Re: Changing permissions on temporary directories during testing
On 5/22/06, David Golden [EMAIL PROTECTED] wrote: How portable does this need to be? My inclination is not to mess with file permissions in a test suite if you can avoid it. ... For system interaction tests, I prefer to fake failures rather than try to manufacture them. All things being equal, its better to test the real code than stub bits out to fake a failure. It brings your tests closer to reality. Sometimes this isn't possible, but with filesystem tests it usually is. The safest thing to do is work inside your t/ directory rather than the system temp directory which you may or may not have permission to use. It may not even exist. You can still use File::Temp for this, just use the DIR option. use File::Temp; my $tempdir = tempdir( DIR = t ); This will create a temporary directory inside t/ which you own and you're free to do whatever you want with.
parrot and pugs builds for os x
Hi everyone, I fiddled around with PackageMaker and created packages for Pugs (r10396) and Parrot (r12747) for OS X. I used my laptop to check if they installed everything properly, and it seems they do. If you want to try them out, I'd be interested in some feedback: http://www.unobe.com/packages/ For now, both parrot and pugs are installed in /usr/local, and for pugs there are symlinks from /usr/bin/{pugs,pugscc,p6doc} to their /usr/local counterparts. If you want to see everything that is installed with these, check out the pugs-r10396-INSTALLED.txt and parrot-r12747-INSTALLED.txt files at the same location. David
Re: Changing permissions on temporary directories during testing
On 5/21/06, James E Keenan [EMAIL PROTECTED] wrote: This code is intended to achieve that goal but doesn't DWIM: This is the right idea, but... my ($file, $workdir, $destdir); { $workdir = File::Temp::tempdir(); chdir $workdir or die Cannot change to $workdir; $file = system(touch alpha); $destdir = $workdir/other; chmod 0330, ($destdir) or die Cannot change permissions on directory; You forgot to make $destdir. # dies on preceding line rename $file, $destdir/$file or die Cannot move $file; } There's other issues with this code. For one, its not portable. You're using a system command (touch) and you're assuming Unix filepath syntax. Another is your errors do not include $! which is the reason the command failed (no such file or directory). Additionally, 0333 is writeable and executable. You want 0500, executable and readable (not writable) only by this user. Finally, as I mentioned in another post on this thread, stay out of the system temp directory. Stick to t/. use strict; use File::Spec; use File::Temp qw(tempdir tempfile); $File::Temp::DEBUG = 1; # Or use Shell::Command sub touch { open my $fh, $_[0] or die Can't touch $_[0]: $!; } # CLEANUP tells File::Temp to delete the directory after the program exits. my $testdir = tempdir( DIR = 't', CLEANUP = 1 ); chdir $testdir or die Can't chdir into $testdir: $!; touch testfile or die Can't touch testfile: $!; mkdir destdir or die Can't mkdir destdir: $!; chmod 0500, destdir or die Can't chmod destdir: $!; # It should die here. rename testfile, File::Spec-catfile(destdir, testfile) or die Can't rename: $!;
Re: Changing permissions on temporary directories during testing
Michael G Schwern wrote: There's other issues with this code. For one, its not portable. You're using a system command (touch) and you're assuming Unix filepath syntax. Another is your errors do not include $! which is the reason the command failed (no such file or directory). Additionally, 0333 is writeable and executable. You want 0500, executable and readable (not writable) only by this user. Finally, as I mentioned in another post on this thread, stay out of the system temp directory. Stick to t/. This was meant to be a quick example, not rigorously thought-out code. (And looking back at it, the absence of rigor even at that level is glaringly apparent.) But I'll take your suggestions under advisement when I start to work on the real code. Thanks to all who responded. jimk
Re: parrot and pugs builds for os x
Hi David, Just downloaded both and ran the installers on my iBook G4 with OS X 10.4.6 (and ghc-6.4.2). So it just worked. I can now pugs -e 'say hello;' with the rest of them. But I only wish I'd had this three days ago, /before/ I tried to get it installed by hand! Nice one, and many many thanks for that. --michael onperl.org On 22/05/06, David Romano [EMAIL PROTECTED] wrote: Hi everyone, I fiddled around with PackageMaker and created packages for Pugs (r10396) and Parrot (r12747) for OS X. I used my laptop to check if they installed everything properly, and it seems they do. If you want to try them out, I'd be interested in some feedback: http://www.unobe.com/packages/ For now, both parrot and pugs are installed in /usr/local, and for pugs there are symlinks from /usr/bin/{pugs,pugscc,p6doc} to their /usr/local counterparts. If you want to see everything that is installed with these, check out the pugs-r10396-INSTALLED.txt and parrot-r12747-INSTALLED.txt files at the same location. David
Re: parrot and pugs builds for os x
With David's permission, added to: http://www.parrotcode.org/source.html Thanks for putting the build together! On May 22, 2006, at 6:57 PM, David Romano wrote: Hi everyone, I fiddled around with PackageMaker and created packages for Pugs (r10396) and Parrot (r12747) for OS X. I used my laptop to check if they installed everything properly, and it seems they do. If you want to try them out, I'd be interested in some feedback: http://www.unobe.com/packages/ For now, both parrot and pugs are installed in /usr/local, and for pugs there are symlinks from /usr/bin/{pugs,pugscc,p6doc} to their /usr/local counterparts. If you want to see everything that is installed with these, check out the pugs-r10396-INSTALLED.txt and parrot-r12747-INSTALLED.txt files at the same location. David
pugs success on osx
Finally got my hello-world-foo on in OS X: Haskell from http://www.haskell.org/ghc/dist/6.4.1/MacOSX/GHC-6.4.1.pkg.zip parrot from svn pugs from svn My preferred enivronment would have been FreeBSD 6.1, but I can't the the ghc port to build (nor is there a package) :( -- James Peregrino (617)496-6288 (v) Manager of Comp. Services Harvard Div. Cont. Ed. [EMAIL PROTECTED]
Re: Unintended consequences
On Mon, May 22, 2006 at 09:45:31PM -0500, Andy Lester wrote: Here's an example of why I'm not real excited about CPANTS: http://community.livejournal.com/perl/120747.html I prefer Acme::Raise_my_kwalitee http://search.cpan.org/dist/Acme-Raise_my_kwalitee as my anti-CPANTs example. Steve Peters [EMAIL PROTECTED] signature.asc Description: Digital signature
Unintended consequences
Here's an example of why I'm not real excited about CPANTS: http://community.livejournal.com/perl/120747.html xoa -- Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance
Re: [perl #39164] [PATCH] Cygwin: build with spaces in build_dir
via RT Greg Bacon [EMAIL PROTECTED] wrote: # New Ticket Created by Greg Bacon # Please include the string: [perl #39164] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39164 The attached patch allows parrot to build on Cygwin when build_dir contains spaces. How well does this play on other platforms? Works on OS X. Applied in r12755. Thanks, -- Matt Diephouse http://matt.diephouse.com
Re: languages/ Cleanup
Matt Diephouse wrote: - languages/forth/ I was actually the last one to provide a patch to forth (there were some other commits that modified things like copyright info, but those don't count). That was 20 months ago. The implementation was horribly dated then and things are far worse now. It needs to be reimplemented in order to work. This was dan's beast; I'm sure he won't care if it's removed. I was going to suggest keeping an archive of this one outside the repository, but it's only 2 files, so I'll just keep a copy for myself. (I'd like to revive it at some point in PGE/TGE and the old implementation could be useful.) - languages/ruby/ This doesn't appear to have had any work done on it in the past 3.5 years. It's nothing more than a (partial?) Parse::RecDescent grammar. Its author is no longer involved with Parrot. It's doubtful that what's here would be of any use to anyone now. The Ruby implementation moved out to RubyForge, so this can be deleted. (And even the external implementation needs to be updated.) Allison
Newbe: How do I configure @*INC ?
I downloaded the Win32 binary of pugs from http://www.jwcs.net/~jonathan/perl6/. The @*INC directories are pointing to the wrong places. Why can't it automatically populate the list based on the location of the executable, like Perl5 does? Before suggesting that I fix it myself, I must say that I don't know Haskel, and my project is to learn Perl 6, not Haskel. I just don't have time for another language. I'll (eventually) pitch in for modules written in Perl. Anyway, where is the configuration kept? I need to change the default values of @*INC to be where my copy is really located. TIA, --John (my first posting to this mailing list)
Re: packages vs. classes
Larry Wall wrote: 'Course, I left out everything about prototype objects there... The name Foo also (in context) represents an uninitialized object of the class in question. Any object, initialized or not, can get at its type handlers by saying Foo.meta $foo.meta and, in fact, the Foo.^bar syntax is just short for Foo.meta.bar. Perhaps saying it is like: Foo.meta.get_attribute(bar) Would be safer. Don't want to stomp on the meta-objects. [...] of the actual magic being defined elsewhere. It would be possible to access classes et al. only via the mechanisms supplied by the metaobject protocols, but that would be kind of like the bad old [...] Right, but we should really ship with at least a set of Meta Object Protocol Roles, that covers the core requirements that we will need for expressing the core types in terms of themselves; - classes and roles - attributes and methods - subsets (ie constraints/subtypes) - generics (including, by induction, nested generics) I *think*, at this point, that's all that are necessary. They are actually quite a useful set for the concerns I raised earlier about automatically inferring relational information from the metamodel (if only I knew these terms back then... ;)) http://groups.google.com/groups?threadm=200303042358.56560.sam%40vilain.net People can instantiate the roles that cover all that to an actual metaclass in whatever way they like (eg, Moose::Meta::Class-isa(Class::MOP::Class)), but not having to detect the type and then figure out how to talk to it for at least the core of the object system would be good. People can diverge completely with completely incompatible metaclasses that don't .do those roles, the only side effect of which being that people who write code for the standard Perl 6 metamodel will be incompatible, and maybe some ways of setting up the class won't work without another layer of trickery. I *think* that's what you're getting at. Of course, it shouldn't be prohibited just because it smells. On different note, there should be nice, per-class ways to make type constraints not simply code blocks - otherwise too much reverse engineering will be required to do the final stage of compiling typesafe code, where you close the classes and discard all the runtime type checks. An easy example of this is generics. With where, this is what you write (ignore the syntax errors for now): class Array of Str is Array where { $_.isa(Str) for @$_ } But that sucks, because that information about the type of the container is buried deep within the code reference, is slow, and we can't build our methods with the right signatures. So, we write; role Array[::T] { ... } class Array of Str does Array[Str]; Great. Now that information is available to Array in a structured manner and the signatures can be built correspondingly. But to represent the core types like Mapping or Set, we also need, for instance, the unique constraint to be represented as an object, not a code block: For instance, role Mapping[::T1, ::T2] does Coll[::T1, ::T2] where Unique(0); The where Unique(0) is the important bit. What is Unique, and who uses it? In my prototypes, I've been considering it being the job of the composing class or role to handle that, as a meta-object method call. So, the above might call Coll.meta.Unique(0) (look, I'm stomping all over the meta-object now) during the composition of the Mapping role, and it uses this to affect the methods that it builds until you get something that behaves not entirely quite unlike a Mapping. However feel free to continue to handwave for now. Personally I'd like to see this synoptic before the Perl 6.0 release, to avoid the mistakes of other (*cough* C# *cough* Java 1.5 *cough*) languages that slipped on getting the generics in their libraries, to their ultimate detriment. Sam.
Re: hyp-op examples of a Bag type in S03
Darren Duncan wrote: $bag1 - 1; # Bag(2,7,[1,Seq(8,2)],7) $bag2 - (1,1,1,1); # probably the same $bag3 - (1,1,2,1); # ? Bag's won't .does(Array) or .does(Coll[Seq,...]), so that hyperoperator won't work - if anything it would try to add the (1,1,1,1) list to all of the elements of the bag. You'd need to put the bag in something that does imply ordering first. This applies to any unordered collection, bags or sets. Sam.
Re: Getting to hello world?
On 5/23/06, James E Keenan [EMAIL PROTECTED] wrote: Gabor Szabo wrote: On Ubuntu it was quite straigt forward, I think this is everything I needed: sudo apt-get install subversion sudo apt-get install ghc6 Given that, in the above, you installed subversion and ghc6 for all users ... ... is there some reason why you chose to install parrot only under your home directory? There was no particular reason besides the fact that I went the way of least resistance. Installed using apt-get what I could and from source the rest. Besides this is my notebook so I am the one and only user. Hopefully :-) But as I have not played with Pugs for some time I only realised after sending the e-mail that in the meantime Pugs started to require GHC 6.4.1. The onethat I got with apt-get was 6.4 so Pugs does not compile any more on my machine. I have just downloaded the GHC 6.4.2 source and will try to compile it later. Gabor
Re: hyp-op examples of a Bag type in S03
At 4:11 PM +1200 5/23/06, Sam Vilain wrote: Darren Duncan wrote: $bag1 - 1; # Bag(2,7,[1,Seq(8,2)],7) $bag2 - (1,1,1,1); # probably the same $bag3 - (1,1,2,1); # ? Bag's won't .does(Array) or .does(Coll[Seq,...]), so that hyperoperator won't work - if anything it would try to add the (1,1,1,1) list to all of the elements of the bag. You'd need to put the bag in something that does imply ordering first. This applies to any unordered collection, bags or sets. Sam. Yes, I already assumed that only the first line would absolutely work, and that the third absolutely wouldn't. The second line example I considered borderline, because all of the elements were the same, and the count of elements matched the count in $bag2, so the result is the same no matter which set element each is matched up with. But of course it would be unreasonable for a generic Perl 6 implementation to be expected to intuit such things, so I shouldn't have said probably the same, if that's specifically what you were replying to. See list post [svn:perl6-synopsis] r9304 - doc/trunk/design/syn, where Larry corrected S03 in response to my post. Case closed. -- Darren Duncan
Re: parrot and pugs builds for os x
Hi everyone, On 5/22/06, Michael Mathews [EMAIL PROTECTED] wrote: Hi David, Just downloaded both and ran the installers on my iBook G4 with OS X 10.4.6 (and ghc-6.4.2). So it just worked. I can now pugs -e 'say hello;' with the rest of them. But I only wish I'd had this three days ago, /before/ I tried to get it installed by hand! Nice one, and many many thanks for that. --michael onperl.org If anyone is interested, but can't handle the slow connection to unobe.com (my end's fault), I have uploaded the files to a different server, which will be faster to retrieve from: http://sdcc17.ucsd.edu/~magonzal/packages/ David