HNHacker News
TopNewBestAskShowJobs

syntern

242 karma · joined September 15, 2012

submissionscomments
syntern··on Virtual DOM in Elm
Thank you both! I now have a much better understanding on how React works. I need to update the related performance benchmarks, it would be interesting to see how they compare side-by-side on our use cases.
syntern··on Virtual DOM in Elm
Thank you, this seems to do it for the innerText. Would it be too hard to apply it to the class attribute too? (I've tried to just copy the {} binding, but it doesn't work)
syntern··on Virtual DOM in Elm
As I am working on large tables, I may have a different goals than most UI developers are looking for. Diffing a huge structure is just a waste of time compared to not-diffing. Don't re-calculate things that you already know of, and in case of the table, you know pretty much upfront.

On the HTML markup, there are many valid reasons you may want to use non-TABLE based tables:

- it allows better rendering control for infinite scrolling (DOM reuse, re-positioning, detached view for sticky header and column)

- it allows you to have real (CSS style-able) row groups, or if your structure is hierarchical, it allows you a better control to create a treetable (reduced rendering time if you expand a node and insert a bunch of rows in the middle).

- it allows you to have multiple grid systems inside the table (e.g. a detail row may use up the entire row, and it may have its own table inside, which you'd like to synchronize across multiple detail rows). I guess this later benefit is just redressing the fact that you do need to implement an independent grid system anyway :)

syntern··on Virtual DOM in Elm
On the DOM reuse: could you help me out? I'm sure if I watch all the videos I may be able to figure it out, but I'd be interested in a trivial example. Let's assume I have the following structure (additional cells and rows are omitted for cleaner display, please assume we have 1000 rows and 20 cols):

    <div class="row">
      <div class="cell">
        <div class="align-left">
          Value.
        </div>
      </div>
    </div>
I want to reach the following:

    <div class="row">
      <div class="cell">
        <div class="align-center">
          Value B.
        </div>
      </div>
    </div>
What do I need to do in React that on updating the underlying data, only the innermost Element's class attribute and innerText would change, and the rest of the DOM will be kept intact?
syntern··on Virtual DOM in Elm
While each use case is different, I'd like to clarify a few things in my OP.

DOM reuse is not the same thing moving a DOM subtree to a different place. DOM reuse is e.g. getting an already-rendered table row, binding a new value to it, and modifying only the DOM properties in the complex DOM structure that actually did change. E.g. you modify only an Element.text deep in the first column, and a few other values in the other columns. Or maybe you need to do more, but all you do is delta. You don't just annotate a DOM structure with a key at row level, as it is closer to a hash of the DOM, not speaking of the data-dependent event handlers.

Calculating the DOM (virtual or not) is expensive, compared to not calculating at all. Creating a virtual DOM structure and not using it afterward creates GC pressure, compared to not creating at all. We are talking about optimizations in the millisecond range. A large table with complex components inside will reveal the impacts of these small things.

DOM coordination is not just making the DOM writes in one go. Complex components like to interact with each other, depending on their position and size on their page, and the changes in the underlying structure. They read calculated style values, and act upon those values, sometimes causing reflows. And if such things happen at scale, forced reflows may cripple the performance, and coordinating such changes may be more crucial than the framework you are choosing.

I am sure that people who are familiar with React may have their way get these stuff. I have looked at it, and I haven't seen it to happen automatically, while with Angular.dart, I get it without effort.

syntern··on Virtual DOM in Elm
Our performance benchmarks suggest that application performance is most certainly better off with: (a) DOM reuse (b) calculating expensive things only once (c) reducing GC pressure == not discarding/recreating things (d) coordinating actions that may trigger reflow. It is independent of what framework you are using.

My limited understanding of React is that it fails in (a), (b) and (c), and only limited measures can be applied to improve them. Re-creating the entire DOM on each update probably does not help. I have no information if (d) is possible with it.

I am using Angular.dart for a while now, and it can be used to get all of them in an optimal way.

Disclaimer: I'm working at Google.

syntern··on FBI: Google's driverless cars could be lethal weapons
You are ignoring the very low-tech possibility that criminals may just hire a good driver. Cheaper and more reliable than hacking a very complex system.
syntern··on Amazon snubs French free delivery ban with one-cent charge
Your remark sounds as if it is the company's fault to act like this.

1) The first part is exactly how the EU was designed: operate from one country, reduce your overhead. Maybe it is not Amazon's fault that they comply with the rules?

