Friday, January 20, 2006

Software Roadmap

I have started a number of small projects, both to explore ruby's capabilities and to play with some concepts that I found hard to express in other languages.  These projects are still in their infancy, so I haven't put them on rubyforge yet, but I plan to work on releasing them soon.

The projects are:
I will show a couple of prozed intents from these projects.  If any of you is interested in any of them, let me know and I might focus my efforts on what becomes more popular and I will release it on rubyforge.

Agave

a small set of metaprogramming utilities

intent of "Generating text from a line of text and variations"

    "Dear <title>  <person>"
        substitute
            "<title>"  => ["Mr", "Dr", "Mrs"],
            "<person>" => ["Smith", "Black", "Grey"],
            separator  => ", "
         
    should be "Dear Mr  Smith, Dear Dr  Black, Dear Mrs  Grey"


this is used as an helper to generate code for metaprogramming purposes.

Jazzgarden

smart operations on objects - spreading commands over collections, taking 'slices' from object collections

easy creation of Value Objects

class Person
   defined by name, surname, age
end

intent of "Reading attributes of an object using 'defined by'"
    a person = Person new "Winnie","Pooh",70    
   
    a person name should be "Winnie"
    a person surname should be "Pooh"
    a person age should be 70

existential quantification

intent of  "Verifying if exist any" 
    expect [1, 6, 10] exist any? |n| n>5
    dont_expect [1, 6, 10] exist any? |n| n>15

intent of  "Verifying at least one element is true" 
    expect [true, true, false] any true?
    dont_expect [false, false, false] all true?

collective action using several alias forms

people = [
    "john",
    "mike",
    "Sam"
]

story "Turning people names to uppercase"
    people to upcase should be ["JOHN","MIKE","SAM"]

intent of "Using shortcut form for collective action"
    people / reverse
    should be ["nhoj","ekim","maS"]

    people all reverse everyone capitalize
    should be ["Nhoj","Ekim","Mas"]

object slicing

intents "Object Slicing - sorting by property"
    people sort by name  every name
    should be [
        "bill","john","mike","paul","sam"
    ]

and random picking... I will just give a prozed example here:

people = [ "john", "sam", "mike", "frank"]
people pick one
people pick two
people pick two different


SmartStores

implicit mapping of directory and file structures to object aggregates.  mapping of file types to classes

def sample smart store
    SmartStore new ("intent-files/data")
end

story "Opening up an order"
  repository = sample smart store 
  repository map! [child, of "orders"] => Order
   
  an order = repository
               order milan["20050906"]
               retrieve 
   
  expect an order, 
     to be Order new 
             "Chairs"    =>  18,
             "Laptops"   =>  10,
             "Desks"     =>  7


Clay

all my intents for Clay are very poor.  I'll describe it another time.
what it does is to let you improvise the creation of objects and their attributes without needing to declare any class for them.

Highrise

a small financial framework

story "Using Cashflows"  
    Let's now deal with cashflows
 
    with  Conventional discount =
          continuously compounded yield

    we  expect about 271.67748, as the
        present value of 
          Cashflow  [
             100 at 1 year ,
             100 at 2 years ,
             100 at 3 years 
          ],
          with interest rate at   5 percent

The other stuff is a bit more articulate and I'll leave it for another post :-)


Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?