New Blog on DSLs: Little Languages

It was made official in the coolest way possible, in a [Lambda the Ultimate post](http://lambda-the-ultimate.org/node/1628), that the [LittleLanguages.net blog](http://www.littlelanguages.net/blog/) has begun.

DSLs (domain-specific languages) are hip. The weblog “A Fistful of Languages” is a weblog about them.

> Here’s where the “Fistful of Languages” blog comes in. This blog aims to address all aspects of DSL development, focussing particularly on DSLs embedded in Ruby.

Tobias and Dave are old hands in computer languagery. They also both like weird cinema. I look forward to following [the blog’s RSS feed](http://littlelanguages.net/blog/feed/).

[tags]dsl,blogs,programming languages[/tags]

Awk, text processing

Fooling around with load average output on a shared host (where it can be life-or-death):


$ w -s|awk '/load average:/ { print "Load averages:\nPast 1 min:  " $10 "\nPast 5 min:  " $11 "\nPast 15 min: " $12 }'
Load averages:
Past 1 min:  20.94,
Past 5 min:  20.67,
Past 15 min: 18.75

What’s w, you say? The manpage says:

> w – Show who is logged on and what they are doing.

Awk’s got grep rolled right into it. And the default action is “print the line”. Practical. (Above I had to go all fancy, and adding what those fields mean. Sorry about that. I’m like that.)

If you scroll a bit in the little code window above, you’ll see that the significant values are $10, $11, and $12. The tenth, eleventh, and twelvth *words*! If your data is tab-separated, you change the delimiter to a tab instead. Or, to a comma for CSV files. Bam, you can read almost anything right there.

The concatenation (fancy word for adding two strings to one) sign is… nothing. Elegant.

Read more on awk in [the gawk manual (Free documentation!)](http://www.cs.utah.edu/dept/old/texinfo/gawk/gawk_toc.html).

**Update**: Or, read esr’s [damning of awk](http://www.faqs.org/docs/artu/ch08s02.html#awk), in his [The Art of Unix Programming](http://www.faqs.org/docs/artu/).

Nitro: A Rails contender?

I copy-edited [a Nitro article](http://www.oxyliquit.de/tutorial/4) on using the fulltext search index facility [TSearch2](http://www.sai.msu.su/~megera/postgres/gist/tsearch/V2/) for [Postgres](http://www.postgresql.org/). (Smart way to read an article slowly enough to let all of it seep in.)

[Nitro](http://www.nitroproject.org) is an MVC web framework written in Ruby. “For Web2.0”, you know.

Interested Nitro neophytes can head over to [Oxyliquit](http://www.oxyliquit.de/), the Nitro Q&A website, which has tutorials, FAQs, articles, and all the other resources you may need. And a link to #nitro at irc.freenode.net.

After reading about Postgres, and hearing about it, from Peter Marklund, I was encouraged enough: I compiled it and installed it on laptop, using [this fine Apple tutorial](http://developer.apple.com/internet/opensource/postgres.html). A thorough, helpful walk-through.

Reading [the Postgres 8.1.4 documentation](http://www.postgresql.org/docs/8.1/interactive/) was a little like paging through a blasphemous tome of ancient knowledge: all of my “Keep Your Logic Out Of The Data Storage” ideas were challenged, and I was often wow’ed with the raw power. On every page, with all the new features. I have some digesting to do. Let the new gospel sink in. Take a stand.

What are your feelings about Postgres’ power?

Learning more Haskell

(Minor update: Removed a double-quote too much. Darn [AutoPairs](http://www.jwwalker.com/pages/autopairs.html). Maybe it can be configured.)

[Jamis Buck](http://jamis.jamisbuck.org/articles/2005/10/30/learning-haskell) brought me back on track with learning Haskell: I have had the [Yet Another Haskell Tutorial PDF](http://www.isi.edu/~hdaume/htut/) on my laptop for ages, but those things don’t read themselves.

A sidenote: using Haskell feels loads more natural to me compared with Common Lisp. I try reading [Practical Common Lisp](http://www.gigamonkeys.com/book/), as well. Grabbing the first item off a list (aka the “head” of the list):

Haskell: head( ["olle", "floyd", "muhammad"] )

Lisp: ( first ( list "olle" "floyd" "muhammad" ) )

That [s-expression syntax](http://en.wikipedia.org/wiki/S-expression) comes to bite me all the time! (I had to review that Lisp statement a couple of times in an interactive environment, to find and remove my C-style parentheses, and make it s-exp’y.) Haskell’s form has a more C-programmer-natural feel to it; YMMV.

[tags]haskell,programming[/tags]

Copenhagen.rb loosely coupled

In a comment here, Jesper said:

> This may be a good place to mention that Jakob Skjerning set up the [Copenhagen Rails mailing list](http://lists.substancelab.com/mailman/listinfo/copenhagen.rb) (in Danish).

Perhaps it even deserves a blog post. [Jakob](http://mentalized.net/) says (translated from Danish):

> We picked the name Copenhagen.rb after some thought. Primarily since it’s a well-spread way of naming Ruby usergroups, but also since Copenhagen Ruby Brigade sounds about 342 times cooler than Copenhagen Ruby User Groups.

> Why Ruby and not Rails? Hm, well, good question, and if you’re very fanatic about the R meaning Rails, you’re welcome to label yourself a member of the Copenhagen Rails Brigade. The Ruby and Rails symbiosis is so clear nowadays, that there isn’t much grounds to separate the two.)

[tags]rubyonrails, rails, copenhagen[/tags]

HTTP verbs and Rails

At the meeting yesterday evening, Jesper whipped out the largest PostIt I ever saw, and made an agenda for the next meeting.

I said I was interested in talking a bit about Rails’ new direction wrt HTTP verbs: it seems [Casper Fabricius](http://casperfabricius.com/blog/) and the web has most of the information at hand: so enjoy [Casper’s introduction to the new concepts](http://casperfabricius.com/blog/2006/06/25/railsconf-dhh/).

In short: getting the PUT and DELETE verbs supported everywhere will take some hackery, and the ASP.NET-like viewstate hidden input field is fielded for this role.

Read [DHH about Resources](http://www.loudthinking.com/arc/000593.html). Read the slides PDF, there. Quite the concept-chunk to bite off. Many new things are to come.

And, as DHH said, the extractions from his company’s products arrive way before the products do, so this is already in Edge Rails. Interesting times.

Oh, and don’t miss [Ryan’s list of what is new in Edge Rails](http://www.ryandaigle.com/articles/category/whats-new-in-rails). I’m subscribing to [Ryan’s feed](http://feeds.feedburner.com/RyansScraps)!

*Update*: [Josh Susser on the Relationship Model](http://blog.hasmanythrough.com/articles/2006/06/30/working-with-the-relationship-model), which this new CRUDdy world has brought on. Also, his [post about CRUDdy searches](http://blog.hasmanythrough.com/articles/2006/06/30/cruddy-searches) has great comments. (That’s blogging for you.)

Live report from the meetup (like a true geek)

**Update:** spelling, adding details, names, URLs.

Sitting at the Copenhagen meetup, like some kind of backchannel geek. Typing. (There were five wireless networks around me, so I didn’t need the password to the bar where we sit. Quite a nice location, a quiet, loungy upstairs. I guess this post will be updated more than once. Sorry for that, in advance.)

[Jesper](http://www.justaddwater.dk/)’s here. He said: “Our first 60 beers are on Our Kind Sponsor.”

Thomas introduces his interest in, and his work with, Rails. He’s Jesper’s colleague, and he began using Ruby on Rails around New Year’s in 2006. “We began mocking stuff up for customers using Rails.” One small-project customer said: “Drop that ASP track, and write it in Rails, it seems much cheaper.”

Personal reflection: We are finding out the magnitude of The problem of Taking Stuff Over (after the initial consultant who built the magic has left for other challenges). Meetups make it possible to reduce this problem.

Corporate challenge: Convince not the boss, but the customers.

Small-business challenge: Convince boss to change business.

One-man challenge: Create, and make a business of the creation?

Re: Prototype with Rails. _A pitch can be worked out over about 1000 man-hours._ Quite interesting data point. (Someone said: “Using Rails you’d be at Version 4.0 after 1000 hours.”)

[Casper Weibel](http://www.weibelmedia.dk/)’s here. His stint in London’s ending, and he’ll come home to Copenhagen. Praise of Rails, and his meeting with Rails.

Morten (who had come over from Aarhus), who were at the PragProg’s workshop. “We got to implement PragProg bookshop, selling _their books_.” [Laughs.]

(There was some amount of bashing one’s “home environment” for web development. People very consistently talk about trying to find alternatives to their current tools. “Re-tooling” said one guy.)

Jesper: “Instead of doing HTML mockups, I was able to do a working Rails app.” Note about the enormity of documentation to go with static HTML mockups.

Jakob Skjerning: “Trying to bash Rails, getting it to fall over, and as yet, it wins over ASP, even when running on a weaker machine.” Jakob’s been blogging about his research into moving an ASP 3.0 application to Rails.

(Now, a big fan started behind me. Fsck. People need to talk louder, more “bullet-point-like”. Pelle’s taking pictures. I wonder what he’s tagging them with?)

(Some guy I missed the name of, after Jakob S.): “PHP kind of sucked, and I have few customers to convince, so moving to Rails was swift.”

Next guy: “I live off of Java, but I like Rails.” And: “I can concentrate less on the framework, and using AJAX was just much less painful than in Java. And fun, even.” Praise of Webrick. Here to meet Rails folks.

Svante, from Fyn tells about his day job: “Maintenance of ASP 3.0.” And about “my Hobby Projects, which are not ASP.”

Rails has The Name-dropping Problem: “The customers ask ‘Why is no one else doing it?’ and you don’t have the Long List of Big Names to show them.” (said Jakob.)

“You can send loads of Word documents of screenshots before actually getting to the core of What This is About.” Using Rails to prototype is… just Faster.

Back channel is: irc.freenode.net and #railsmeetupcph. (Note: It had about 5 users.)

Guy with moustache (his name was Mads, and he works with Jesper): “Rails as a frontend, Action Web Service as talk-to-others.”

Lars of [Nordija](http://www.nordija.dk/): “[Watir](http://wtr.rubyforge.org/): that is how I found Ruby. Ain’t yet used Rails.” A sales guy. Pushes Rails inside his company, to the developers of his company.

[Pelle](http://www.stakeventures.com/): “Ruby, I’ve been using it a long while. My micro-conglomerate is paid by Java consulting. Perl still rocks, nice to hear. The stuff we used to do in ’95, it’s now done using Ruby and Rails. Thanks for doing the corporate pushing of Rails, Jesper & co.” Then he railed about Culture. Then about How To Work. He is bloody incisive.

Then we got onto the subject of Insurgency!

**Update:** Yes, here the live reporting was cut off, as [Peter got me to broadcast the meetup in Skype](http://ruk.ca/article/3741). He posted a screenshot to prove that he “was there.”

**SOME NUMBERS**: I asked for a show of hands about how the congregated people paid their bills:

* Java: 7
* .NET: 7
* PHP: 4 (Peter Rukavina raised his hand in the IRC, but I didn’t count that)
* Other: 2 (mainframe & Perl)

I guess I should not be surprised at this turnout of Java and dotnetters, but 3 other PHP folks?

Peter Brodersen was one of the other PHPers. “Is that the Peter at [Findvej.dk](http://findvej.dk/)?” asked Jakob. I think it was nice to hear the words “at Findvej.dk” – it sounds so established. [tags]events, rubyonrails, rails, copenhagen[/tags]

Rails meetup, tomorrow (29 July)!

Wow, wow, wow. We’ll talk about Rails, we’ll do high-fives, and go to that café. It’ll be fun.

[Jesper](http://justaddwater.dk) raises a few questions in his blog post about Rails thoughts, and in the comments section [Casper Fabricius](http://www.kraftvaerk.net/index.php?id=298) points to stuff he picked up at [RailsConf](http://www.railsconf.org/).

The little, fast Ruby web server [Mongrel](http://mongrel.rubyforge.org/)’s bigger than before. South American Windows hero Luis Lavena’s making huge strides in supporting Win32 with Mongrel every week, it seems. Lurking on the Mongrel email list makes me feel good about Ruby’s deployment future. And, Mongrel lead developer [Zed Shaw](http://www.zedshaw.com/) diligently sat down during this year’s RailsDay and just wrote up [documentation for his work](http://mongrel.rubyforge.org/docs/index.html). Splendid. (You can tell he didn’t update his personal website, but concentrated on the pet project instead.)

Got to get me a server where I can serve with Mongrel. (Added to mental note list.)

On another note: Textmate == my emacs. The twiddle function is Ctrl-t. Harness its p0wer, kids! Makes you a better typist. I installed a full TeX installation, and Lispbox (a working Lisp, pre-configured, for use with [Practical Common Lisp](http://www.gigamonkeys.com/book/)), too, on the Mac.

Update: Still having an encoding wrinkle to sort out with Textmate’s Blogging bundle and my blog. That é in café came out garbled. I’ll keep you informed.

Another upcoming geekdinner

Yeah, please do attend, Copenhagen geeks. It’ll be interesting. July 28.

The wiki page for [Geekdinner 4](http://irl.toothlesstiger.net/pmwiki.php?n=Main.Copenhagengeekdinner4) tacitly asks for ideas for places to eat.

There is going to be a theme for the dinner, I think it was something about finding one’s peers, how bloggers can strike up continuous “conversations of action”. Or somesuch. It’ll be interesting to hear about it.

Made me think: Without blogging, I wouldn’t have met [Peter Rukavina](http://ruk.ca/), or even known about Prince Edward Island. Thanks, blogging. Thanks, internet.

Textmate’s becoming my emacs

I am now typing this from [Textmate](http://macromates.com/), the Mac-only text-editing tool. I’m mighty pleased with Textmate, and now that [Tobias](http://blog.wrigstad.com/) pointed me to its Blogging bundle, more of my blogging will be done like this, from my favorite editor.

*Update:* Trouble hit me with the tagging part. Perhaps the Ultimate Tag Warrior plugin and the Bundle are as yet incompatible. Perhaps I bet on the wrong tagging library horse for WordPress? Perhaps I should contact the Blogging Bundle author, and ask for the feature?