Friday, 25 February 2011

The SDL Perl Game Contest!

Sure, you know what SDL is, right? Well, SDL has very nice Perl bindings that let you use the power and flexibility of Perl to write awesome games in no time!

There's even a manual to help you get started, including full game tutorials and a list of free/open-source resources for your games, like sprites, sound effects and music.

But by far the Coolest Game Ever™ is the one *you* write, from that silly idea you had the other day to a playable game you and your friends can enjoy.

And this march, the SDL Perl team is going to help you take that project out of your dusty drawer of "TODO"s and turn it into a reality, with the SDL Perl Game Contest!

The rules are simple, and much like the Perl Ironman contest:

"One game per week. Every week of march."

This means by the end of march you'll have not one, but FOUR games to show for. How cool is that?!

In fact, you can even make your weekly game the subject of your Ironman posts this month, and take out two birds with one stone (hmm... more game ideas)!

This monday (feb. 28), start writing your game! You have until the following monday to make it playable ("complete") and start all over again with a brand new game for the next week.

But what if I miss a deadline? What if I can't start this monday?

It doesn't really matter - just join the party and have some fun! Even if you only get to do one game, it's still a great opportunity to improve your skills and learn a bit about game design and development.

If you need any assistance writing your game, from ideas to code, WE WILL HELP! Just send an email to the SDL Perl mailing list with your questions (subscribe by sending an empty email to sdl-devel-subscribe@perl.org, then fire your questions to sdl-devel@perl.org) or, better yet, join us live in #sdl over at irc.perl.org and we'll be more than happy to assist you and try your game out. If you never used irc before, please keep in mind people might be busy or in different timezones than you, so you may get instant responses or have to wait a few of hours before you get a reply. Be patient!

It can be a game about anything. Just make sure it's doable in a week. Some games take years to be complete, but you might be surprised at how much you can accomplish in just a few hours with SDL Perl :)

Oh, there's one extra rule, actually, and that's mandatory - HAVE FUN!! :)

Friday, 18 February 2011

Teaching Perl to Undergraduates

Perl is an amazing programming language. And, with its growing worldwide re-popularization, it was an easy sell to the Computer Science Department of the Federal University of Rio de Janeiro, one of the best and most famous universities in Brazil, when I offered to give a free Perl summer class to the undergrads.

The idea was to give students the opportunity to learn a new language, presenting the concepts, structure, best practices and design patterns of modern Perl 5. It was also my response to seeing so many companies here complaining about the lack of Perl developers, forcing them to use other languages even when Perl would be the best alternative for them.

And what a huge success it was!

The course was given by Bruno Buss and myself, with me doing the talk and him preparing and giving exercises to the students and helping them with their code. At first we were hoping to get about 10 students interested, specially since we didn't have time to advertise the summer class at all. In fact, due to uncontrollable events, we could only confirm it and open registration two weeks before the class itself started. Even so, we decided to carry on with it. Later that night I got a message from Buss: "we're gonna need a bigger room".

Turns out that in less than 24 hours we already had over 25 undergrad students registered for the course! We kept registration open as a waiting list, since we couldn't find an available lab with more than 25 PCs in such a short timeframe. A day before the beginning of the class there were over 50 students applying for a spot, even though they already knew the class was full!

And this is Perl competing against student vacations, during summer, in Rio.

The course was one week long, from 1pm to 5pm (yes, we had to compensate $dayjob during nighttime, but it was well worth it). Slides for all 5 days are available. It's mostly Perl, with a little Portuguese here and there like variable names, values and complementary information whenever necessary. Here's what we covered:

  • Day 1 (slides) - What's Perl all about; how to use perldoc; the modern and safe header (use 5.12.3; use warnings); basic I/O; scalar variables; manipulating numbers and strings; conditionals; loops; and file I/O, with autodie to capture exceptions. We also spoke about the Perl community, showed off a bit of Padre, the Perl IDE, and encouraged students to use chromatic's brilliant "Modern Perl" book as reference material.
  • Day 2 (slides) - Running external programs; arrays (and how to manipulate them); hashes (and how to manipulate them); scalar x list x void context. That, and lots of exercises to fixate what they learned so far.
  • Day 3 (slides) - References; building complex data structures; functions (subroutines); stack traces with Carp and Carp::Always; and retrieving command line arguments with Getopt::Long. While explaining anonymous subs we also mentioned/demonstrated closures and state variables, but didn't really get into it as it was a beginners class. The day ended with an explanation of Perl's sweetheart, the CPAN. We showed students not only how to install modules (with local::lib), but included an explanation of the full CPAN stack, including web search, CPAN Testers, Deps, Ratings and Bug/Request Tracking. We also discussed how to exploit those features (and other common tips) to pick a good module (and, of course, Task::Kensho).

