Featured in
Architecture & Design

Mini-talks: The Machine Intelligence Landscape: A Venture Capital Perspective by David Beyer. The future of global, trustless transactions on the largest graph: blockchain by Olaf Carlson-Wee. Algorithms for Anti-Money Laundering by Richard Minerich.

Featured in
Operations & Infrastructure

Mini-talks: The Machine Intelligence Landscape: A Venture Capital Perspective by David Beyer. The future of global, trustless transactions on the largest graph: blockchain by Olaf Carlson-Wee. Algorithms for Anti-Money Laundering by Richard Minerich.

Featured in
Enterprise Architecture

Mini-talks: The Machine Intelligence Landscape: A Venture Capital Perspective by David Beyer. The future of global, trustless transactions on the largest graph: blockchain by Olaf Carlson-Wee. Algorithms for Anti-Money Laundering by Richard Minerich.

Community Questions TypeScript and Compile-to-JavaScript Languages

Microsoft generated a stir in the JavaScript community with the introduction of its programming language TypeScript. This recent offering from Redmond renders JavaScript by interpreting a proprietary, type safe language, allowing a developer to leverage JavaScript functionality while reducing the need to master JavaScript itself. The software community has had mixed reactions to this new language, with some embracing TypeScript’s way of writing type safe JavaScript and others questioning the existence of the entire compile-to-JavaScript genre.

Initially, much fanfare from .Net-friendly news sources such as DevProConnections accompanied TypeScript’s release. Michael K. Campbell, a regular contributor to the DevProConnections website, offered a fair, but positive stance on TypeScript’s future. Campbell concludes that this style of application development represents the logical maturation of JavaScript, and TypeScript should be seen as a formal announcement to safely take JavaScript from the browser and introduce it to the desktop and back-end services.

I can't help but think there's a bright future in store for TypeScript. I'm particularly excited by TypeScript's future when I think about how web development trends are moving increasingly toward architectures that heavily leverage JavaScript for dynamic in-page rendering against API-enabled back-end web servers such as Microsoft's ASP.NET Web API framework.

Developers wishing to take advantage of JavaScript without having to invest a significant amount of time have found other reasons beyond type safety to adopt TypeScript. TypeScript offers a class-based object-oriented programming model which appeals to developers of C# and Java-style languages. Danny Tuppeny, a Cheshire, England based software developer, writes that this feature of TypeScript allows him to leverage JavaScript without having to master the underpinnings of the prototype-based object-oriented language.

I don't know a huge amount of Assembly or IL. Sure, there might be situations where knowing more of them would be useful, but is it really worth the time investment when I could instead be improving my C#/other skills that I use every single day?

Does it matter if I can't type JavaScript without looking it up to hook up subclass prototypes in JavaScript if TypeScript can do it for me? No. Does it help if I understand the generated code? Sure. Is it a requirement? No. All that matters is I understand how it behaves and any limitations of it. The same way I don't need to understand 100% of the IL generated when I write C#.

However, TypeScript is only the most recent entrant into the genre of compile-to-JavaScript development languages. Dart was introduced last year as a way to circumvent the shortcomings of JavaScript and enable a more robust and productive development experience on the web. While both languages share a more robust programming syntax than JavaScript, including type safety, the similarities between the two languages stop far short of having either one labeled a clone of the other language.

Scott Hanselman, a Microsoft Architect in Web Developer Tools, not only promotes the case for TypeScript, but also questions the need to compare it to Dart, noting that they are developed in a different manner and are fundamentally different at their core.

People have compared TypeScript to Dart. That's comparing apples to carburetors. TypeScript builds on JavaScript so there's no JS interop issues. Dart is a native virtual machine written from scratch. Dart interops with JavaScript...but it's not JS. It doesn't even use the JavaScript number type for example.

Shannon -jj Behrens, a developer on the Dart team, furthers this distinction by welcoming TypeScript to the family of compile-to-Java languages. The Dart team sees TypeScript as an adopter of older and buggier technology due to its reliance on JavaScript, a competitor which they believe they will soon surpass. This may explain their encouragement of Microsoft to continue to build around the JavaScript codebase.

Now that we’ve had a chance to take a look at TypeScript, the Dart team would like to welcome the TypeScript team to the neighborhood. If you already have a large JavaScript codebase, and if you already use Visual Studio, we think that TypeScript could be a great addition to your project.

I see compile-to-JavaScript languages as a barrier to that goal. We should be convincing more people to learn JavaScript rather than giving them more options to not write JavaScript. I often wonder what would happen if all of the teams and companies who spent time, energy, personnel, and money to develop these alternatives instead used those resources on improving JavaScript and teaching it.

Marco van Hylckama, senior UI prototyper for Yahoo, is echoes the feelings of many JavaScript developers who would prefer the industry to focus on existing technologies simply leave JavaScript development to the JavaScript language itself. Via his Twitter account, Hylckama questions the need of TypeScript and the entire category of compile-to-JavaScript languages.

Approaching the topic from a different angle, the corporate Twitter account for Neave Interactive, a London based UI development firm, questions whether learning JavaScript is difficult enough to warrant its replacement or abstraction via compile-to-JavaScript alternatives.

Is JavaScript really that scary? CoffeeScript, Dart, and now TypeScript typescriptlang.org @TypeScriptLang” increase

While all of its proponents, detractors, and competitors are voicing their opinions, it cannot be disputed that TypeScript has entered an increasingly popular area of software development. JavaScript is now being considered as a viable solution for not only front-end web experience, but also for creating desktop applications, and reliable server-side products as well. Mark Johnson, an author for OSS Watch, notes how this swell of opportunity for JavaScript will likely reinforce the need for more JavaScript developers and as this need rises, the adoption of languages such as TypeScript and Dart will grow accordingly.

With the plethora of tools for writing cross-platform games and apps with JavaScript, as well as platforms such as Windows 8 and Open WebOS bringing web technologies to the desktop, demand for the features offered by TypeScript is only going to increase.

Its not just a compiler-flavour-of-the-month if it gives you much greater tooling support when editing the source code in an IDE. Though until IntelliJ supports TypeScript, only windows users will benefit from the nicer IDE tooling :(

Re: Just program in Assembly language instead of compiling down
by
Russell Leggett

For browsers that don't yet support Source Maps, the generated JavaScript code is pretty clean and easy to debug - try it out.

The whole point of TypeScript is its based on JavaScript; it just adds optional typing, classes & modules - so the generated JavaScript isn't really much different to the source.

Yes, and I think that's of key importance. This is much less a compilation to assembly as it is a superset where *most* of the features being added will *also be added to javascript in the next version* combined with optional type annotations. Anyone who knows TypeScript should also know JavaScript, and anyone serious about JavaScript should be thinking about getting familiar with the additions coming into ES6 - TypeScript just lets you play with them early.

To make a better analogy, looking at the output of TypeScript is not like looking at assembly out put from another language, its more like looking at the output of the Less CSS compiler. Less is a superset of CSS with some extra features. It shouldn't be a big deal to look at the output.

The problem with what Nicholas C. Zakas says about spending time learning JS is that the issue is NOT learning it. It is DEALING with it. I want to spend my time solving business problems not looking up how to us an JS API and then trying to figure out why the examples are wrong (or wrong for my situation).