3,566 karma · joined May 8, 2013 (13y ago) · 1,534 submissions
comment 3y ago · link · parent
If you have a two dimensional array A (1..N X 1..M), then flattening it becomes A[i][j] = flat[i + (j-1) * N]
Continuing to higher dimensions it only gets uglier.
0-based arrays are far simpler. When flattening A (0..N-1 X 0..M-1) A[i][j] becomes flat[i + N * j].
It's completely analogous to how our base-10 positional system works. Each digit doesn't start at 1, they start at 0, which is why 237 is just 2*10^2 + 3*10^1 + 7*10^0.
ADD: TIL HN supports escaping the astrix.
comment 3y ago · link · parent
When I took driving lesson, my instructor painted a vivid picture of the consequence of a crash while transporting heavy unsecured objects behind me - that lesson has stayed with me for over 30 years.
comment 3y ago · link · parent
ADD: it's unlikely the amount of cache and more likely their quite long L2 hit latency which is a lot longer (in wall-time) than, say a Cortex-A72.
comment 3y ago · link · parent
* GRIN [1] - arguably a breakthrough in FP compilation; there are several implementation based on this
* HVM [2] - parallel optimal reduction. The results are very impressive.
[1] https://link.springer.com/chapter/10.1007/3-540-63237-9_19
comment 3y ago · link · parent
In fairness, the Cortex-A72 in the Raspberry Pi is the nth iteration of Arm cores whereas the C910 is essentially the 1st generation (the C906 is completely different and in-order). I wouldn't make too many conclusions based on this about the future of RISC-V and its implementations, but I'm looking forward to the next wave of higher performing cores coming to market.
comment 3y ago · link · parent
comment 3y ago · link · parent
So C was [mostly] great, but today we have better options.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
ADD: I would also welcome a display-free version that could be used as a hackable BLE keyboard.
comment 3y ago · link · parent
All modern caches PIPT, VIPT, or even VIVT must work with this scheme as it's semantically transparent to virtual memory. The performance of line-crossing accesses is a totally different issue and I would never used this "trick".
comment 3y ago · link · parent
The back pressure is handled with a credit scheme and the producer gets an updated copy of most recently-know consumer read counter with every completion message back.
Using this scheme you can achieve the optimal performance with just a single cache line of traffic for each cache-line sized message.
Unfortunately I haven't found a SPSC Rust crate that does this, but https://github.com/polyfractal/bounded-spsc-queue [abandoned] comes close.
comment 3y ago · link · parent
Bob Swan clearly wasn't the guy that could fix all this. Pat finally got the job he always wanted (he left for VMware because he didn't get it originally), but Intel is ship that's hard to turn (floating iceberg might be a more fitting analogy).
I'm rooting for Intel; I have friends there and competition is good for us consumers. Also, Intel is a friend of open source.
comment 3y ago · link · parent
[1] I still use Qwerty on non-Kinesis keyboards and this fact is enough for my muscle memory to eliminate any mental overhead of switching.
comment 3y ago · link · parent