Students were mostly from Computer Science, with around 6 of them being from Biology/Biophysics/Bioinformatics, and one or two from Electric Engineering and Applied Mathematics. In the end, there were 27 undergrads. Yes, 27. It was very rewarding to see 2 booted students showing up anyway, with their laptops, asking if they could sit on the back and participate. Of course they could :)

Monday, 27 December 2010

A 2010 filled with Perls

2010 is almost over, and I figured it's time for a retrospective of yet another awesome year for the Perl programming language and its worldwide communities. I tried making this list as complete as possible, but it's of course my own point of view, so feel free to add anything you feel I've missed on the comments below, or in your own blog post.

So, without further ado, here are (my) highlights of the Perl world in 2010!


January

The year started with Perl Oasis, the traditional conference in Florida, USA, in a full day packed with great talks!

The Bulgarian Perl Workshop in Sofia also had some very nice practical talks about modern Perl topics.

Viacheslav Tykhanovskyi released Text::Haml, a Perl renderer for the increasingly popular Haml templates born in the Ruby/Rails world. The popularity is spreading fast, and there are already views for it in Catalyst, Mojolicious and Dancer.


February

Frozen Perl, a three-day event in Minnesota, USA, this year also had two Perl classes and a hackathon. Very nice!

On the other side of the world, the Perlburg Workshop in Yekaterinburg, Russia, was also packed with talks on several modern Perl topics.

The first version of perlbrew was released! What an amazing tool by Kang-min Liu, letting you manage several different perl installations in your home dir. Feels like forever, right?

How about cpanm, yet another incredible miyagawa-ware, proving to be an excellent lightweight alternative for installing Perl modules. It also made its debut to CPAN in February, and now you can even do curl -L http://cpanmin.us | perl - $MODULE. Soo sexy!

Tools like these two and local::lib make us wonder how did we live before them :-)

In fact, speaking of Miyagawa, man was he on fire or what this month?! February also marked the release of Starman, a high-performance preforking PSGI/Plack web server. It fits so nicely it's now used in production everywhere.

Last but most certainly not least, David Mitchell submitted a grant proposal to The Perl Foundation, to fix bugs in core Perl 5. It was a huge success, and over the year he worked for more than 500 hours and closed 127(!!) tickets.


March

The Perl 6 Hackathon in Copenhagen, Denmark, raised a lot of awareness around Perl 6, showed practical examples and offered a hands-on experience to all attendants.

Perl also made a huge appearance in Germany at CeBIT, the world's largest computer expo, showcasing modern Perl solutions like Moose, Catalyst and DBIx::Class to over 8000 individual developers and companies from all around the globe, not to mention products such as Foswiki, and OTRS. Nice marketing, Perl::Staff! :-)

Moose 1.0 was released to the world! Now, I know Moose has been stable and production ready for a few years now, being the de-facto way to create and manipulate objects in modern Perl, and the only reason 1.0 was released was because they ran out of two-digit numbers. Either way, it looks nice and might make some enterprise people subconsciously more comfortable using it ;-)

March is the month of the first Equinox of the year, and the São Paulo Perl Mongers in Brazil celebrated the date with a calendar of Perl articles in portuguese, contributed by developers all over the country, just like the traditional advent calendars in december.


April

Perl 5 release 12 was finally out of the oven! And what a great improvement it was, with default strictness, Unicode overhaul, Y2038 compliance, pluggable keywords, and much more!

The Perl QA Hackathon in Vienna, Austria, gathered around 30 people in 3 full days of intense (and happy!) hacking, culminating in several improvements on the already great Quality Assurance tools for Perl, including Devel::Cover, Test::Smoke and Test::Harness.

