Feb
26
2007
They made the announcement last night at the closing session. Great work ChiPy! Ted Pollari and Carl Karsten were the big players behind the bid, they did a great job, and clearly put together a great proposal. Chicago!
Feb
24
2007
The SQLAlchemy talk at Pycon just made a few things click for me. I didn’t really understand SQLAlchemy before, as evidenced by this previous post. The reason it didn’t click for me right away is because it’s not implementing the same pattern as most ORM’s I’ve used. Fowler’s active record pattern is what ORM’s like ActiveRecord, SQLObject and the Django ORM implement. SQLAlchemy implements the data mapper. Projects like elixir put an Active Record pattern on top of the data mapper.
So, a few pattern links and it all starts to make sense to me. Good presentation.
Feb
24
2007
My first day at Pycon was a good one. I attended a couple of good talks, I18N, Parsing, Stackless, WSGI, Web Frameworks, Teaching and Pyweek. All really good talks. But the standout, and the one I want to write about, was the keynote. Ivan Krstic was the speaker, he’s the Director of Security Architecture for the One Laptop Per Child initiative.
From an engineering standpoint, the program is amazing. Engineers like Ivan saw their constraints, like price, size, ruggedness, usability, as benefits, not roadblocks. Like other engineering efforts with strict constraints, they innovated, not for the sake of innovation, but for the sake of success. The laptop itself is adorable, the concept (Python is the filesystem!) is great, the team working on it is tremendously capable. It was an inspiring talk about what’s capable if you have the right people, the right attitude, and a problem worth solving. This problem, the education of the kids of the world, is absolutely worth solving. The best part is, we can help.
Feb
21
2007
This article pretty much explains it, The Magic of Ruby Pens.
It’s a very good write up on exactly why a Ruby block is useful, and isn’t just for iterating over a list.
Feb
21
2007
Last night at the Perl Monger’s meeting, I showed some code I’ve been working on at work that implements a basic Ruby domain specific language. I pulled the basic concept together this morning and put it into my subversion repository here.
Building your own little mini-language is all the rage, and it ends up being pretty fun to do. However, finding simple examples can be tough. The example in my repository implements what Jamis Buck refers to as Sandboxing.
A runner script opens the file with instructions written in your mini-language, and eval’s it in the context of your DSL class. My example is of the “hello” language. You can save this to the file hellodsl_example:
…execute ./hellodsl_runner.rb hellodsl_example, and get this as a result:
Hello there Chris
Hello there Camri
Hello there Cotton
Hello there Tulip
The magic happens in the HelloDsl class:
When you initialize the class, you pass it the text of your dsl file. The text is eval’d. So you text becomes a series of method calls within the context of the HelloDsl class. The class instance, in Jamis’ explanation, becomes a sandbox in which your code is executed.
Feb
21
2007
I presented last night at the Chicago Perl Mongers meeting. The theme was introducing Perl people to some other languages. I think it went over pretty well. For each language, I talked a little bit about the basic syntax, library resources, and general community stuff. Then gave one “cool thing” that I think typically really makes a first looker’s eyes go wide. For Python it was list comprehensions, for Ruby it was blocks and adding methods to existing classes.
Python was a slam dunk demonstration wise, it makes sense to people. List comprehensions are so similar to map that it wasn’t really a conceptual leap. It was just something cool. Ruby was a harder sell. Opening up String and adding a is_cool? method got some good reactions, but the block concept just left a lot of heads shaking. Block usage seems sort of odd at first. I remember not really understanding how my_list.each {|i| puts i} is better than for i in my_list do. I explained that blocks are something you just use for a while, and then you realize that they sort of invert the way you think about simple things like iteration. I built a quick closure, thinking that would help, but it didn’t.
I’m giving this presentation again next month out in Wheaton. Anyone have an advice for how to better present blocks? I think it may very well be the sort of thing you don’t appreciate until you use them for a while, but it would be nice to have an example that really shook people up. Any advice is appreciated.
Feb
20
2007
I’m presenting tonight at the Chicago Perl Monger’s meeting. I’m giving a tour of some stuff that might appeal to Perl programmers who want to learn new languages. I’m focusing on Ruby and Python. Here are the notes, they’re also available in my public subversion repository:
Language Hootenanny
Notes for the language hootenanny presentation at February’s Chicago.pm meetings.
Agenda
- A little bit about me
- Find out what everyone wants to know
- Language overview
- for each language, a brief discussion about its culture, philosophy, and resources. Then the one thing about it that’s really “cool” and some code samples.
What I like about a language
Object oriented, good testing framework, great documentation, fun community, lots of libraries, web stuff. Also, interactive shells…the total time it takes to learn a language is cut down considerably if you have an interactive shell to play with. They’re pretty standard anymore, so this is usually just a given.
Classifying languages
There’s really two kinds of languages in my book, the kind you can make money from and the kind you learn for fun.
Ruby
Resources
My recommendation to learn Ruby is to buy the pickaxe book, and start playing around with it. why’s guide is also good, but it is _pretty quirky, so be prepared. The pickaxe is better if you’re already familiar with object oriented programming and you want to learn Ruby.
One cool thing
Blocks
Python
Resources
The best way to learn Python is to jump into the Python tutorial on the website, then skip around “Dive Into Python.”
One cool thing
List comprehensions.
Perl 6
Resources
PHP?
I haven’t been keeping up with the PHP community enough to really be able to tell you what’s up. I do know that PHP5 is interesting. Discuss amongst yourselves if anyone is interested in PHP.
Other Stuff I Don’t Know (but would like to learn)
Haskell, Lisp
Stuff that other people want to learn, but I’m not so sure about yet.
Erlang, REBOL
Feb
13
2007
I built Victim of Time and Tastebud around the same time. They share a good amount of code. At the time I built them, Django didn’t have a testing framework. Now they do. Neither application wants input from outside people, so I didn’t really jump very deeply into form processing. Now I have a teeny app I’m working on that does want some forms, and I find the newforms library.
What I’m building up to here is, Django is an awesome moving target. As I sort of jump in and jump out on a couple month interrupt, I love these little surprises. I’ve known there was a Django testing framework for a while now, I just haven’t used it. Now with little-mini-project, I’ll have a reason to use it. So, in short, I’m currently behind the curve a bit, but hope to get out in front of it soon. Depending on how this project goes, I’ll write about it soon. It’s kind of a goof.
Feb
13
2007
There’s a tutorial for Elixir up. Elixir is an ORM built on top of sqlalchemy. The tutorial looks pretty good, sort of a hybrid with ideas from SQLObject and the Django ORM.
I’ve looked at sqlalchemy in the past, and liked what I saw, but thought the mapper piece was a little bit odd. Elixir might be a good way to use sqlalchemy with a cleaner (in my opinion) mapper API. Regardless, it’s a nice looking project. Good work Elixir-nauts.
Feb
09
2007
Last night the Humanized crew presented their new application, Enso to the group. Enso looks pretty great, and it’s written mainly in Python. They’ve redefined what I’ve thought was possible from a Python application, especially on Windows. We were all pretty amazed with what they’ve accomplished.
One of the interested tidbits that came out of the talk was a library they wrote that enforces contracts between modules, similar to the design by contract feature in Eiffel. They plan on releasing the library as open source soon.