HackerTrans
TopNewTrendsCommentsPastAskShowJobs

aptxkid

no profile record

Submissions

I think DeWitt Clause is good for the users

twitter.com
1 points·by aptxkid·5 anni fa·0 comments

Fix Flickering Relay Switch caused by Nest Learning Thermostat

blog.the-pans.com
1 points·by aptxkid·5 anni fa·0 comments

Another reason why C++'s horrifying – initialization

twitter.com
2 points·by aptxkid·5 anni fa·1 comments

C++ memory model as a distributed system

blog.the-pans.com
1 points·by aptxkid·5 anni fa·0 comments

DNS – The First Distributed Database

blog.the-pans.com
3 points·by aptxkid·5 anni fa·1 comments

There’s nothing 100% in computer science

blog.the-pans.com
3 points·by aptxkid·5 anni fa·0 comments

How FoundationDB works and why it works

twitter.com
5 points·by aptxkid·5 anni fa·0 comments

Notes on the FoundationDB Paper with Additional Proof of Correctness

blog.the-pans.com
4 points·by aptxkid·5 anni fa·0 comments

Paxos vs. Quorum-Based Consistency

blog.the-pans.com
2 points·by aptxkid·5 anni fa·0 comments

Building Folly:Coro with GCC

blog.the-pans.com
1 points·by aptxkid·5 anni fa·0 comments

You don't need virtual base dtor with smart pointers

blog.the-pans.com
1 points·by aptxkid·5 anni fa·0 comments

How `Auto_increment` Works on MySQL

blog.the-pans.com
3 points·by aptxkid·5 anni fa·0 comments

MyRocks' repeatable read isolation is actually snapshot isolation

blog.the-pans.com
2 points·by aptxkid·5 anni fa·0 comments

C++ Map Lookup Memoization

blog.the-pans.com
2 points·by aptxkid·5 anni fa·0 comments

Type Erasure in C++ Explained

blog.the-pans.com
43 points·by aptxkid·5 anni fa·51 comments

Paxos Commit with Constraints

blog.the-pans.com
2 points·by aptxkid·5 anni fa·0 comments

How C++ typeid operator works

blog.the-pans.com
2 points·by aptxkid·5 anni fa·0 comments

comments

aptxkid
·5 anni fa·discuss
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 anni fa·discuss
People have different skill sets. I bet there are engineers out there feeling more comfortable building a mobile app than a webapp.
aptxkid
·5 anni fa·discuss
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 anni fa·discuss
I agree that positive vs. negative is beside the point. But deadlock and positive feedback loop are different things though.
aptxkid
·5 anni fa·discuss
It sounds more like deadlock than a positive feedback loop (also it’s weird that he calls it negative feedback loop).
aptxkid
·5 anni fa·discuss
Proud to be a Bostonian!
aptxkid
·5 anni fa·discuss
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 anni fa·discuss
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 anni fa·discuss
How a graph DB index the data to support this query?
aptxkid
·5 anni fa·discuss
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 anni fa·discuss
Marketing pitch doesn’t have to make sense to be successful. Andy is a marketing genius.
aptxkid
·5 anni fa·discuss
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 anni fa·discuss
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 anni fa·discuss
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 anni fa·discuss
folly::Function was added for exactly this reason I think https://github.com/facebook/folly/blob/master/folly/docs/Fun...
aptxkid
·5 anni fa·discuss
LOL sure. I think it's arguably terrible behind the curtain. But the interface provided is pretty elegant IMO.
aptxkid
·5 anni fa·discuss
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 anni fa·discuss
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(); }