Archive | October, 2007

The new Ruby logo

29 Oct

Ruby has changed its logo:

new ruby logo

It’s licensed under the Creative Commons Attribution-ShareAlike license and created by Tom Schaub for the Ruby Logo Contest.

IMO, the older logo is far better:

old ruby logo

Sexy, simple and cleaner. What do you think?

Ruby DSL to describe Automata

24 Oct

Recently, I built an internal DSL using Scheme to describe Deterministic Finite State Automata. It was quite easy to do through Scheme Macros, whose are really powerful (and hard to understand). The article “S. Krishnamurti. Automata via Macros. Journal of Functional Programming, Volume 16 , Issue 3 (May 2006)” is a great reference if you want to go deeply.

A macro to describe automata in Scheme would be as:

(define-syntax automaton
  (syntax-rules (:)
    [(_ init-state
        (state : response ...)
        ...)
     (let-syntax
         ([process-state
           (syntax-rules (accept ->)
             [(_ accept)
              (lambda (stream )
                (cond
                  [(empty? stream ) true]
                  [else false]))]
             [(_ (label -> target ) (... ...))
              (lambda (stream)
                (cond
                  [(empty? stream ) false]
                  [else
                   (case (first stream )
                     [(label ) (target (rest stream ))]
                     (... ...)
                     [else false])]))])])
       (letrec ([state
                 (process-state response ...)]
                ...)
         init-state ))]))

Imagine it’s needed to recognize chars sequences like c[ad]*r. Such macro, would allow you to describe a recognizer automaton for these char sequences:

(define cdar-sequence?
  (automaton init
             [init : (c -> more)]
             [more : (a -> more)
                   (d -> more)
                   (r -> end)]
             [end : accept]))

Now you can test any char sequence:

(cdar-sequence? '(c a d a d r)) ; => #t
(cdar-sequence? '(c a r a d r)) ; => #f

Well, I have to do it now in Ruby. Has anyone built some Ruby internal DSL to describe automata? I really wanted to describe them such as:

automaton "recognizer" do
  initial_state :state1 do
    transition 'c', state2
    transition 'd', state3
  end

  state :state2 do
    transition 'c', state3
  end

  final_state :state3
end

I haven’t found anything and probably will make something. What do you think?

Brazilian Rails RejectConf SP’07

17 Oct

Unfortunately, we still have few events related to Ruby on Rails here in Brazil. Fabio Akita started the movement to change it.

We are organizing an event here in São Paulo – Brazil (link pt-BR), similar to RejectConfs. It will happen on November 17, 2007.

If you are close to São Paulo this day, do not miss it.

Update: rubyonrailsworkshops.com is now listing our event and Geoffrey Grosenbach talked about it in his last Ruby on Rails podcast. Great.

JRuby even faster and IntelliJ IDEA 7 finally out!

15 Oct

It’s been amazing days for tech guys like me. Due to the incredible job from the JRuby team (take a look here, here and here), JRuby is closer than ever to run Rails apps faster than MRI!

Congrats guys. I will for sure keep watching.

Some more great news came from JetBrains: “The Magnificent Seven is Released”. IntelliJ IDEA 7 (aka Selena) official release is available!

Really? Let me see NOW!

Wanna learn Object Orientation and Java?

9 Oct

Caelum has just released its FJ-11: Java and Object Oriented Programming course material.

It’s the first of many, since Caelum has already released some (others) written in Brazilian Portuguese. Just a matter of time.

The textbook was also the first product made with Tubaina. I’ve used it for a while to document some things and I can say it really deserves a look. Great tool!

Congrats folks!

Follow

Get every new post delivered to your Inbox.