Thursday, January 22, 2009

A Logo design for Rakudo Perl 6

The below is a post I started on perl6-users@perl.org and is amended by the last weeks of replies.

I'm posting it below to garner a few more eyeballs, before I go from a, "research" stage to a, "playful" stage of trying simple things out and seeing if anything makes sense.

If you're a part of the Perl community, I'd love to hear your input as a Kaduo Perl 6 logo may be something you'll see almost every day:

Hello everyone,

A few weeks ago, probably more than I want to admit (but here! See! My Notes! I've been up to something!), there was one of those, "OMG! Perl is going to DIE!" threads, somewhere and the, "Well, do something about it" call came out, and I sort of replied, "well, alright" and gave my open ended hand to some design work.

Moritz was one of the first to guide it to the idea of making a logo for Rakudo Perl 6 - as there's nothing yet (really) available. I thought that would be a neat project and scratch some of my person itches.

A slight background on me: I'm that guy:


(Although, there should be two more columns for, "Skateboarding" and, "Rock Climbing" in there). I really started working with Perl during a internship in college which started me in a full time job doin' the stuff, which got me to where I am today: just working for myself.

In all of that, I also managed to get through Art School (guess what paid for *that*!). A lot of my work deals with language and text, writing and communication. Some of my work bordered on generative work, but most of it stayed on the canvas, as I wanted to go to school to learn to paint.

Anyways, I've always wanted to help out on larger-than-myself Perl projects, but, although I think my perl-fu is, well, alright - it's not wizard-like. But! I think an interesting niche that I could fill is as someone who, "gets" Perl and it's wonderful and varied culture and also, "gets" visual communication and all that. I am a firm believer that a healthy community is one full of diversity and successful projects come not out of one genius, but of many just normal people, and that's me: just a normal person.

Here's some notes I've collected about what people have said Rakudo Perl 6 is, which is a good baseline on what a logo should try to reflect and communicate:

Rakudo Perl is:
  • Perl 6 on Parrot
  • Rakudo as a *implementation* of a *specification*
  • Rakuda-do (Japanese): Way of the Camel
  • Rakudo (Japanese): Paradise

Camels, Paradise/Oasis, etc. It's good visuals and it's easy to digest. Camels are mean and smelly close up, but we don't have to get all that close - it's good to remember they're also extremely useful and in some places, absolutely critical to ways of life.

It also doesn't stray far from the original Perl 5 image of Camels and Pyramids and all that jazz. The Japanese lean on all this seems important too, perhaps to get a little more mindshare from the folks that find Ruby interesting and attractive (more on that in just a little bit)

One of the main fears with this name, "Rakudo Perl 6" - at least when it first came out, is that describing Rakudo Perl as, "An implementation (one of possibly, many) of the Perl 6 Specification, built on top of the Parrot Virtual Machine", will leave people going,

"Huh?!"

I think this is a good reason as anything, to think of getting a visual representation of this, somewhat complicated idea out ASAP.

It's interesting that Japanese Word(s) were chosen as the new name - it's grown on me - I like it. Japanese Art and Poetry has the idea of the, "haiga" and the, "gō" - which is sort of like a pen-name, but it changes if there's a change in the style of the artist during their career. You could think of, "Rakudo" as a new, "haiga" for Perl - at least the concept makes things clear to me: we've changed course, but it's still the same hand.

I was also, incidentally, doing some research on the origins of the Latin alphabet - I'm very curious about languages in general - mostly how they're abused in media and popular culture, but also in learning new ones - I took a brief stint solo in France armed with a 5 week Free University course in French to see how well I could get along. Eye-opening.

I happened upon the book, "Mysteries of the Alphabet" (Narc-Alain Ouknin - originally written *in* French) in the shelves of someone I was hanging out with. It's main thesis, really is the Latin/Greek alphabet started with something they term the, "Proto-Sinaitic" alphabet, which was created around the time the lost tribe of Israel was figuring itself out. Moses and all.

One of the, well, the third letter in their alphabet is, "gimmel", which comes from the word gamel, which, if you didn't guess already means, "Camel"! It looks either like the neck of a camel - or, perhaps it's hump. If you think of, "gimmel" as our, "C" you can sort of still see a hump of a camel, if you just turn the, "C" 90 degrees, clockwise.

Early written languages like Proto-Sinaitic are sort of the beginning where pictograms that stood for what things looked like, where changed into a way of writing about an idea - a lot of these early letters still hold a lot of the original meanings. Hebrew, for instance still does and each character is rich in back history. I like the Proto-Sinaitic link, since it's less loaded quite as intensely as Hebrew, which is invariably tied to major traditions and religions.

The, "Gimmel" character is no exception. Start from, "Mysteries of the Alphabet"
------------------------------------------------------------------------------
:: Original Meanings
Carrying the Primal Power beyond, outside the domestic setting

:: Derivative Meanings
Outgoing, break, carry to another, do good, return a favor

:: Acquired Meanings, Perpetuated By The Hebrew Language

Ripen, Ween, Enable to ripen
Release Oneself, Break Away From
------------------------------------------------------------------------------

Which I think beautiful illustrates a nice connection between Perl 5 and Perl 6, Rakuda-do/Rakudo and haiga pen-names - and the, "Big Picture" of what exactly Perl 6 is all about - standing apart from the lineage, but still being, well, "Perl", using the Camel (gimmel) as a fundamental icon from way WAY back in time there -

and it all sounds so Perlish of picking and choosing the best from many ideas and languages.



Taking a step back from this soup of ideas and thinking of a logo itself, it seems that it would help to produce something that's made of somewhat interlocking and inter-related pieces: Perl on Parrot has two separate pieces that come together and complete an idea. But there's other things that could take, "Perl's" place, so it's really,

$x on Parrot

It seems that if a logo would be made, we can modularize, say, that Parrot part and use it for other things - same with the Perl part, if you get into it. Modularization is a way of getting ready for the future. It also allows us to be lazy: we can use other people's work already and - well, you all know this already. It would be an interesting idea to use common programming best practices in the logo of Perl itself.

I bring that all up, because when I look at the various Perl projects, they all look extremely interesting, but fragmented. It would almost make sense to create a logo where pieces can be reused for related thingies. Starting from a logo for Rakudo Perl, one could make a simple Style Guide even, with easy-to-acquire graphic elements that say, an application written using Rakudo Perl could use (at their discretion) to enhance their own project and tie it back into Rakudo Perl (and Perl in general).

So that's sort of the other thing I'm proposing: not only designing a logo for Rakudo Perl, but having the concept of modularization of the logo's basic elements part of the logo design itself and the sharing and remixing of the design elements for related projects, to help strengthen the, (and I'm not a fan of using this word) "branding" (sigh) of Perl and making it not so much the "invisible language that glues everything together", but have it where it belongs: in a positive light with the general (geeky) public.

Right now, all that means to me is perhaps a simple style guide and the image and graphic resources easy to grab in open formats. This also means that simple-is-better when it comes to the design of all these different elements of the logo, as they'll be combined in interesting ways and things will have a tendency to be cluttered. Simplification also lends itself to universality: the simpler the idea is, the more we relate ourselves *to* the idea itself.

Finally, the design of the Rakudo Perl logo should lend itself to change. Just like any other part of the project, the ideas and concept and what the darn thing actually look like should be able to move and change quickly - to be able to be upgraded - hey, why not? I'm not interested in, "owning" the design, but am more interested in playing a part in shaping the whole. And all that stuff. Just like in code, some people do more than adopt a project.

What I really *really* need now is some feedback for any and all of the above research and braindump. This, obviously, is just one regular guy taking the first jump into something a whole lot bigger and more complex than he can even really imagine. The first step is the hardest and the most confusing - the rest of the journey is mostly, one foot in front of the other, until the end,

Here's a few important notes about the above:

Love Marks vs. Trademarks:

Sounds like a great idea. Go for it. Here is a document I prepared for Larry Wall and the Perl Foundation about a trade mark strategy for Perl. You may find some ideas in here to help - I like your idea of interlocking imagery etc.

http://thegoo.org/love-marks-for-perl.pdf
This document encourages the use of memorable, positive, interconnected trademark. The Perl Foundation will be the custodian for such a mark. This is all wonderful. I don't have any problems with giving over the rights for the project to TPF and Perl at large - sort of the point, really.

This is also a very important part of the document above:

