

&lt;script type="text/coffeescript"&gt; - meddah
http://jashkenas.github.com/coffee-script

======
tr4nslator
I think this should probably point here:

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

The salient point is that CoffeeScript now automatically compiles any code in
a script tag with type text/coffeescript. Pretty cool.

------
jashkenas
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.

If you view source, you'll see something along these lines:

    
    
        <script type="text/coffeescript">
    
          window.repl_run: ->
            try
              eval window.compiled_js
            catch error then alert error
    
          close_menus: ->
            current_nav.removeClass 'active' if current_nav
            current_nav: null
    
          $(document.body).click -> close_menus()
    
        </script>

------
Freebytes
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.

------
bawatski
<http://news.ycombinator.com/item?id=1014080>

~~~
tlrobinson
I think the OP was pointing out that you can now use CoffeeScript in <script>
tags.

I did something like this for Objective-J awhile back, but it's not
particularly useful ([http://github.com/tlrobinson/cappuccino-
experiments/blob/mas...](http://github.com/tlrobinson/cappuccino-
experiments/blob/master/Inline/inline.js))

~~~
jashkenas
Yep, it's not particularly useful -- there's no case I can think of where you
wouldn't be better off compiling your scripts to JavaScript first.

But if you just want to play with it, or prototype a web page, it's fun for
that.

------
francoisdevlin
It's hard to take this seriously when the CSS gets in the way...

------
scorciapino
How does this compare with parenscript?

~~~
gregwebs
much fewer parens :) Seriously, though- no macros here.

------
mahmud
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.

