The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Wow, Do We All Get a Language?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Wow, Do We All Get a Language? Posted: Jun 18, 2005 5:26 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Wow, Do We All Get a Language?
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

We’re all having a lot of fun this year making lovely hybrid languages from Ruby syntax, be it Rails models, Rake tasks, Dwemthy. Martin Fowler is knocking out a series of articles on domain-specific languages and language workbenches, the IDE and BDUF equivalent. All the surrounding essays are really interesting, including his IDE-based metaprogramming example, which gives you an idea of how parsing and code generation is being organized into these crazy point-and-click apps with IntelliSense and stuff.

Readers of this site will particularly love the early slant of the workbench article, since he attempts to hack some C# code in meta fashion, but it can’t hold a candle to his YAML-ish custom syntax:

 mapping SVCL dsl.ServiceCall
   4-18: CustomerName
   19-23: CustomerID
   24-27 : CallTypeCode
   28-35 : DateOfCallString

 mapping  USGE dsl.Usage
   4-8 : CustomerID
   9-22: CustomerName
   30-30: Cycle
   31-36: ReadDate

And, better yet, his subtle retooling into Ruby code:

 mapping('SVCL', ServiceCall) do
   extract 4..18, 'customer_name'
   extract 19..23, 'customer_ID'
   extract 24..27, 'call_type_code'
   extract 28..35, 'date_of_call_string'
 end

 mapping('USGE', Usage) do
   extract 9..22, 'customer_name'
   extract 4..8, 'customer_ID'
   extract 30..30, 'cycle'
   extract 31..36, 'read_date'
 end

I found it almost bewildering that he links to Chapter Six of the (Poignant) Guide in his discussion of Ruby metaprogramming. I mean the reference to Rails is natural, but I would hate for this cartoon book to gain credibility. He knows that I have sketches of my sister’s clones quenching their thirst with jackal’s blood, right??

Read: Wow, Do We All Get a Language?

Topic: BIG Changes in the Flickr API Previous Topic   Next Topic Topic: FCGI memory leaks

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use