HNHacker News
TopNewBestAskShowJobs

wycats

6,755 karma · joined August 18, 2008

submissionscomments
wycats··on ES7 Proposal: The Pipeline Operator
I would find pipes to be very readable (but the single pipe operator is taken). The triangle isn't immediately an analogy to "unix pipes".
wycats··on ES7 Proposal: The Pipeline Operator
Can you elaborate on the rough seams between JavaScript and "full on functional"?

I'm not a believer in the FP vs. OO religion, and have historically been skeptical of the bind operator. That said, I think that both composition via objects and composition via functions have their place.

The pipeline operator attempts to make composition via functions more readable (left-to-right instead of right-to-left) and unless you think composition via functions is a bad idea in JS in all cases, I'm not sure what "full-on functional" has to do with it.

wycats··on ES7 Proposal: The Pipeline Operator
That said, the main counterargument to this proposal is that it's already possible to get "left to right" composition in userland without this operator, as underscore shows.

The main counterargument to "do it like underscore" is that underscore still ends up being an object whose methods are added to a prototype, not imported.

The benefit of the "pipeline" or "bind" approach is that you get left-to-right composition while still importing the names you're using.

wycats··on ES7 Proposal: The Pipeline Operator
I agree that a "functional" operator that uses `this` as the first argument is weird.

The main goal of all of these proposals is "left to right" composition when working with functions, and functions take parameters.

