

(fab) - A pure javascript DSL for building async web apps - tr4nslator
http://www.fabjs.org/

======
tr4nslator
Hey all,

I just launched a dead-simple web framework on top of node.js. It uses
(abuses?) a lot of the dynamic nature of javascript to create a jQuery-
inspired DSL that's pure javascript, allowing you to create really concise web
apps like this:

    
    
      ( fab )
        ( "/time", function(){ return "the time is " + (new Date).toTimeString() } )
        ( "/date", function(){ return "the date is " + (new Date).toDateString() } )
      ( fab )
    

I'd love to hear any feedback from the folks here, so check it out and let me
know what you think.

~~~
mmastrac
I did a double-take looking at that syntax. I assume that fab (and all of the
other bracketed expressions) return functions that chain together? Pretty
ingenious. Plus you can detect the end of the chain when one of the methods is
passed in "fab" again.

I think I can say that this is the best (ab)use of the syntax I've ever seen,
well done. :)

~~~
tr4nslator
Yeah, a (fab) function just returns itself. It's like jQuery's chaining, but
using argument signatures instead of object methods to delegate work. The last
(fab) is just a way to indicate the chain is over so that a listener can be
returned, and has the additional benefit of making it look declarative.

------
cmelbye
What's the ratio of node.js web frameworks to sites that actually use them?

~~~
netghost
100:0 From what I can tell, but that being said, they're all coalescing into
something interesting.

~~~
cmelbye
Exactly what I'm thinking also. There are a plethora of frameworks, but they
all bring something cool to the table. I'm still wondering how viable it is
for web development, however (just because of how it hasn't really caught on
yet while having many chances to.)

~~~
thenduks
I think it hasn't caught on yet because there's no (last time I was around
anyway) solid, decent, recommended deployment strategies.

It was once suggested to me on IRC to use only _one_ instance of a node app
because it's "non-blocking"... I'm serious: "why would you need more than
one?".

Obviously you can deploy well enough using a monitoring app to keep up as many
workers as you want, but compared to stuff like passenger it's just not mature
enough.

------
uggedal
Unfortunate name: The Fabric Python deployment tool uses the _fab_ binary and
uses _fab_ files for configuring deployments: <http://docs.fabfile.org/>

~~~
jfager
Why should a javascript library defer to the abbreviated name of a minor
python-land command line tool?

~~~
theli0nheart
It's actually not that minor...

------
amix
Stuff like (fab) and CoffeeScript* show how easy it is to build on top of the
V8 and node.js platform. And these toy languages/frameworks also have great
perfomance given the non-blocking nature of node.js and the optimizations of
V8. Amazing and happy to see more of these projects :)

* <http://jashkenas.github.com/coffee-script/>

~~~
boucher
CoffeeScript is a language. It doesn't run natively on node.js, so I don't
really see the relationship here.

~~~
tr4nslator
Indeed, CoffeeScript was built on Ruby, and its REPL on Narwhal.