Bugzilla 3.6 was released, offering exciting new features for users and administrators, including migration tools, a simple "Browse" interface, lots of usability improvements and drop-in extensions.

Josheph Hall and brian d foy did it again, and the second edition of Effective Perl Programming is better than ever, showing real problems and real solutions, just like the companion website. What are you waiting for, go get it now!

The unbelievably fast Text::Xslate templating system by Goro Fuji was released on an unsuspecting world. It's up to 158X faster (!!) than everyone's favorite Template::Toolkit, and provides a compatibility layer letting you use TT2's syntax and virtual methods if you want. Also, there are already views available for your Catalyst, Mojolicious and Dancer web apps.


May

DevConf, a major conference in Russia gathering over a thousand professional web developers, had a full track just for Perl!. And of course, the Russian Perl Community was amazing as usual and provided several nice talks for DevConf::Perl.


June

Wow, this month was filled with Perl conferences! Portuguese Perl Workshop, German Perl Workshop, Belgian Perl Workshop, each of them filled with nice talks and courses.

YAPC::Russia this year happened in Kiev together with Perl Mova, the Ukrainian Perl Workshop, and was another huge success.

And speaking of huge successes, June is not over until after YAPC::NA. The greatest Perl conference in the Americas happened for a full week in Ohio, USA, and had over 130 talks!


July

Following the mid-year sprint of Perl events, we also had the São Paulo Perl Workshop in Brazil, and the Warsaw Perl Workshop in Poland.

Rakudo Star was released! It's a useful - and usable! - implementation of the Perl 6 language specification.

Goro Fuji released the first version of Text::Clevery, a Text::Xslate subclass allowing developers using PHP's Smarty template syntax.

Gabriel Weinberg released DuckDuckGo's community website. I already wrote a bit about the amazing (and amazingly fast) DuckDuckGo search engine, and if you never used it, now is the perfect time. But beware: you might never return to Google search. I know I haven't ;-)

July also marked the second birthday of Padre, the Perl IDE. For a whole weekend, Padre developers, users, friends and well-wishers joined a huge party and hackathon.

FISL 11, the largest opensource event in Latin America, gathered over 7000 developers, enthusiasts and companies in Porto Alegre, Brazil. We had a very busy Perl stand there, and made a contest on the conference's big screen of an arcade zombie game developed live during the conference using SDL Perl. It was lots of fun!


August

YAPC::EU, "The Renaissance of Perl", joined Perl developers from all over the world in Pisa, Italy, with over 100 amazing talks and 14 tracks! They even had a cooking contest after the conference =P


September

JT Smith and crew released Lacuna Expanse, a highly addictive free massive multiplayer online (MMO) deep space empire strategy simulator (phew!) written in Modern Perl. It also has a public API, and people even hacked a new client for automated tasks. If you haven't played it yet, do it. Now. It's even integrated to Facebook, so if you have an account there, you don't even need to create a login.

Speaking of games, SDL Manual was started by Kartik Thakore in yet another grant by The Perl Foundation. It's not done yet, but it's the first real documentation of the new API, and already contains tons of code examples and complete game tutorials in Perl.


October

This month we had not one, but two other YAPCs!

The ever great YAPC::Asia in Tokyo went along for 3 days filled with the most awesome talks, and broke a new record: over 500 attendants!! How cool is that?!

On the other side of the world, YAPC::Brazil made its second appearance as a standalone conference in the beautiful city of Fortaleza, with around 100 of people attending online and on-site.

The Facebook SDK distribution was revived by Torsten Raudssus, giving a better overview on how to dive into the Facebook platform using the long existing modules to access the Facebook API via Graph or REST. Many Perl developers are active in social networks (writing robots for Twitter is a real breeze with modern Perl), so if you missed it now is the perfect time to get on board ;)


November

The Blekko search engine was released, offering a neat /slashtag syntax that lets you get the most relevant results in a heartbeat. It's great to see so many new companies relying on modern Perl for their core businesses. Give it a try, and slash the web!

Following the events calendar, the Austrian Perl Workshop opened november with a 2-day conference filled with great talks.

There was also Nordic Perl Workshop, organized by the Icelandic Society For Digital Freedoms in Reykjavik. It's the first time the NPW is held in Iceland, proving that volcanic eruptions may shut down an entire continent's airspace, but the camels will just keep strolling like it's a morning fog ;-)

