Exegesis 7 Released (Perl 6 Text Formatting)
chromatic writes "Perl.com has just published Exegesis 7, Damian Conway's explanation of how text formatting will work Perl 6 (and now, Perl 5, thanks to his Perl6::Form module) will work. Think of it as Perl 1 for the 21st century. Also, Parrot 0.1.0, the virtual machine for Perl 6 and several other dynamic languages, released on Leap Day -- ever wanted to program in an object oriented assembly language?"
One thing that you really have to love about the people who write Perl is that they have a sense of humor. This kind of document could be extremely boring and bland, but Damian had the good sense to liven it up by using humorous examples, mostly drawn from Shakespeare. He's doing some great work, but he's also obviously having fun doing it.
There's no point in questioning authority if you aren't going to listen to the answers.
"ever wanted to program in an object oriented assembly language?"
Uh... I gotta say... No.
"For years, I struggled with reality... but I'm happy to say I finally won out over it." -- Elwood P. Dowd
lots of lame jokes about Perl code being incomprehensible despite the fact it can be the most readable.
The screen is covered with what looks like a still shot
of a copy of "The Matrix" screen saver.
He looks at it a minute, and realizes that the coworker
is reading it, so it can't be a screen saver.
He thinks about it a second, and then asks "Do you always
ready your email fully encrypted with PGP like that?
Decoding PGP in you head like that is _really_ impressive!".
"No," says the coworker, "that's just a Perl script I'm
working on".
Y'know, that couldn't be ANY MORE WRONG than an HTML rendering of a .GIF of a psychotic nun in a bondage outfit clubbing a baby seal to death with an Al Gore doll.
(With apologies to the denizen of the Monastery, from whom I stole the idea.)
I'm sure Perl 6 will just be the bee's knees, but I have long since switched to Ruby (or Python if I need certain libraries). As I get older, the philosophy behind Perl (more than one way to do it) really gets on my nerves.
So, I'm interested to see Perl 6 when it comes out, but I sure as hell won't be using it for anything.
Also I'm looking forward to a common runtime between the three languages so I can use Perl modules from Ruby. Now *that's* the best of all possible worlds, eh?
I have been using Perl for years now, and I have to say, its not been the best language to use.
/me nods his hat to Perl6.
Being one who's never gone along with the best methods of coding, I've stuck with Perl for the past few years. I deem myself pretty proficient in it, and I find a new plethora of exploration available to me now that Perl6 is out.
The fact that Perl6 is now a subroutine rather than hardcoded allows me to directly stream the formatting through the test. This is immensely helpful, for it allows me to organize the code more efficiently and get more out of my hard worked code.
Sure, some parts may seem like a step back, but this new versions is much simpler to use, and has some huge advantages that all coders should get use from.
I have always thought of C as high level assembler, and C++ as object oriented high level assembler.
If you like Python, check out Ruby. I've been monkeying around with it at work for small things. It's like Perl but readable.. and object oriented from the ground up.. and easy to work with.. hmm, on second thought, it's nothing like Perl.
Trolling is a art,
One of the reasons I love Perl (cut my teeth with Perl 4, now write a lot of Perl 5 code) is that it is a virtual swiss army knife of programming languages. There is a lot of power in there, but you can choose to use only as much as you might need. The "TMTOWTDI" ethos also appeals to me. And, in reading the updates on Perl.com, I see that this exact same spirit is going into the creation of Perl 6.
.NET announcements and said, "Hmmm...multiple programming languages that all compile down to the same bytecode and execute in the same virtual machine...sounds like a reasonable idea to me!" The Parrot VM is a neat idea, that goes even further than .NET since it's multi-platform, and definitely will be very nice when it's finished. But I feel like it's going to delay Perl 6. And as nice as Perl 5 is, languages like Python and PHP are beginning to surpass it in feature set and ease of use. I don't want Perl 6 to be irrelevant when it finally shows up.
So why am I worried? Well, it feels like Larry saw Microsoft's
Also, like a very impatient, immature kid on December 23, I want my Perl 6 now, damnit!
But, I trust the Perl 6 team. They're smart people. Read the newsgroups and the forums, and you'll agree. When Perl 6 and Parrot are ready for prime-time, I am pretty sure that I won't be looking over at Python and PHP and feeling guilty anymore.
Ah well, back to coding...
Blogging Weight Loss, Distance Education, and more at verlin.com
ever wanted to program in an object oriented assembly language?
Yes. However, some nights when I drive home from work I eye a bridge abutment thinking I'd like to bury my car in it at 140mph. So I'm not certain that whether I'd like to do something is a great way to evaluate it. What's your point?
BTW, is there a simple way to disable an airbag? Isn't there supposed to be a switch someplace? Thanks.
Maw! Fire up the karma burner!
I am sure something is coming down the pike, but making a huge announcement like a major rearchitect puts a lot of developers in suspended animation - unwilling to invest more time mastering and extending the "end-of-life'd" perl 5. Many of those people are now looking at other options.
As an aside, I'm not sure where the consensus is coming from for the new language proposals - the code samples in Larry and Damian's writings are becoming more and more cryptic. I wonder if they are making perl 6 to unapproachable by new coders.
Well, actually VMs are the way of the past - in research circles the VM has been around forever.
.Net VM is rather small. JVM/.Net are designed from the ground up to support systems languages (like Java and C#). They optimize for static typing and languages where most complexity happens at compile time. Parrot is a VM for languages like Perl, Python, and Ruby, (and TCL, and Lisp etc) whose typing is weaker, and where a runtime eval is a moderately common occurance.
However, for what it's worth, Parrot's relationship to the JVM and the
What specifically about the JVM puts you off? Or is it the host language that bothers you?
Then there are the practical issues - will Parrot be fast enough and mostly bugless in time for Perl 6 to sit on top of it? I am concerned that we will need eighteen months of point releases and we haven't even had an alpha yet. Meanwhile people are looking at Ruby, Python, Mono/C# etc.
I recommend they just wrap up whatever concepts they have now and start moving toward an alpha. If we don't see one in 2004 I think most people will have moved on.
... ever wanted to program in an object oriented assembly language? ...
God no. It's bad enough when a high level compiler attemps to guess what you want (C++, etc)... it'd be horrid if ya had to have something supposedly machine level guess...
but Parrot is really starting to excite me.
The main reason being it's potential use as a generic high level "ABI" of sorts. Look at GTK/GNOME for example. The developers choose to use C as the base language, largely because it was the easiest language to create bindings for - everything can link to C. But the problem is that C only implements procedural concepts. Anything else must be crafted from hand, like gObject. So you end up reimplementing all the features of a high-level object oriented language, in C, and often this implementation isn't even as efficent as the high level language's implementation. On top of that, when create bindings for a high level language, you wrap all of these gObjects inside of a native language object, and end up with double the overhead. So what it comes down to is that you worked four times as hard, and came up with something twice as slow, just to be able to have an object oriented library that many languages can link to.
Parrot has the oportunity to be for object oriented languages, what the C ABI has become for procudural languages - a common interface for programs of different languages to communicate. Imagine having high level libraries, that can be efficiently used by python, perl, ruby, befunge. Or having scriptable applications that are not just scriptable by one language, but by anything that targets parrot.
When you add to that they fact that it will be cross-platform, and more efficent then most of these high level languages were to begin with, it's hard not to get excited.
That's what Parrot is. Python and Ruby (as two examples) WILL be able to target parrot and run in the parrot VM.
You can read about the new regex syntax in exegesis 5 (and its corresponding apocalypse)
Opinions my own, statements of fact may contain errors
Perl is the most beautiful language I've had the pleasure of learning. Lots of folks complain that perl must be ugly since it's so easy to write really butt-ugly code in it; but it's also very easy to write mindblowingly powerful, clear code. Enough thought has been put into the language design that you can abuse most aspects of the language and still get what you wanted.
It's easy to forget, when using perl, just how, well, tedious, it is to work in C (let alone C++) or shell or Java or even, yes, Python.
The exegeses so far have been full of fabulous goodies to use and abuse. The main problem, as others have pointed out, is that perl6 is still largely vaporware.
No, but if I wanted to, I could already, thanks.
Ceterum censeo subscriptionem esse delendam.
After reading through a lot of this article and being blown away by the genuinely powerful and, dare I say it, awesome abilities that have been given to the form function, I'm left asking myself:
... that's all it is, some geek's personal project that doesn't really seem to have much relevance to the real world.
"Who gives a crap?"
Most the projects I've worked on for the last few years have predominately displayed text in web pages. Almost all the reports produced have been generated as HTML and then printed as necessary. The only text output done has been generally into log files, where you really don't need a lot of formatting.
While this is obviously a really great, well thought out piece of coding,
Maybe I'm just missing a huge community of people who spend most of their time looking at command lines and printing out reports in fixed width fonts.
Not quite. Weak is not the opposite of dynamic, but the opposite of strong. Type systems may be either weak or strong, and may be either dynamic or static.
A weak type system will allow implicit type conversions, even those that are 'lossy' or improper. For example, converting a float to an int without requiring a cast. Or, more importantly, treating memory references (pointers) identically to integers. Pointer arithmetic is an abuse of a weak typing system.
Strong typing requires explicit casts and will throw errors where casts do not appear. Java, Lisp, Python are all strongly typed. Haskell is _really_ strongly typed. When you cast a object to type Object in Java, you are losing type information, but you are doing it _explicitly_.
C, Pascal, and Java are statically typed. Variables are created with a specific type in the code, not on demand. Python and Lisp are dynamically typed -- a variable's type is determined at run-time.
For example, in C:
int foo( int a, int b );
declares a function that returns type 'int' and takes two arguments a, b, both of types 'int'.
In Python:
def foo( a, b ):
declares a function that may or may not return a value (and whose type is known only at run-time) and takes two arguments, which may be of any type (although, internally, the program likely assumes a type).
There are some quirks in the type systems of many languages. In Java, for example, "str" + 3 doesn't have any normal meaning, but the developers have defined any operation using a string as concatenation. In Python, and in most languages, such an expression will either return an error on compilation (static) or when running (dynamic).
However, all combinations are possible and type systems are a fertile area of research.
No one is joking on the Parrot side. Check out the Pie-Thon
Parrot will run Python before it runs Perl, *that* should demonstrate how commited Parrot is to not just being Perl 6's back-end.
You'll be able to create a class in Python as a sub-class of a Perl 6 class which further derives from a Ruby class, and then call a method on such an object which is defined all the way up in Ruby.... no problemo. Parrot is going to change the way we choose programming languages for the tasks at hand....
Turbo Assembler (later versions) from Borland did support a level of object orientation. It actually shipped with examples of object oriented assembly code.
OOPs in TASM