2) The second part is exactly how the Congress wanted its tax laws: if you bring money home, pay your taxes, if you don't, we are not involved. Maybe it is not Amazon's fault that they comply with the rules?

syntern··on Myths About Apple Design, From An Ex-Apple Designer
Family? Kids? Working at night and weekends quickly disappear once you have life in your work-life balance...
syntern··on Stormforger – Cloud-based Load Testing as a Service
Impressive. It's not their fault and they seem to be good and talented, but I can't stop thinking about a possible marketing line: "DDoS as a Service".
syntern··on Call me maybe: Elasticsearch
I'd rather say "destroyer of database myths".
syntern··on Call me maybe: Elasticsearch
I am not sure what difference it makes to have Riak or Riak CS for data storage, in the context of having a separate search cluster. Would you elaborate?
syntern··on Call me maybe: Elasticsearch
I have briefly checked the Riak yokozuna project, and it really looks great. Nevertheless, I'd prefer to have the data storage cluster and the search cluster to be separated (and I really like ElasticSearch too).

Edit: I shall add that the most interesting search problems are the ones where you need to join separate data sources, and in such cases it is not really the question of what kind of search solution you are using, rather what kind of async queue and data update you have. So the separated cluster is really about having a distributed queue between the 'data-master' and the 'search-master'.

syntern··on Call me maybe: Elasticsearch
TL;DR:

"Some people actually advocate using Elasticsearch as a primary data store; I think this is somewhat less than advisable at present."

"The good news is that Elasticsearch is a search engine, and you can often afford the loss of search results for a while."

My personal favorite solution would reliably channel data from a Riak cluster to an ES cluster. Anyone knows if there is something like that out there?

syntern··on Call me maybe: etcd and Consul
You may criticizing the author of its choice of words. You may disagree on what I state or don't state. But calling out people that they should add value, while all you do is trashing them is a bit controversial and it has no place here.

On the actual critique: if you have had worked with eventually consistent database, a 'Call' record's presence is really a great pun on the 'call me maybe' phrase. I'm really sorry if you don't appreciate that part either.

syntern··on Call me maybe: etcd and Consul
It is not about being funny, "call me maybe" is very relevant in the eventual consistency world. And If you know any other article by aphyr, you jump immediately to read it.
syntern··on US immigration didn't allow us to build a team here, so we built one in Colombia
It has nothing to do with the size of the country. The US sees immigration as a privilege offered to a lower being [note], while Singapore sees (qualified) immigration as a way forward.

[note]: This may have been true for a long time in the history. People were going to the US mainland because their conditions were bad enough, and anything would have been better elsewhere. I can understand that point of view, although e.g. my situation is on equal terms in the US vs my home country. However, I don't think it'll serve the US interest in the long run.

syntern··on US immigration didn't allow us to build a team here, so we built one in Colombia
2.5 years ago: I needed to provide both my renting agreement and my full employment contract to get a T-Mobile $80/m subscription for two, in the mid of Silicon Valley. The US is definitely making it harder than is should be :)

On the other hand, a close relative went to Singapore about the same time, and their immigration procedure was smooth, straighforward, everything in place, no barriers anywhere. Singapore wants to have qualified professionals, the US see them as numbers.

syntern··on US immigration didn't allow us to build a team here, so we built one in Colombia
I'm on H1B, and having interviewed with several companies in the Valley, I'm definitely not below market price.