wycats··on ES7 Proposal: The Pipeline Operator
If we're going to do this operator, I would prefer a regular arrow:

    import { sortBy, filter, map } from 'array-like';

    let names = document.querySelectorAll('.entry')
      -> sortBy('title')
      -> filter(entry => entry.getAttribute('data-url') in whitelist)
      -> map(entry => entry.getAttribute('name');
I personally find this more readable than either the bind proposal (which looks too much like a property access, and not enough like a function call, to me) and the proposed pipeline operator, which doesn't have an immediate meaning to my eyes.
wycats··on A Way to Detect Bias
Makes sense. Fascinating.
wycats··on Rust Lifetimes
As the person who originally pushed extremely hard for all of the lifetime elision that we have today, I agree with you that this case is still too verbose.

That said, the reason it wasn't included in the original elision RFC (https://github.com/rust-lang/rfcs/pull/141) is that the design space here is a little bit more subtle than some of the cases that did make it.

In particular, I believe that it's important to know that a particular struct contains a borrowed value somewhere.

So let's say you could leave off the `'c` on the Sheep struct, and I wrote a struct containing `Sheep`:

    struct Flock {
        sheep: Vec<Sheep>
    }
Now, we have visually lost the fact that a borrowed value is stored inside the flock. Since data structures can get very recursive, this rapidly causes useful information about ownership to get lost.

What I'd like to see personally is:

    struct Sheep<&> {
        age: &i32
    }

    struct Flock<&> {
        sheep: Vec<Sheep>
    }
What this would mean is that you can always see, by looking at a struct definition, whether it contains borrowed values (anywhere recursively), but without the grotty need to define and wire up lifetime names.

I like the fact that this maintains the strong mental notion of ownership (the meaning of the & "operator" in Rust), but, as with normal elision, it eliminates the wiring that a good compiler should be able to do for you.

wycats··on A Way to Detect Bias
Indeed!
wycats··on A Way to Detect Bias
If that were the case, VCs should accept more companies-with-women, which would change the TOTAL mix of accepted candidates so that the women no longer overperformed.

The issue, interestingly, is that there are a lot of women (or biased-against group) between the median performance and 160% performance who are being rejected.

In other words, only the best women can get accepted, which means that above-median (but not superstars) are getting rejected, while many more above-median men are getting accepted.

This has the ring of truth to me (as pg says, it's the definition of bias).

wycats··on A Way to Detect Bias
The implication of this analysis of http://10years.firstround.com/ is that First Round is biased against founding teams with experience at Amazon, Facebook, Apple, Google, Microsoft or Twitter.

Can this be true?

wycats··on Larry Wall Unveils Perl 6.0.0
I dug up my original proposal from 2009, which eventually landed in Ruby 2.0: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/...
wycats··on Larry Wall Unveils Perl 6.0.0
For what it's worth, I completely agree with the "crappy alias" thing, and wrote a lot about this topic back when I was working on Rails full time (example: http://yehudakatz.com/2009/03/06/alias_method_chain-in-model...).

Ruby eventually added `prepend`, which I demonstrated upthread, and is a genuinely generic, in-language solution to the problem you're talking about.

wycats··on Larry Wall Unveils Perl 6.0.0
It's unnecessarily condescending, especially given that Ruby got `?` and `!` suffixes from Lisp, which far predates Ruby, and that Ruby itself is in many ways a descendent of Perl.
wycats··on Larry Wall Unveils Perl 6.0.0
For what it's worth, the `prepend` API in Ruby, which I advocated for back when I was working on Rails, works pretty nicely:

https://gist.github.com/wycats/0a354a96d00d47fa4e04

wycats··on Will Unix become the next MS-DOS? (1985) [video]
VMS + 1 = WNT
wycats··on Ember.js 1.13.0 and 2.0 Beta Released
> What happened to the server fast-boot thing? I was under the impression you guys wanted to ship it with 2.0; has that feature been scrapped / moved into a separate project altogether?

SEO-only FastBoot shipped in canary a while ago (as the `ember-application-visit` feature). It is designed to work with the FastBoot addon (https://github.com/tildeio/ember-cli-fastboot).

Rehydration, the big enchilada, depends heavily on the Glimmer work, and should begin momentarily.

> There was no mention of the deprecating changes to the initializer API (i.e. the splitting into instanceInitializer and vanilla initializer). Have we gone back to the old initializer API in 2.0?

We're sticking with the split-apart API we shipped a few releases ago. It's important to make FastBoot efficient with real-world addons.

> With the removal of action bubbling, do we now have to manually bubble up actions that start in some nested controller but gets handled in application route? For example, say you have an AdminUserController and it has an action that generates an ephemeral flash message, but you handle flash rendering in your application route. Do you now have to laboriously put an actions: { handleFlash { ... } } on every route along the way?

We're starting with more laborious (with services as an escape valve), but have some ideas for conventional situations where you could get away with less ceremony. Stay tuned! (by which I mean, there will be RFCs in the near future addressing this kind of issue).

wycats··on Common Ember.js Developer Mistakes
This is a pretty great enumeration of some common gotchas in Ember 1.x. Much of the effort ahead of Ember 2.x has centered around addressing precisely these gotchas, so I love how thorough your "Ember.js Mitigations" sections are.

Between the elimination of controllers (and therefore singleton controllers), and a reshaping of the `model` hook around a simpler "attributes for the top-level" concept we have coming, I am hopeful that most of these gotchas will be a thing of the past for anyone starting out in the Ember 2.x era.

We love seeing thoughtful, detailed lists like this, as they help to drive our priorities for improvements. Ember community: keep them coming!

wycats··on Last Task After Layoff at Disney: Train Foreign Replacements
H1Bs can be useful when there is a (single) person you would like to hire because of individual skills or talents, and plan to pay them the same as any other employee.

I've had this happen to me a handful of times in my career, and the H1B program was genuinely helpful there. Unfortunately, it is more often used to save money in situations like this article, making the program less useful for more legitimate situations.

wycats··on Last Task After Layoff at Disney: Train Foreign Replacements
Isn't this just straight-up illegal?

The H1B program disallows hiring foreign workers and paying them less than the equivalent rate for US workers. While there may be some debate about whether tech companies find ways to skirt the law, "we are laying off US workers to save money and replacing them with H1B workers" seems to flagrantly violate the law. No?

wycats··on The Transition to Ember 2.0 in Detail
Whoops: https://youtu.be/msS-3zqKKUI?t=51m5s
wycats··on The Transition to Ember 2.0 in Detail
What I mean specifically is that if you copy and paste some valid HTML from inside a body tag, it will work.

That is an explicit non-goal of JSX, and it shows.

wycats··on The Transition to Ember 2.0 in Detail
The changes were the only change we needed to make in 1.x to be compatible with FastBoot.

It sucks that new Ember CLI apps trigger the deprecation. We should get that fixed :)

wycats··on The Transition to Ember 2.0 in Detail
We talk about this a bunch in https://www.youtube.com/watch?v=qwIyenCaSXk

The TLDR is:

* We like templates, and were able to implement a more efficient algorithm using them (even more than the recent improvements in Babel).

* Compatibility is important to us, so HTMLBars was going to be a much better transition story for Ember 1.x than JSX.

* We prefer an HTML-centric templating story (copy/paste valid HTML and it works) over an XML strategy that requires camelCasing, className/htmlFor, etc.

* We optimized Glimmer for a hybrid (rerender + subscriptions to the model or service layer) model that can opportunistically avoid work based on knowledge we have from the whole stack.

wycats··on The Transition to Ember 2.0 in Detail
That's a completely fair question since large parts of this blog post are focused on major Ember 2.0 features, many of which were strongly inspired by React.

As you know, React describes itself as the V in MVC; in contrast, Ember is a complete front-end stack, including not only a model and service layer, but also a built-in router, integrated command-line tools, and an add-on ecosystem that takes advantage of that common set of assumptions.

It's also safe to say that the React community is still exploring the space of the application layer: multiple flavors of the original Flux architecture, Facebook's recent announcement of a successor (Relay), and different routing libraries that work well with React.

We believe that there are productivity benefits to having the community coalesce around a single stack, but we also believe that it's important to avoid stagnation. That's why Ember 2.0 is both focused on bringing in some of the great ideas that React has pioneered in the view layer, but maintains many other aspects of the 1.0 stack.

We make the changes compatibly on the 1.x branch with a clear transition plan so that we can bring along as many existing users as possible.

wycats··on How to Center in CSS
It's legitimate for people to point out that these fixes are not universally available, because many people still need to support old versions of IE.

That said, I think it's important for people to understand that many of the problems that people have canonically associated with the web's incompetence have been "solved" in standards for a number of years. There's a real difference between problems that remain unsolved in all browsers and problems that do not remain in the current versions of all browsers.

That difference may seem moot until the features are universally rolled out, but understanding that a solution to centering content rolled out in all major browsers (including Internet Explorer) three years ago may help us get past a sense of learned helplessness about the web.

Yes, improving the platform takes time, but by making browser vendors aware of the problems we face as web developers, things do get better.

wycats··on A standard for building APIs in JSON
One of the primary ways in which JSON API is different from HAL (or JSON-LD) is that it specifies both a format for data as well as a full protocol for fetching and manipulating that data.

Most of the trouble in building a JSON API comes not from deciding on the format, but in nailing down the precise requests and responses that handle common kinds of interactions. This became very clear to me as I worked on Ember Data.

wycats··on A standard for building APIs in JSON
One of my primary motivations when I started this (a few years ago now) was a straight forward representation of graphs of data (including bits of data without dedicated URLs), rather than trees of data.

Consider the case of a blog. Each blog post has many comments. Each post has an author, and each comment has an author. Some of those entities may have dedicated URLs, and others may not. Additionally, the authors are highly repetitive; you want to refer to them by identifier, not by embedding them.

Because a tree of data can be represented easily as a graph, but not vice versa, JSON API provides a straight-forward way to provide a list of records that are linked to each other. The goal is simple, straight-forward processing regardless of the shape of the graph.

wycats··on A standard for building APIs in JSON
I definitely can see why you'd see RC3 as a complete rewrite, but I don't understand why you'd feel that way about RC3. There were definitely changes, but they were much smaller and motivated by significant feedback by users who opened issues in response to RC2.

For example, RC2 mandated that all fields were dasherized. We made field names opaque in RC3.

At this point, we're pretty much nailing down tiny details and included this language with RC3:

    JSON API is at a third release candidate state. This means 
    that it is not yet stable, however, libraries intended to 
    work with 1.0 should implement this version of the 
    specification. We may make very small tweaks, but 
    everything is basically in place.
wycats··on A standard for building APIs in JSON
I hope not!
wycats··on A standard for building APIs in JSON
Thanks for the feedback. Personally, I feel like we nailed down the important changes earlier this month, and I agree that further churn at this point is likely to cause more harm than good.

For what it's worth, the issues you linked to are mostly about adding more rigor to possibly underspecified areas, not changing things that are already specified, but those things could easily be done after 1.0.

← PreviousPage 3 of 18Next →