Re: [CODE4LIB] perl6
On Jan 21, 2008, at 11:24 PM, Peter Keane wrote: ...Like spoken langauges, syntax in a programming language influences what/how things might be expressed, even though you can express the exact same facts in any language. Perl6 will, I think, be one of those ultra-dynamic languages like Ruby that lead folks to write little DSLs (domain-specific languages) to get a complex domain-specific task accomplished. Ironically, I was thinking about this yesterday. On one hand I thought, I have a language I can use, feel comfortable with, and does what I need to do. I then thought, Just like different human languages, computer languages have strengths and weaknesses. You need different tools for the job. Just like different styles of guitar playing (Renaissance, Baroque, Classical, Romantic, Blues, Jazz, Rock Roll, etc.) require different guitars. The internals of Perl6 are said to be much cleaner that Perl5 and it will run on the Parrot Virtual Machine which will also run many other languages (like the Java Virtual Machine which can now run Ruby (JRuby) and Python (Jython)). So expect to see projects incorporating many langauges in a single code base This was a feature I was not aware of. Does this mean I will be able to write Perl programs that use the Java-based Lucene indexer? -- Eric Lease Morgan University Libraries of Notre Dame
Re: [CODE4LIB] perl6
On Jan 22, 2008, at 9:58 AM, Eric Lease Morgan wrote: This was a feature I was not aware of. Does this mean I will be able to write Perl programs that use the Java-based Lucene indexer? You probably know this, but you could do that now via SOLR, a webservices-plus-more layer that sits above Lucene and allows querying and updating of the index from any language via http requests. --- Birkin James Diana Programmer, Integrated Technology Services Brown University Library [EMAIL PROTECTED]
Re: [CODE4LIB] perl6
We get an honest-to-god switch statement, finally. And better regexp optimization. I too plan to convert relatively slowly, starting with 5.10for now and re-reading perldelta. --joe On Jan 21, 2008 8:00 AM, Eric Lease Morgan [EMAIL PROTECTED] wrote: Just what will I be able to do better with this (completely) new version?
Re: [CODE4LIB] perl6
On Mon, 21 Jan 2008, Eric Lease Morgan wrote: I just got finished looking over some of the stuff related to Perl6, and now my brain hurts. :-( Just what will I be able to do better with this (completely) new version? Run faster? Jump higher? It might be cheaper for me to buy a pair of Keds. Well, the goal is to make it easier to do things that people typically have to do. There's a new bracket to replace qw: @array = qw/a b c d/; becomes: @array = a b c d; But we also get: @array = $x $y $z ; which will interpolate the variables (and split them on spaces, so the resultant array might have more than 3 items in it) We can also interpolate within strings using { ... }, avoiding the need to do @{[ ... ]} : print x + y = { $x + $y }; There's also a real switch statement (given / when / default). Arguments to subroutines (@_) by default are now readonly (but this can be overwritten with prototypes). You can also do multi-dispatch with subroutines (ie, have a different subroutine called depending on what parameters are passed in) ... and named parameters, so you don't have to remember what order the 14 arguments are ... or have to pass everything as a hash or hashref. (there's a whole lot of changes to subroutines, which if I understand correctly, will force many errors to be detected at parsing, rather than run time) there's also a '...' operator, which can be used as a marker that the code isn't complete (and will generate appropriate errors if you reach that block of code) .. Now, there will be some issues w/ bringing over perl5 ... the concatination operator (.) is now the dereference operator (-), and concatination is now ~ . The ternary operator ( $x ? $y : $z ) is now ( $x ?? $y !! $z ). And there's enough other changes ... it'll be like trying to speak American English in the UK ... close, but not quite right. And there's a whole lot of new features that I don't know if I'll ever use ... but there's also stuff in perl5 that I don't use. (eg, 'format' and 'write', even though I've also done Fortran programming) I'm planning on taking it slow ... I'm not going to instantly convert over my existing code ... especially not the main library I work on, which is multiple thousands of lines. - Joe Hourcle
Re: [CODE4LIB] perl6
I suspect that for many/most cases for which Perl5 does the trick, Perl5 will continue to the the best tool (and support for Perl5 is expected to continue for the long term). Perl 6 borrows some ideas from languages like Ruby (which itself borrowed much from Perl) and seems to me a more fundamentally object-oriented language than Perl5: from Perl documentation: Most (all?) built-in functions are now methods of built-in classes such as String, Array, etc. Was:my $len = length($string); Now:my $len = $string.chars; Was:print sort(@array); Now:print @array.sort; @array.sort.print; The syntax will be tighter, cleaner, and in some cases more readable (although I don't think Perl5 is all that hard to read if well-written). Such syntactic (and other) changes should make writing Perl in a more functional (lisp-ish?) style easier. Like spoken langauges, syntax in a programming language influences what/how things might be expressed, even though you can express the exact same facts in any language. Perl6 will, I think, be one of those ultra-dynamic languages like Ruby that lead folks to write little DSLs (domain-specific languages) to get a complex domain-specific task accomplished. The internals of Perl6 are said to be much cleaner that Perl5 and it will run on the Parrot Virtual Machine which will also run many other languages (like the Java Virtual Machine which can now run Ruby (JRuby) and Python (Jython)). So expect to see projects incorporating many langauges in a single code base. I fully expect that Perl6 will gets lots of attention when officially released and will generate lots of interest among the uber-geeks and will result in some very useful innovations for the rest of us (the way Ruby gave us Ruby-on-Rails). I've heard many folks say that learning a langauge like Ruby made them a better programmer in all langauges, and I am certain folks will say the same about Perl6. Perl6 has recently hit something of a tipping point, so I am told, so I expect we will be hearing MUCH more about it in the coming months. And...for perl programmers not wanting to brave the new Perl6 world, Perl5 development continues apace -- Perl 5.10 was recently released with some of the goodies back-ported from Perl6 (say and Hash::Util::FieldHash, a.k.a. inside-out objects). --Peter Keane On Mon, 21 Jan 2008, Eric Lease Morgan wrote: I just got finished looking over some of the stuff related to Perl6, and now my brain hurts. :-( Just what will I be able to do better with this (completely) new version? Run faster? Jump higher? It might be cheaper for me to buy a pair of Keds. -- Eric Lease Morgan University Libraries of Notre Dame