If the Perl Community accidentally borrowed “The Camel” it appears O’Reilly accidentally borrowed
the domain name “perl.com”. Goodwill continues to accrue in the trade mark “PERL” and that
goodwill, including any domain names needs to be directed to its rightful owner: TPF.

With the Rakudo Perl 6 logo, we don't want to add even more confusion - Camels, it seems are out. I wouldn't mind a gesture of a camel-like idea - for example, my gimmel idea above, but that idea may just be a stepping stone for something much large - for example, trading the Rakudo Perl 6 logo as a type of primitive written alphabet, which can be combined, with descretion with other people's and project's ideas.

I think, at least in the "playful" stage, the camel be used as a design element, just because it could lead to more interesting things.

BUT - Richard Dice of the Perl Foundation does make this situation absolutely clear:

O'Reilly is the only organization that can have trademarks that incorporate
a camel in reference to the Perl programming language. This statement is a
first-order approximation, but damn good one. Basically, the message is:
stay away from using camels




Patrick Michaud had this to say:


I'll start with my summarized thoughts first, then a few specifics below.
First, I totally agree that Rakudo Perl needs a logo, and the sooner
we can get one to start using on our website (which we're now creating)
and other materials, the better. So, your thoughts and ideas are
quite welcome.

Beyond that, I think your message has neatly captured many of the facets
of what we're working with (and yes, there are a lot of facets). The
message reminds me of some of Larry's "State of the Onion" addresses --
looking at many sides of the Perl (in this case Rakudo Perl 6) world.

So, my primary comment is that I find myself very much in agreement
with your proposal, and a strong hope that you'll continue on in this
direction. I agree with the idea of the style guide and some simple
elements that people can combine together in very expressive and
beautiful ways. Indeed, it sounds very much like you're proposing
an ideographic system for Rakudo Perl, where can combine graphic
symbols for ideas together. That feels very Perlish and Rakudoish
to me -- I like it.

So, I'd say "press on" and let us see what you come up with. :-)

The more I think about the design problem, the more it it seems that a simple but very flexible solution would be best and that reflecting and taking the actual design process and specification of Perl 6 itself as a major influence would be a great way to go about things.

I can't really speak for what Parrot will want or need, as they already
have a (very nice) logo. But having a symbol to represent Parrot in
the system you propose would likely be very workable.

Exactly!

I may do more research with Patrick and see what the current needs are for a Rakudo logo and how that could be worked with a, "Grand Scheme" as well as start playfully working on some ideas.

What I could use now is a whole lot more feedback. Sound off!

Monday, December 1, 2008

How to handle completely clueless users?

I admit I'm sort of a email traffic controller.

It irks me to the point of a pet peeve, when I spatter the contact page of my project with notes that say, "DO NOT CONTACT ME FOR SUPPORT UNLESS YOU WANT TO BUCK UP SOME MONEY", and I get tons of support emails, wanting free support.

Sigh.

What I don't want to do, is take the time and go,

"Look. We have forums. We have mailing lists. Use those. Thanks." And then not answer they're question.

What I do is exactly that.

I don't want to do this, because I know how much of a pain it is for the person to now, *rewrite* what they just ask me. It also is a pretty weird introduction to what should be a really valuable exchange - someone actually wants to talk to *me* about *my* thingy.

The curious thing is, I don't want to be hired to fix some stupid bug - I have better things to do. I'd rather help fix the bug for *free* - and its beneficial - users let me know it's there, I (or them - ha!) open up a bug report, it gets fixed (probably by me) and *there's a thread of, "something just happened"* that lives far away from my inbox and takes on a life of its own. I don't have to write the same thing twice and with a little work by the user (or if they dare help themselves) they can find it themselves, and keep a thread going. When I say, "thread" - I mean, anything - a forum post about a problem, with a reply of a confirmation that it's a bug, with a link posted to a bug report, that may then give you a patch in a day or so - which then gets referred in another forum post - etc. But, a trail is there.


The thing is, there's better ways to ask the questions.

What's the better way to point them to the right way?



For a while, I just had a auto responder that said,

"Hey, if this is a support question - go here, and here and here and read this and that and then post to this thing or that thing and away you go! America!"



"...but, if this isn't a support question, well, disregard all that, and I'll get back to you, soon"

That seemed a little foolish.


Right now, I'm trying something different - I'm just making up a mail template that first, welcomes the new person emailing me to the *community* and then gives a very brief list of resources that say, "Here's what to read", "Here's where to ask questions"

Then,

well, then if I can, I'll answer they're question - I haven't yet said, "And next time, POST HERE", cause again, that makes me think I'm reprimanding someone for something they may have just missed. Or something. Anyways - let's think positive and we're all humans here, and we probably all have a strong sense to belong.

But, what I want to do is get people active in the program and community. It's pretty hard, since, well, usually my audience is general users and they just have Work They Need To Do, and aren't nerdy enough to get excited about some program. Understandably.

Perhaps, by simply giving a welcome, some encouragement, some links to check out and a head-start on solving the problem, they'll feel as if they're welcome in a community, instead of just a bother to me.

As far as I'm concerned, community in anything is everything. If you're not building a community, you have almost nothing, no matter how great you are, you have nothing without people.

Anyways, I'll let you know how it goes, but I'd be interested in hearing other ideas you yourself may have,

Wednesday, October 8, 2008

Problem with Email::Valid and newlines

Found a strange problem in Email::Valid:

 
#!perl
use strict;

use Test::More tests => 4;

BEGIN {
use_ok('Email::Valid');
}
my $email;

$email = 'withnewline@example.com' . "\r";
ok(Email::Valid->address(-address => $email) eq undef, 'addresses with "\r" at the end return undefined');
diag(Email::Valid->address(-address => $email));

$email = 'withnewline@example.com' . "\r\n";
ok(Email::Valid->address(-address => $email) eq undef, 'addresses with "\r\n" at the end return undefined');
diag(Email::Valid->address(-address => $email));

$email = 'withnewline@example.com' . "\n";
ok(Email::Valid->address(-address => $email) eq undef, 'addresses with "\n" at the end return undefined');
diag ("'" . Email::Valid->address(-address => $email) ."'");



From what I expect, that last test should pass. Email::Valid's docs do say that if address can munge the address, it'll return the munged address, instead of undef - but I have munging (or "fudging, in this module" *off* - as it is off by default). Carriage returns aren't munged, so why newlines?

Perhaps it's the last line in the module:

 
# Regular expression built using Jeffrey Friedl's example in
# _Mastering Regular Expressions_ (http://www.ora.com/catalog/regexp/).

$RFC822PAT = <<'EOF';
# Possibly the most insane regex... possible
EOF

$RFC822PAT =~ s/\n//g;



The test for validity changes the actual string being validated. Drrrrr.


And that kind of brings up another point: Why is a module called, Email::Valid and its validating method (address) also doing double-duty with wanting to munge the string I give it so it may possibly be validated? Sounds like you just need to methods there, validate() and, gimme_back_an_address_if_at_all_possible(),

or,

whatever.

Sunday, October 5, 2008

Perl Semaphores 'n stuff

This is a pretty good and gentle introduction into file locking and using semaphores in Perl:

http://interglacial.com/~sburke/tpj/as_html/tpj23.html


I was having the exact problems being described:


Unfortunately, this means trouble for our flock-using code. Notably, there can still be a problem with instances being out of phase — since we can’t lock a file without already having opened it, things can still happen in that brief moment between opening the file and locking it. Consider when one instance is updating counter.dat just as another new instance is about to read it:



Instance 1                         Instance 2
----------------- -----------------
open COUNTER, ">counter.dat"
or die "Can't write-open: $!";
open COUNTER, "<counter.dat"
or die "Can't read-open: $!";
flock COUNTER, LOCK_EX;
my $hits = <COUNTER>;
close(COUNTER);

flock COUNTER, LOCK_EX;


There, the OS dutifully kept two instances at once from having an exclusive lock on the file. But the locking is too late, because instance 1, just by opening the file, has already overwritten counter.dat with a zero-length file, just as instance 2 was about to read it. So we’re back to the same problem that existed before we had any flock calls at all: two processes accessing a file that we wish only one process at a time could access.

In a very very complex part of my app, that has to do with basically managing a queueing system - something that really really really should be written using a transaction capable SQL backend. If only I knew how to do that.

I combined the semaphore file with the, Highlander, THERE CAN BE ONLY ONE! Idea:

http://perlmonks.org/?node_id=14260

http://www.stonehenge.com/merlyn/WebTechniques/col54.html

So if I can't get a lock, I can wait a little longer. I thought, "Hey, sounds like a good idea". It also sorta kinda puts a queueing system to the resources that a lot of different thingies want to hit, and hopefully, stop the programming from giving back errors like, all the fucking time. We'll see.

All the tests pass (you do write tests, right?), but using the app doesn't really... um, work. It's timing out. Most likely from the Highlander idea. More whackin' to do...

Nerd!

I've decided what computer programming is to me at the moment:

It's a hobby. It's a hobby that currently pays my bills, but to call it a job or a company that I have is not what's going on. I know this, because I explicitly attempt not to do what companies attempt to do really really well. One of these things is to try to sell you the product.

The product I make is free, so there goes that baby/bathwater.

I also write a book about the thing.

The book is just a bunch of HTML I create from a simple doc format. It's akin to me selling you plans on how to make your own land mower from the back of Popular Mechanics, or something.

Another thingy that companys are good at, especially in computer-stuff is automation. I do provide services to install the program. But I do it manually. There's no installer. And, that's stupid.

But if this is just a hobby - one that takes a lot of my time, I don't have a job. And art isn't making any money.


This is all going to come to a head, soon enough. But at least it allows me to identify myself as a, "hacker" rather than a software engineer, which I couldn't possibly be.

It also gives me something to put on my artsy résumé: Computer Hacker. That sounds almost hip. Would you like a painter that has a hobby of collecting pogs, or a painter that also has a hobby of hacking computers?

yeah, you're right, pogs win again.

Sunday, September 14, 2008

LWP is Simple.

While I'm on the nerd tip, this is the simplest example I can get to grab the contents of a URL, with a optional username/password and/or proxy:

 
#!/usr/bin/perl

my $proxy = undef;
my $user = undef;
my $pass = undef;
my $url = 'http://localhost';

# Create a user agent object
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;

if($proxy){
$ua->proxy(
['http', 'ftp'],
$proxy
);
}

# Create a request
my $req = HTTP::Request->new(
GET => $url
);
# Pass request to the user agent and get a response back
my $res = $ua->request($req);
if(
defined($user) &&
defined($pass)
){
$res->authorization_basic(
$user,
$pass
);
}
# Check the outcome of the response
if ($res->is_success) {
return $res->content;
}
else {
warn $res->status_line;
return undef;
}
}



