Hacker News new | ask | show | jobs
by ixtraz 4743 days ago
It seems to be very close to CoffeeScript, but without this ugly Ruby syntax (for me).
2 comments

It's completely unrelated to CoffeeScript, as CS does practically no static analysis and generally CS does almost nothing more than pure JS. What it does is it translates some keywords to a chunks of JavaScript code. If JS had macros - sweet.js! - Coffee would be completely unneeded.

TypeScript is entirely different thing. It adds a layer of static analysis to the language, which does not end in the code that actually runs. Generally everything you type in Coffee has an equivalent in compiled JS; it is not so with TypeScript, where you can write pages of code which won't be visible in the compiled JS.

CS and TS have different goals and are different things, and the only thing they have in common is that they both "transpile"/compile some language to another. Hardly a similarity that makes them very close.

Actually I would appreciate TypeScript implementation on top of Coffee (or the other way around, whichever would be simpler). There is a dialect of CS that supports contracts (you really, really should start using contracts anyway), but that's yet another thing that cannot hope to replace static verification of certain things in programs.

You're absolutely right. I'm an C# dev who switched to JavaScript stack and using TypeScript already for 5-6 months. It was just a first-look description for the TypeScript.

Btw, TypeScript also aiming to fix context problem so in callbacks 'this' keyword is always related to parent class.

`this` being dynamically bound is a feature, it's broken as intended. You can always `bind` a function to remedy this if it's a problem for you.
Why would it be a feature? It is almost never the desired outcome, thus a terrible default.
I disagree. 1. Coffeescript is far from ugly, and also not particularly similar to Ruby :p 2. Typescript includes types and brackets. Coffeescript does not. 3. Icedcoffescript includes async/defer keywords. I include this last point only as a result of a personal perspective that if you're going to use coffeescript, you might as well use icedcoffeescript.
I'm sorry, I'm not a Ruby developer and hope never would :) From my prospect - all languages, which has no brackets are ugly and simular to ruby.

Btw, based on typescript discussions, they are going to implement async/await functionality too.

It's all what you're used to reading. If all you've been staring at are various curly-brace languages then of course you're going to prefer that.

I was primarily a curly-brace developer for 10 years, but changed my mind after a few years of Python, Ruby and Lua. Now I actually think these languages look better than the curly-brace family.

For me, the stereotypical CoffeeScript experience applies: Easy to write, hard to read.
async/await is on their roadmap, though I'd estimate about a year before it'll be in a stable version (I wouldn't be surprised if it'll be available on a feature branch much sooner, but with lower expectation of stability).