News for hackers. Stuff that matters.
Re:Sinatra clone in Scala by 10ren on Sunday May 31, 2009 @06:43AM (#634607)
Is the whole thing really just the one file (110 lines)? http://github.com/alandipert/step/blob/42cee9ecd360205def359... I know it describes itself as "tiny", and sinatra is also tiny, but that seems... small. (I don't know anything about Scala - is it especially concise?)

I like how the HTML seems to be a first-class datatype in the example (is that a Scala thing? I'd better do some research):

    get("/date/:year/:month/:day") {
      <ul>
        <li>Year: {params("year")}</li>
        <li>Month: {params("month")}</li>
        <li>Day: {params("day")}</li>
      </ul>
  }
Re:Sinatra clone in Scala by wooby on Sunday May 31, 2009 @06:49AM (#634611)
Yeah it's pretty small. With Scala you basically get free HTML templating because of XML literal support. It's missing a lot of Sinatra stuff though: 'splat' and regex URI pattern matching, file uploads, sessions...
Re:Sinatra clone in Scala by vladev on Sunday May 31, 2009 @08:20AM (#634647)
Maybe leveraging pattern matching could improve.

Actually - we can be able to implement our own methods get(), post(), etc. via pattern matching... So inspiring - on my way to fork it. ;)