Jump to content

Comparision of languages that compiles to Javascript (TypeScript, CoffeeScript, DART etc.)


Quetzacotl
 Share

Recommended Posts

Lately I've seen many programmers switching from pure javascript to languages that compiles to it. http://tech.dropbox.com/2012/09/dropbox-dives-into-coffeescript/

 

I would like to know which one is the best for now and that rewriting my js code is worth it.

 

I have already wrote large part of my JS framework that is focused on networking (i.e. WebSockets).

How much would I gain by switiching to TypeScript or CoffeeScript? 

On TypeScript site i can't find list of features it adds.

Does it have unittesting library built in? Does it have module managment (imports) so I won't have to use requireJS? What about debugging code?

How deployment works? There is a lot of questions I have and I'm a bit confused.

Link to comment
Share on other sites

Well about TypeScript this is pretty good info about features ;)

 

http://www.typescriptlang.org/Content/TypeScript%20Language%20Specification.pdf

 

Just check the content table.

 

Also imo TypeScript is the least overload and it's like some javascritp from the future (as they go very close to ecma script specification).

Also VisualStudio is a one cool IDE

 

Dart, is a little more obscure and has nothing to do with javascript it's a new language.

CoffeScript is not my cup of Tea from all i saw.

So these are my two cents.

Link to comment
Share on other sites

for me TypeScript is the best, but this is a personal choice.

 

as Mike said, it's close to future ecma specifications, and Visual Studio is an awesome IDE for webdev !

 

typescript also output very clean JS so you can allways switch back tu pure JS if you want.

 

coffeescript is also very good especially for people used to code in puthon or ruby, I stopped using it because I didn't find any IDE with same features as VS2012

Link to comment
Share on other sites

I always stick by just using JavaScript with libraries like jQuery/Underscore etc. to make things easier. Compiling from another language to JavaScript just seems silly and redundant. In my mind compilation should always go from a higher level language to a lower one, and in many cases JS is a pretty high level language.

 

Also, what is your concern with RequireJS -- why would you want to not use it? I love it. I'd take a look at Jasmine for unit testing (it says BDD but, eh), it can work with RequireJS as well. You can also hook it up to more complex systems like Karma for browser/live dom testing. RequireJS with r.js will take care of your minification and deployment process.

Link to comment
Share on other sites

Well, there will be no language-y native importing/requiring before ESharmony, so I would stick to requireJS. I share @PixelAces opinion. Whilst TypeScript looks kind of interesting, I didn't see the need to invest time in that thing. And don't get me started with that nonsense named CoffeScript... :)

Link to comment
Share on other sites

requireJS is fine but I would like to have something that is a part of language basic library...Same for unit testing.

 

What spurred your interest to switch to a language that compiles to JavaScript? RequireJs nicely takes care of imports and compilation without changing codebase. Also, I'm not aware of any language that has unit testing as a built-in feature, unless you count setting up a bunch of if statements, at which point you are already on your way to writing a separate library. To me it seems like you are looking for reasons to switch your codebase (which is never the right thing to do) versus running into a problem and looking for a better solution. There is nothing wrong with looking at other options, but it looks like you already have a good base in JS with your socket stuff, and if you can get that down you aren't going to gain anything from compiled JS besides bloated code.

 

 

And don't get me started with that nonsense named CoffeScript... :)

 

:lol:

Link to comment
Share on other sites

What spurred your interest to switch to a language that compiles to JavaScript? 

I'm just looking for something more concise. If JS was good then there would not be so many new languages that want to replace it.

I come from C++, then I switched to Python and I fell in love with it, now I would like to switch to something with similiar approach, but for web frontend.

Also, I'm not aware of any language that has unit testing as a built-in feature, unless you count setting up a bunch of if statements, at which point you are already on your way to writing a separate library.

I was writing about basic library. Of course there is no language that unittest is a part of syntax.

 

I'm asking only if I would gain something significant for development process, like when I switched from C++ to Python, if no then I won't. :)

 

 

[disclaimer: I work on the Dart team.]

 

You may want to check out http://dartgamedevs.org, a resource for Dart game developers.

 

If you're curious about Dart, a while ago I put this comparison together between TypeScript and Dart: http://programmers.stackexchange.com/questions/167070/differences-between-typescript-and-dart

 

Hope that helps!

Thanks, I'll read it, but unfortunately, for now I heard only bad opinions about Dart :\

Link to comment
Share on other sites

I'm just looking for something more concise. If JS was good then there would not be so many new languages that want to replace it.

I come from C++, then I switched to Python and I fell in love with it, now I would like to switch to something with similiar approach, but for web frontend.

I was writing about basic library. Of course there is no language that unittest is a part of syntax.

 

I'm asking only if I would gain something significant for development process, like when I switched from C++ to Python, if no then I won't. :)

 

 

Thanks, I'll read it, but unfortunately, for now I heard only bad opinions about Dart :\

 

Time to form your own opinion! :)

Link to comment
Share on other sites

Currently I am not in need of another abstration layer when it comes to coding for the  browser platform (ie javascript). However I see of course the many advantages languages like dart/typescript  can offer during development.

 

But just judging from my poor experiences - I would first tend to use dart instead of typescript. Maybe because I would choose Google over M$.

 

Anyway - would be interested to have more opinions about this. 
Link to comment
Share on other sites

Currently I am not in need of another abstration layer when it comes to coding for the  browser platform (ie javascript). However I see of course the many advantages languages like dart/typescript  can offer during development.
 
But just judging from my poor experiences - I would first tend to use dart instead of typescript. Maybe because I would choose Google over M$.
 
Anyway - would be interested to have more opinions about this. 

 

You may be interested in Source Maps, which bridge the source language (like Dart, Closure, or GWT) to JavaScript. 

 

Here is IntelliJ w/ source maps: 

 

Here is Dart Editor with source maps: 

 

Source Maps really help with the "level of indirection" problem.

Link to comment
Share on other sites

I'm just looking for something more concise. If JS was good then there would not be so many new languages that want to replace it.

I come from C++, then I switched to Python and I fell in love with it, now I would like to switch to something with similiar approach, but for web frontend.

I was writing about basic library. Of course there is no language that unittest is a part of syntax.

 

I'm asking only if I would gain something significant for development process, like when I switched from C++ to Python, if no then I won't. :)

 

 

Thanks, I'll read it, but unfortunately, for now I heard only bad opinions about Dart :\

Check out D for a nice language that has unittest built in.

Regarding Dart - I have been playing with and really enjoying it. I come from C++ and Python as well. I've not been able to get traction with javascript and my hope is the momentum with Dart continues. I have not heard much bad about Dart. So far I am impressed - but then with each new language I try I find I'm attracted for some reason or other - maybe just to try something new.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...