With the second Equinox of the year, the São Paulo Perl Mongers arranged another sprint of modern Perl articles in portuguese, written by the entire Brazilian community.

Finally, after a lot of expectation from the worldwide Perl community, chromatic's Modern Perl book was finally out! As far as I can tell it's the best reference for modern Perl coding today, and an excellent read. I honestly think it's an amazing learning and reference material, and might prove insightful even to the most seasoned programmer. So go buy it now!


December

The always amazing London Perl Workshop happened on the 4th and proved once again to be an enormous success, including a talk by Spiros Denaxas about how Perl was used in medical research and epidemiology to help cure coronary heart disease.

On the 18th - Perl's birthday! - there was the Sixth Russian Perl Workshop, Saint Perl 2, in the lovely St. Petersburg, also filled with talks in Russian and English for all audiences, for free.

Perlbal::Manual, a complete manual for the highly used Perlbal reverse proxy and load balancer, was published by Bruno Martins and José Castro. Yay!

Mojolicious 1.0 was finally released, and it really makes web development fun - specially Mojolicious::Lite!

Speaking of fun lite web frameworks, the Dancer Advent Calendar made its debut this year, with several articles teaching you how to do things with Dancer, from testing and managing database connections to creating a tiny blog!

All other already traditional Perl, Perl6, Catalyst, RJBS's, and JPerl Advent Calendars are most definitively praise-worthy and were responsible for over 300(!!) new articles on Perl and its modules, with tons of awesome tips and cookbooks this month only! In fact, the Japanese Perl community is so freaking amazing they had 8 (that's right, EIGHT) tracks on their Advent Calendar, so JPerl alone was responsible for 200 articles this month. すごい!!


Wow, so much in just a year! I can't even begin to imagine all the wonderful things that are going to pop up in 2011!

See you there :-)

Wednesday, 6 October 2010

Perl and Online Communities

Today, the ever amazing xkcd released a new map of online communities. Until last year or so, most of the Perl community resided on "email land". Granted, it's a huge place, but not so pretty, and foreigners probably needed a visa to enter - or at least someone inside to give you directions and keep you out of trouble. Oh, we also have our cozy and warm "irc isles", but let's face it: it's not that big an empire.

Then the Ironman Challenge came, and people followed. Or, rather, blogged. And what a great thing it is! Our brave explores went out of their comfort zones and right into the blogosphere core, planting the camel flag and claiming more ground for Perl.

Lots of us also settled on the huge Twitter continent, showcasing Perl to contacts and followers. Others have decided to head north and are now bravely fighting the flames of Reddit, Digg and several other web forums, getting more and more Perl news out of the annoying old myths and into the Slashdot effect - and what a nice bootstrapping this is, being that Slashdot itself is written in Perl!

What lies ahead? Right now, the great (and greatly addictive) Lacuna Expanse game is taking Modern Perl straight right into the "MMO Isle", where I'm sure very nice things await. It's the new land of opportunity for Perl apps. And it's already integrated to Facebook, another promising shore for the Perl programming language and its ever growing community.

Now if you excuse me, I have a Spy Pod waiting to be launched against the evil Perigrin's Estate. Erm, I mean... work, yeah. ;-)

One Click Installers for Perl Web Apps on Dreamhost

Love it or hate it, Dreamhost is one of the most popular web hosting services out there. One of the reasons is their one-click install feature, letting people install opensource software for their web publishing needs like Wordpress, MediaWiki, Trac, Drupal and several others, automatically.

Now it's our chance to add some Perl apps there too! If you are part of an app's community, Dreamhost created a "One-click installer" submitter form for developers, where you can add your app up for evaluation. In their own words, it's "a unique chance to get some great exposure; thousands of DreamHost customers would see it every day!"

How about it, then? MovableType? Melody? MojoMojo? From what I can tell, everyone is welcome - just fill the form (you will need to provide a contact email) and cross your fingers :)

And if you really want to get to them, it appears they are starting an experimental program with all the developers using Dreamhost. Just sign in their developer mailing list.

What I would really want to see from Dreamhost is Catalyst already installed - or at least a lighter/simpler framework like Mojolicious/Mojolicious::Lite or Dancer. They already come with Rails support, so why not Perl as well? Spread the word, let's make some noise! :D