Wishing LWP::Simple would do this, but. Nope.

Saturday, September 13, 2008

MIME Trickery with MIME::Parser and friends

You can attach attachments to a multipart/related email message entity (say, a email message created from a website, with the images attached to the message itself) by creating a new multipart/mixed entity, and having the first part be that multipart/related entity and the rest being your new attachments. For example:

 
#!/usr/bin/perl
use strict;

use :MyMIMELiteHTML;
use MIME::Parser;
use MIME::Entity;

my $HTMLurl = 'http://localhost';
my $jpg_path = '/Users/justin/Desktop/4.jpg';


my $mailHTML = new MyMIMELiteHTML(
'IncludeType' => 'cid',
);

my $MIMELiteObj = $mailHTML->parse($HTMLurl) ;


my $msg_as_string = $MIMELiteObj->as_string;


my $parser = new MIME::Parser;

my $entity = $parser->parse_data($msg_as_string);


# Attach stuff to it:


my $cont_entity = MIME::Entity->build(Type => "multipart/mixed");
$cont_entity->add_part($entity);
$cont_entity->attach(
Path => $jpg_path,
Type => "image/jpg",
Encoding => "base64",
Disposition => "attachment",
);

print $cont_entity->stringify;



MyMIMELiteHTML is just my version of MIME::Lite::HTML, with a few bug fixes and changes to fit in my program better.


http://search.cpan.org/~alian/MIME-Lite-HTML-1.22/HTML.pm


I've tried also just added the attachments to the multipart/related entity, but the new attachments never can be found - at least in Mail.app (Gmail? Yes?), unless you put in a bogus Content-ID header for the attachement - which actually could come in handy in some rare cases, but I digress...