4 ms·
CoffeeScript is interesting, but to be more so it shouldn't be limited to browser scripting. Until it doesn't become more general purpose i'll just stick to Pyt
by deleo 15y ago
CoffeeScript is interesting, but to be more so it shouldn't be limited to browser scripting. Until it doesn't become more general purpose i'll just stick to Python or Node.js
- phren0logy 15y agoYou can use it anywhere you use JavaScript, including Node.
- simpsond 15y agoIt's not limited to browser scripting. You can use it with node: https://github.com/sstephenson/node-coffee-project https://github.com/sstephenson/node-coffee-project
- TrevorBurnham 15y agoCoffeeScript and Node.js get along fantastically. When the "coffee-script" library is loaded, you can even "require('foo.coffee')" directly, making it easy to mix-and-match JavaScript and CoffeeScript files. Sam Stephenson, the creator of Prototype.js, has been doing all kinds of awesome things with CoffeeScript and Node.js. And there's a chapter of my book on it...
- deleo 15y agoSo how do you write a basic web server in CoffeeScript?
- jashkenas 15y agoThe Node.js "Hello World" web server: http = require 'http' server = http.createServer (req, res) -> res.writeHeader 200, 'Content-Type': 'text/plain' res.write 'Hello, World!' res.end() server.listen 3000 console.log "Server running at http://localhost:3000/"
- MostAwesomeDude 15y agoI'm obligated to respond with the same server in Twisted: from twisted.internet import reactor from twisted.web import resource, server class HelloWorldResource(resource.Resource): isLeaf = True def render_GET(self, request): return "Hello, World!" reactor.listenTCP(3000, server.Site(HelloWorldResource())) reactor.run()
- deleo 15y agoOT question. How healthy is the Twisted ecosystem these days? Besides it being stable and been around for years, how does the post-divmod horizon looking? Is the whole stack still being maintained?
- MostAwesomeDude 15y agoAll of the old Divmod team are still hacking Twisted. It's still maintained, everything gets taken care of, and there's really no doubt about Twisted's future.
- deleo 15y agoWell but this isn't written in CoffeeScript. This is what I was saying: CoffeeScript can work alongside Node.js but can't access the filesystem. It might be good in its own right for DOM scripting and such but it doesn't open any more doors than Javascript.
- stdbrouw 15y ago