Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Fat arrows are one of the selling points for CoffeeScript, if you don't want to wait for ECMA6.


Doesn't fix the inefficiencies.


Recent versions of CoffeeScript greatly improved compilation of fat arrows.

This:

    x = (a) =>
      y = (b) =>
        z = (c) =>
          @q * a * b * c
Becomes this:

    var x,
      _this = this;

    x = function(a) {
      var y;
      return y = function(b) {
        var z;
        return z = function(c) {
          return _this.q * a * b * c;
        };
      };
    };
Instead of this:

    var x;
    var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
    x = __bind(function(a) {
      var y;
      return y = __bind(function(b) {
        var z;
        return z = __bind(function(c) {
          return this.q * a * b * c;
        }, this);
      }, this);
    }, this);


Taze is (presumably) talking about the inherent inefficiency of all those functions having prototypes.

(You know, the thing that was mentioned in the linked article?)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: