TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

<script type="text/coffeescript">

37 pointsby meddahover 15 years ago

7 comments

tr4nslatorover 15 years ago
I think this should probably point here:<p><a href="http://jashkenas.github.com/coffee-script/#scripts" rel="nofollow">http://jashkenas.github.com/coffee-script/#scripts</a><p>The salient point is that CoffeeScript now automatically compiles any code in a script tag with type text/coffeescript. Pretty cool.
jashkenasover 15 years ago
The gist of it is this. If you include the minified version of the CoffeeScript compiler on a webpage (43k, gzipped), it will compile and evaluate the inline coffeescripts on the page. That documentation site uses it to hook up the menu and the "Try CoffeeScript" demonstration in the toolbar.<p>If you view source, you'll see something along these lines:<p><pre><code> &#60;script type="text/coffeescript"&#62; window.repl_run: -&#62; try eval window.compiled_js catch error then alert error close_menus: -&#62; current_nav.removeClass 'active' if current_nav current_nav: null $(document.body).click -&#62; close_menus() &#60;/script&#62;</code></pre>
Freebytesover 15 years ago
While I like the concept of simplifying to increase productivity, I am not sure the source code of Coffeescript is any better than the original source code of JavaScript itself. The idea should be to simplify the languages, but as far as simplification is concerned, I think JavaScript is incredibly easy to learn and needs little simplification to its core syntax. There have been other projects, such as Dojo that make the complex tasks of JavaScript easier, and these I find incredibly useful, but to change the syntax of the language without significantly reducing the code size and complexity does not present a lot of value for the project. If this is expanded with one line AJAX scripts, the potential would be vastly improved for acceptance of this type of syntax replacement scheme.
bawatskiover 15 years ago
<a href="http://news.ycombinator.com/item?id=1014080" rel="nofollow">http://news.ycombinator.com/item?id=1014080</a>
评论 #1150251 未加载
francoisdevlinover 15 years ago
It's hard to take this seriously when the CSS gets in the way...
scorciapinoover 15 years ago
How does this compare with parenscript?
评论 #1150907 未加载
mahmudover 15 years ago
Any real languages targeting PHP as a backend? this piss poor excuse for a templating language is making my life harder than it needs to be.