Server-side Sammy, on Jack

4 views
Skip to first unread message

britg

unread,
Jun 23, 2009, 8:11:54 PM6/23/09
to Sammy.js
Hey Aaron, what are your thoughts on what it would take or what it
would look like to build a server-side Sammy as a Jack based framework
(http://jackjs.org).

Or does a project like this already exist and I don't know about it?

I realize not much of the client Sammy would be usable, but I think if
someone were to make a Sinatra-esque framework in server-side
javascript, it would make sense to fall under the Sammy name.

Do you agree, or would you the server-side analog be unrelated?

Aaron Quint

unread,
Jun 23, 2009, 11:51:09 PM6/23/09
to sam...@googlegroups.com
Hey Brit

Its really funny you should mention this - I actually just started
playing around with making Sammy server side this weekend. I didnt
really get anywhere (besides just some simple tests) but I'm really
excited by the idea. I checked out Jack and it seemed pretty neat (and
there seems to be a bunch of projects around it) but I was more drawn
to the Node project:
http://tinyclouds.org/node/
Whats cool about node is
- its C and V8 based (instead of Java/Rhino) which means its a little
easier to install and get up and running quickly
- its extreeeeemly fast.
- its really a different model of request handling which seems more
apt for JS. Instead of being rack like, its truly evented. The
potential of having long running requests that 'push' events back to a
client side sammy app is really intriguing to me.

That said, I havent really gauged how much work it would be to port
Sammy. I would love some help/feedback and if you want to give a stab
at implementing it on Jack/Narwhal I'm happy to help however I can.

Something I was thinking about was instead of creating an entirely
different framework, maybe giving the ability to 'mount' sammy apps in
different environments, something like

var app = function() {

get('/', function() { ... })
....
}

// client side
$.sammy(app).run()

// server side

sammy.node(app)
// or
sammy.jack(app)

The basic idea being, that there could be a basic top level spec of
what methods a sammy implementation would need to have/implement. I
dont know If I like the idea of an 'abstract' class. I'm sure theres a
bunch of code that could be shared by all of them, though obviously
relying on the DOM isnt possible on the server.

I'd love to brainstorm about this more, lets keep this thread going.
--AQ




Aaron Quint
http://www.quirkey.com

britg

unread,
Jun 24, 2009, 2:47:33 PM6/24/09
to Sammy.js
Interesting, I will have to check out Node. If I understand your
description correctly, node seems to built from the ground up to fit
the comet/long-polling web, which I would agree is very intriguing.

My interest in Jack stems from wanting to work in server-side
javascript on Google App Engine (Rhino on Java, etc) and their
datastore.

But, that being said, I do like the thought of shared events client
side and server side through sammy... i.e. triggering a todo-list
checkbox check state through the browser or through some logic on the
server-side.

Yeah, let me take a look at node, but I am all for unification of a
client/server side unification of Sammy if it makes sense. Do share
your finding with your server-side test on github sometime.

Brit
> Aaron Quinthttp://www.quirkey.com

britg

unread,
Jul 1, 2009, 1:32:20 PM7/1/09
to Sammy.js
Had a chance to check out Node, absolutely love it! I did come
accross this project which still appears to be in its infancy:
http://github.com/visionmedia/express/tree/master

It appears to be Sinatra/Sammy-esque in nature.

On Jun 23, 10:51 pm, Aaron Quint <aa...@quirkey.com> wrote:
> Aaron Quinthttp://www.quirkey.com

Aaron Quint

unread,
Jul 1, 2009, 1:40:49 PM7/1/09
to sam...@googlegroups.com
Thanks for the link, I figured someone was already working on this.
--AQ

Aaron Quint
http://www.quirkey.com



Reply all
Reply to author
Forward
0 new messages