News for hackers. Stuff that matters.
Re:JavaScript is Dead. Long Live JavaScript by rhizome on Sunday June 26, 2011 @10:01AM (#2698013)
I hope someone writes a decompiler for one of these supra-JS languages (not sure if CoffeeScript is Turing-complete) to run against existing Javascript codebases. It could well speed up adoption if a mass-tangle of JS can be boiled down to a more readable and understandable structure.
Re:JavaScript is Dead. Long Live JavaScript by apl on Sunday June 26, 2011 @11:08AM (#2698118)

  > not sure if CoffeeScript is Turing-complete
Wait, why wouldn't it be?
Re:JavaScript is Dead. Long Live JavaScript by Wilfred on Sunday June 26, 2011 @07:43PM (#2699482)
It is, though that's not very surprising. Here's a quick proof:

S-K combinators[1] are a Turing-complete subset of lambda calculus. Here's an implementation of them:

  k = (x) ->
    (y) -> x
  
  s = (x) ->
    (y) ->
      (z) -> x(z)(y(z))
1: http://en.wikipedia.org/wiki/SKI_combinator_calculus
Re:JavaScript is Dead. Long Live JavaScript by rhizome on Sunday June 26, 2011 @11:59AM (#2698267)
Heck if I know, I'm not CS trained.

Point being, CoffeeScript and other compilers would get a big boost if someone came out with a way to convert existing JS codebases into these new, more readable, more maintainable (as the story goes) representations.

Re:JavaScript is Dead. Long Live JavaScript by alecperkins on Sunday June 26, 2011 @12:16PM (#2698304)
js2cs - https://github.com/mindynamics/js2cs

Though I've found doing the conversion manually is a better way to learn CoffeeScript. Plus, it is a point for optimization and refactoring since CoffeeScript allows for doing certain things more easily or in better ways. The automated conversion only does so much.

Re:JavaScript is Dead. Long Live JavaScript by jarek-foksa on Sunday June 26, 2011 @04:24PM (#2698987)
Not sure if that's what you meant, but there is already JavaScript to CoffeeScript compiler: http://ricostacruz.com/js2coffee/
Re:JavaScript is Dead. Long Live JavaScript by Dn_Ab on Sunday June 26, 2011 @11:26AM (#2698167)
CoffeeScript allows loops no? Therefore it is turing complete (practically).
Re:JavaScript is Dead. Long Live JavaScript by Dn_Ab on Sunday June 26, 2011 @04:17PM (#2698968)
I was giving a simple metric by which to check turing completeness. If the language allows you to do infinite loops e.g. "while loops" then it is turing complete.
Re:JavaScript is Dead. Long Live JavaScript by Autre on Sunday June 26, 2011 @11:47AM (#2698233)
Practically you need some desicion making control structure (cond, if) and an emulation of read/write tape (arrays)
Re:JavaScript is Dead. Long Live JavaScript by Dn_Ab on Sunday June 26, 2011 @04:01PM (#2698940)
Well actually unbounded recursion and infinite memory is what is required for turing equivalence. Conditioning can be present in a non turing complete language. I added the practically because all computers on which language models are built on are finite. It is easier to get turing completeness than to ensure you haven't accidently allowed it to sneak in - as evinced in C++ templates.

http://en.wikipedia.org/wiki/Primitive_recursive_function#Co...