Member project spotlight: Frog by Jose Donizetti

06 Jun 2014 — By Marc — In spotlight

Jose Donizetti

Jose Donizetti, a member of The Great Code Club, recently created his first template language ever: Frog. The syntax is simple. But most of all, the implementation code is very elegant, minimal and easy to follow.

Compare the code of Jose’s template engine to others out there, you’ll realize that this is quite a feat to implement a full template language in such a limited amount of code. And keep in mind, it was Jose’s first project of this kind! How awesome is that? Truly impressive work!

html {
  head {
    title "My App"
  }

  body.css_class {
    h1.css_class "My App"

    section#id.class1.class2 {
      "This is cool"

      // Ruby code
      - for i in 0..2

        // Expressions
        p#css_id(style="color:blue") #{i}

      - end
    }
  }
}

I asked him a few questions about Frog and his experience with the club.

What is Frog and how is it different from other template languages?

Frog is an HTML template language. The difference from others template languages like Haml, Slim is that it is more opinionated in it syntax. The syntax implementation is pushing towards a mix of languages I know myself (ruby, golang, java).

What inspired you to create Frog?

As a member of The Great Code Club, there was a month where the focus project was involving parsers. Several different projects were implemented to exercise it, and one of them was a template language using Node. Also eventually there are some interviews posted on the club forum, one of them was with Alexis Sellier, creator of Less. Alexis says in the interview that most of his projects represents a specific way he wants to work and no project out there allows it. My inspiration for Frog was the same thing, I like Haml, and Slim a lot but using curly braces to limit blocks of code has always been something natural to me, probably because I’ve worked with Java for several years.

What have you learned while creating Frog?

About lexers and parsers, different ways of doing it, top-down, bottom-up, recursive descent parser, LL, LR grammars, and whether to hand write one or use a generator like Raac would make sense or not.

What would you say to someone who wants to start a side-project but don’t know where to start or stay motivated?

Well, it’s very important to work on subjects you like, and more important break it down to small projects so you can learn while having something working. Trying to tackle big projects and having nothing working for a long period is usually bad for motivation. I’ve always enjoyed projects where the business logic is related to computer science. All my ideas are usually related to it, but for a long time I would not apply my advice to break the project down to smaller pieces, so I would get demotivated after some time. But I’ve been improving on it, specially after joined the club, all the projects we work on are a great lesson on how to get an big problem, break it down to work on it so you are learning, delivering, and always able to extend it if desired.

Did the Great Code Club help you with your project? How?

Definitely! In many ways, but the one most important for me is how the community motivates me, everyone is working on awesome projects, and willing to help anyone trying to do the same, no matter which programming language or project idea.

Thanks to Jose for an awesome project also for inspiring and helping everyone in the club!