HackerTrans
トップ新着トレンドコメント過去質問紹介求人

aptxkid

no profile record

投稿

I think DeWitt Clause is good for the users

twitter.com
1 ポイント·投稿者 aptxkid·5 年前·0 コメント

Fix Flickering Relay Switch caused by Nest Learning Thermostat

blog.the-pans.com
1 ポイント·投稿者 aptxkid·5 年前·0 コメント

Another reason why C++'s horrifying – initialization

twitter.com
2 ポイント·投稿者 aptxkid·5 年前·1 コメント

C++ memory model as a distributed system

blog.the-pans.com
1 ポイント·投稿者 aptxkid·5 年前·0 コメント

DNS – The First Distributed Database

blog.the-pans.com
3 ポイント·投稿者 aptxkid·5 年前·1 コメント

There’s nothing 100% in computer science

blog.the-pans.com
3 ポイント·投稿者 aptxkid·5 年前·0 コメント

How FoundationDB works and why it works

twitter.com
5 ポイント·投稿者 aptxkid·5 年前·0 コメント

Notes on the FoundationDB Paper with Additional Proof of Correctness

blog.the-pans.com
4 ポイント·投稿者 aptxkid·5 年前·0 コメント

Paxos vs. Quorum-Based Consistency

blog.the-pans.com
2 ポイント·投稿者 aptxkid·5 年前·0 コメント

Building Folly:Coro with GCC

blog.the-pans.com
1 ポイント·投稿者 aptxkid·5 年前·0 コメント

You don't need virtual base dtor with smart pointers

blog.the-pans.com
1 ポイント·投稿者 aptxkid·5 年前·0 コメント

How `Auto_increment` Works on MySQL

blog.the-pans.com
3 ポイント·投稿者 aptxkid·5 年前·0 コメント

MyRocks' repeatable read isolation is actually snapshot isolation

blog.the-pans.com
2 ポイント·投稿者 aptxkid·5 年前·0 コメント

C++ Map Lookup Memoization

blog.the-pans.com
2 ポイント·投稿者 aptxkid·5 年前·0 コメント

Type Erasure in C++ Explained

blog.the-pans.com
43 ポイント·投稿者 aptxkid·5 年前·51 コメント

Paxos Commit with Constraints

blog.the-pans.com
2 ポイント·投稿者 aptxkid·5 年前·0 コメント

How C++ typeid operator works

blog.the-pans.com
2 ポイント·投稿者 aptxkid·5 年前·0 コメント

コメント

aptxkid
·5 年前·議論
Personally I think it’s a great response and very well written. I didn’t jump on the congrats-Databricks wagon when the result first came out because of the weird front page comparison against snowflake. Both companies are doing great work. Focusing on building a better product for your customer is much more meaningful than making your competitor look bad.
aptxkid
·5 年前·議論
People have different skill sets. I bet there are engineers out there feeling more comfortable building a mobile app than a webapp.
aptxkid
·5 年前·議論
To understand how they are different, you need to know Default Initialization, Direct List Initialization, Aggregate Initialization, Default Member Initialization, List Initialization, Value Initialization, Zero Initialization. https://blog.the-pans.com/cpp-initialization/
aptxkid
·5 年前·議論
I agree that positive vs. negative is beside the point. But deadlock and positive feedback loop are different things though.
aptxkid
·5 年前·議論
It sounds more like deadlock than a positive feedback loop (also it’s weird that he calls it negative feedback loop).
aptxkid
·5 年前·議論
Proud to be a Bostonian!
aptxkid
·5 年前·議論
I wrote a post explaining FDB as well, which got retweeted by @FoundationDB https://mobile.twitter.com/aptxk1d/status/141786976657708237...

My post focuses on the correctness, proof of the correctness of FDB’s failure recovery, some of which is missing even from the paper itself.

Some of the paper authors reached out; and I corrected one issue on my blog post pointed out by one of the authors.
aptxkid
·5 年前·議論
It does, which one can argue it’s an implementation detail. The differences I mentioned above eg sharding, transaction boundary, secondary indices, etc. should be generally applicable to a non-relational db and not unique to TAO. I could be wrong though; as I know little about other graph dbs.

It would probably be more productive to compare RDB and Graph with certain workload examples (OLTP, OLAP, joins, scans, etc.).
aptxkid
·5 年前·議論
How a graph DB index the data to support this query?
aptxkid
·5 年前·議論
This is a great topic. I have been working on TAO for many years. I am not very familiar with other graph databases; I assume fundamentally they are more or less the same. Here are some differences between RDB and a graph db IMHO, 1. sharding and transaction boundary 2. Secondary index support 3. How “join” works (eg. give me a list of my friends who follows Justin Bieber)

You’re right that graph db is very easy to use a lot of the times.
aptxkid
·5 年前·議論
Marketing pitch doesn’t have to make sense to be successful. Andy is a marketing genius.
aptxkid
·5 年前·議論
Internet is a utility. Google/Facebook is not. It’s like water is utility but having ice delivered to you is a service not a utility.
aptxkid
·5 年前·議論
The tweet is certainly loaded, hence the point of this HN post lol.

First of all there's std::function, which uses Type Erasure https://blog.the-pans.com/type-erasure/. It means std::function<void(int)> can be the type of anything callable that takes an int and returns void (lambda, function pointer, object with operator() overload, etc.). Notice they are of different types! Hence Type Erasure.

How std::function manages its memory is poorly specified. But the standard at least states that if it's initialized from a function pointer (free, no capture), it's guaranteed that it won't allocate. https://en.cppreference.com/w/cpp/utility/functional/functio...

> When the target is a function pointer or a std::reference_wrapper, small object optimization is guaranteed, that is, these targets are always directly stored inside the std::function object, no dynamic allocation takes place.

In this case, std::function is trivially copyable. However, there's no way to know this at compile time, exactly because the type is erased in std::function.
aptxkid
·5 年前·議論
The answer is yes. And you can verify this by

checking std::is_trivially_copyable<FnPtrType>::value

using FnPtrType = int (*)(int) // for example
aptxkid
·5 年前·議論
folly::Function was added for exactly this reason I think https://github.com/facebook/folly/blob/master/folly/docs/Fun...
aptxkid
·5 年前·議論
LOL sure. I think it's arguably terrible behind the curtain. But the interface provided is pretty elegant IMO.
aptxkid
·5 年前·議論
Well if this is an improvement or not depends on the use case. E.g. std::function does exactly this.

What it achieves is exactly erasing the type (conforming to an affordance). The cost is definitely there. You pay vtable lookup when using std::function.
aptxkid
·5 年前·議論
However the Type Erasure described here doesn't need to know T even when you use it. E.g. it enables things like

for (auto x : vec) { x.foo(); }