And for the wifes part: my wife has the same qualification as I have (two MSc in CS/IT), yet, she is not allowed to work. Not even with the proposed change in the law, as it requires to have ongoing greencard process, which itself may take years. So if you think that those shobby cheap visa workers just bring their freeriders with them, you are very far away from the reality.

syntern··on US immigration didn't allow us to build a team here, so we built one in Colombia
Think of it this way: the talent will make its way to create a product, in or outside of the US. If the US immigration insist that the country doesn't need the talent, they just create a competition in another country.

Promoting US citizens just because they are US citizens may work for a while, but I doubt that it is a good long-term strategy.

syntern··on US immigration didn't allow us to build a team here, so we built one in Colombia
Not only that, the US lost their contribution to the local economy: they won't buy groceries, pay landlords or buy from the local car dealership. There is a huge missed opportunity there.

I just don't get why the US wouldn't want qualified workers to get in the US. Singapore had this lesson learned well.

Disclaimer: I'm on H1B myself.

syntern··on Static site generators focus on the wrong thing
This really hits home for me, because I'd love to use a CMS, but I just haven't found that is: (a) easy to use (b) easy to customize.

Just to single out a shortcomings I've recently found: multiple authors with multiple languages, defining short and long version of bio/tagline. The tagline is displayed at the article, which may be tagged with multiple contributors with different roles (author, translator, reviewer), while the author page displays the long version.

I've spent days to figure out what plugin/theme combination (Wordpress or Drupal) would enable me this single feature, and I couldn't figure it out.

Yesterday evening I gave up, and now I have <200 lines of code in Dart (using markdown and mustache), generating static pages that were annotated with metadata, doing just that. To be honest, I'd trade it any time for a decent CMS, I just can't find any.

syntern··on CockroachDB: A Scalable, Geo-Replicated, Transactional Datastore
You can always save the fact that a transaction was started, read the account's state (including the most recent transactions as an ordered list), calculate the validity of the item, and update the success/failure accordingly.

It is not the transaction itself that is hard, it is the network partition. E.g. what happens if two network partition approve transactions, that wouldn't have been accepted if there were no partitions.

syntern··on Static site generators focus on the wrong thing
While it may be shiny and hip to provide the latest and greatest news with very fast publishing cycles, I am not sure if this is for everyone.

Thoughtful articles require time to write and edit, reviewers will spend time on them. Re-running a static site generator to publish them is a fraction of the total time it requires to write a good article.

If, on the other hand, you are not in for quality, then yes, time to publish may be important for you.

syntern··on Open-Source Static Site Generators
I appreciate the answers here. I took a deep look, but it turns out, that every application requires almost the same amount of massaging, especially at the point where my other requirements kick in (category page extra content).

It seems that so far the best approach would be to write a dynamic web app that does what I want, and save the content with wget. Seriously, it seems easier than any of the hackery I need to do.

syntern··on Open-Source Static Site Generators
Is there any chance that you know a website with docpad (or anything else) that uses the above archive format? I've sample the showcase/example site, but I was not able to identify any.
syntern··on Open-Source Static Site Generators
Is there a static site generator with support for multiple authors and multiple languages?

e.g. with archive pages like /<author>/<lang>/<yyyy>/<mm>/ and category pages like /<lang>/<cat>/<subcat>/

I fail to see any. I've tried to configure many of the available generators, but no one seem to have the same itch I have.

syntern··on Making Your Writing Work Harder For You
Could you please provide more context on the extent of this discounting (esp. the measurable part)?
syntern··on Can This Web Be Saved? Mozilla Accepts DRM, and We All Lose
I'm wondering: what do you suggest to artists, how shall they make money on their work?
syntern··on Are you paid to look busy?
Pointing to a hobby is always a great way to silence these ("what are you doing?") questions.
← PreviousPage 3 of 5Next →