Sunday, 1 August 2010

Bringing Worldwide Perl Communities Together

A couple of weeks ago I had this very nice talk with Daisuke Maki, Gábor Szabó and Kenichi Ishigaki about Perl communities worldwide. These days, as once was with french, and german, and latin, if you want to be heard in a wider audience, you have to speak (or, in this case, write) in english.

But what goes around in english doesn't necessarily reflect what's actually happening worldwide. Wikipedia estimates only 400 million people having english as their first language, and something between 500 million to 1.8 billion speakers overall. In a world of little less than 7 billion people, you can see how a lot of information may be lost.

In fact, as Ishigaki-san pointed out, a lot happens where most of the non-speakers don't know. This is true for both the japanese and brazilian communities, and I'm pretty sure it is also true for a lot of other communities where the native language is not english. It's not some bizarre sort of protectionism or xenophobia; there is just too much going on with too few having/taking the time to show them off to the unsuspecting, english-speaking, world.

Not that everyone would care, of course. But some might (I know I do, and Gábor does, too). Besides, as Maki-san mentioned, it might be interesting not to be completely clueless about what happens in other communities, even if some of those things are too regional to be useful outside the local Perl Monger group.

While events such as the imminent YAPC::EU, are an awesome opportunity to hear about what's going on with several different Perl groups, a lot of us can't make it to Europe, and the language barrier still poses an issue.

Some movement is already there to achieve this sort of integration and spread the Perl word across idiom barriers. Fayland wrote and uploaded to CPAN a Perl Book in Chinese, so Perl would easier reach the Chinese Community. I believe Shawn Moore's comment in that module's ratings goes a long way. Speaking of Chinese Community, did you know last year they even made a Perl Advent Calendar?

There's also an ongoing attempt to translate documentation and make perldoc aware of localization. Translations in French, Italian, Lithuan, and Brazilian Portuguese are already on CPAN. And Ishigaki's Acme::CPANAuthors quickly became a huge success - I'm actually proud of being one of the early adopters - offering a way for Japanese, Brazilian, Russian, Ukrainian, British, Icelandic, Norwegian, French, Canadian, Korean, Italian, Taiwanese, Turkish, Portuguese, Israeli, Indonesian, German, Dutch, Chinese, and Austrian authors to know a bit more about each other. And I'm sure more are on their way!

So, just as I often try to make people here in Brazil aware of what's going on in the worldwide Perl community, in the next few posts I'll take some time to go the other way around, and broadcast a little of what's going on in these parts to whomever is listening.

I'd also really like to know more about *your* local Perl Mongers group. After all, we do speak the same language, and that is Perl ;-)

So, what have you guys been up to?

Tuesday, 27 July 2010

DuckDuckGo, a *fast* and *awesome* web search engine (in Perl!)

More than often we hear people in the Perl community asking for more Perl applications and solutions instead of just modules. Well, Gabriel Weinberg (YEGG, on CPAN) did just that!

His new creation is called DuckDuckGo (DDG for short), a search engine with lots of cool features, like:

  • It's blazing fast! Google's search results doesn't quite make it for me, but I could get to the "right" result in the list (even in other pages) really fast, so is was one of the biggest blockers for me in switching to other engines. No more :-)

  • Official sites are labelled and displayed on top.

  • No ads above results, and actual privacy! Unlike Google, DDG does not track users, nor displays "sponsored links" on top of your search.

  • Zero-click info is an amazing way to find what you're looking for in your search without having to follow any links. Let DDG do the hard work for you!

  • Several goodies ready for you: go to the first result prepending a "!" to your search, find your IP address by simply querying "ip", get random numbers, test a regexp, and much, much more!

  • site:, filetype:, inurl:, AND, OR, and all your favorite advanced operators work too!

  • Keyboard shortcuts and customizations let you setup fonts, colors and much more! If you don't like to use the mouse, you can do everything via the keyboard.

  • Encrypted search, just use https:// instead of http://
Read the About and FAQ for more features and information, and give it a try. You might be surprised :-)

Want to help promote more Perl-based solutions? Sick and tired of Google search? Switch now!


Oh, did I mention it is **fast** ??

Cheers!