News for hackers. Stuff that matters.
Re:TypeScripts Type System Is Turing Complete by pmiller2 on Tuesday August 01, 2017 @09:38PM (#14907200)
I believe "don't compile," in this context, is short for "their compilation doesn't halt." That seems like a bad thing to me. ;)
Re:TypeScripts Type System Is Turing Complete by mmalone on Tuesday August 01, 2017 @11:22PM (#14907689)
Not necessarily. You should be able to write a halting computation to determine whether a number is prime in a Turing complete language. It may be stupid hard to encode, or take a really long time to run, however.

The halting problem says that you can't write a halting decision procedure that takes an arbitrary program as input and determines whether that program halts, for any program. That doesn't mean that no programs halt. On the contrary, most programs in Turing complete languages obviously do halt and it's often trivial to tell if a particular program halts or not (e.g., `print "hello"` obviously halts). A Turing complete language can compute anything that is computable. So if the type system is Turing complete, you should be able to type a function that only takes primes... in theory.

Re:TypeScripts Type System Is Turing Complete by myusernameisok on Tuesday August 01, 2017 @10:28PM (#14907443)
I don't understand how this is fundamentally different from just doing it in regular javascript. You could write a javascript function that recurses forever on condition x: just write a function that calls itself with the same parameters unless condition x is met. How is it fundamentally different if the type system does it?
Re:TypeScripts Type System Is Turing Complete by shusson on Tuesday August 01, 2017 @10:47PM (#14907539)
> How is it fundamentally different if the type system does it?

runtime vs compile time. For example someone could write some TypeScript that would forever compile, which is intuitively unexpected when compiling.