6 ms·
Just wrote an API in CoffeeScript, using Node.js and Express. It was surprisingly enjoyable. I can see this ecosystem giving Rails/Sinatra/Django a real challe
by waxman 16y ago
Just wrote an API in CoffeeScript, using Node.js and Express.
It was surprisingly enjoyable. I can see this ecosystem giving Rails/Sinatra/Django a real challenge. CoffeeScript makes ssjs a lot easier once you get used to it, Node.js gives you free non-blocking/high concurrency, and Express, which just released 1.0, is quickly maturing into a really solid DSL/web framework.
I'm excited to see how this ssjs scene unfolds.
- jashkenas 16y agoI'm excited to see how the judicious use of JavaScript will evolve webapps beyond the Rails/Sinatra/Django paradigm, and allow you to share the code for your application between the client and the server. V8/Node.js is just the cherry on top: http://shootout.alioth.debian.org/u32/code-used-time-used-shapes.php http://shootout.alioth.debian.org/u32/code-used-time-used-sh... Thanks to the effort put in by the V8 team, JavaScript is now an order of magnitude closer to C speed than Ruby, Python, and Perl, and sits at the same tranche of performance as OCaml and Go.
- aaronblohowiak 16y agoI'm working on a project that will let you share the same view code between rails, node and browsers. email me if this is something that you'd like to hack on (or check my github)
- jashkenas 16y agoI presume you're referring to your EJSRB project: http://github.com/aaronblohowiak/ejsrb/ http://github.com/aaronblohowiak/ejsrb/ I think that the usual way to share views between different languages is to use a language-agnostic templating engine, like Mustache, or Liquid. How does EJSRB differ?
- aaronblohowiak 16y agoEJSRB is a full javascript context, and javascript is a language you probably already know. While our views are separate from controllers and models, they often need more advanced string manipulation than liquid or mustache give you. The fact that it is a full javascript context means you can define your own helpers, and have them still work on the client side. For instance, say you want to generate element ids from the json data. This belongs in a function that is accessible to your view layer, but you shouldn't have to program this twice (once for server, once for client.) AFAIK, there isn't a great way to accomplish this code sharing yet.
- FraaJad 16y agoThe really interesting language in that comparison is LuaJIT. It is faster and more concise than Javascript. It's sad that a mature, small, concise language like Lua doesn't have more traction outside niches.
- compay 16y agoI really enjoy working with Lua, though the opportunities have been infrequent. While Node.js looks like a wonderful piece of technology, every time I hear about it I feel a bit bitter that yet another opportunity to popularize Lua has been missed.
- pygy_ 16y agoLua fails in the "batteries included" domain. It is first and foremost developed as an extension language. Furthermore, they are not really trying to promote the language beyond its current niches. That said, there are good third party libraries and frameworks, and a Rubygems-like system called Lua Rocks.
- krakensden 16y agoyeah, but so does Javascript
- brehaut 16y agoBut the one battery that is included in JS makes it unavoidable, and most programmers (the kind that don't read HN or proggit) are the kind to not want to learn another language. If you have the choice between using the quirky thing you know or learning something else, its a good bet most programmers will choose to use the tool the know, quality of the respective tools be damned ;)
- krakensden 16y ago"Batteries included" refers to a comprehensive standard library, which Javascript doesn't have. The fact that Javascript is an in important feature in software that everyone runs is a whole different kind of advantage.
- mkramlich 16y agoI'd rather see Python move to the web client-side than JavaScript move to the web server-side. I would not kick JavaScript out of bed though.
- Scramblejams 16y agoYou checked out Pyjamas?
- mkramlich 16y agochecking it out now, thanks!
- drgath 16y agoJS absolutely has its faults, and you can hope all you want. But just by the simple fact that JavaScript is supported in every popular browser, and the browser is the largest application platform on the planet, means JS will soon to be the defacto standard language. Server & client-side.