Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
purplesyringa
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
11 ms
·
91.
▲
by
purplesyringa
2y ago
This is such a ludicrous premise, I'm amazed you pulled it off. You mention "another packing optimization". I'm wondering, how are you transferring frames? The dot matrix is eight 7x5 characters, i.e. 280 bits in total,
92.
▲
by
purplesyringa
2y ago
On a related note, https://hugsy.github.io/gef/ provides a TUI interface like that.
93.
▲
by
purplesyringa
2y ago
The main problem with Hacker's Delight is its age. It has lots of bit tricks and optimization guidelines you'll find useful, but you have to understand that a big part of it doesn't apply on modern devices. But as long as you
94.
▲
by
purplesyringa
2y ago
What is expected behavior? Surely `echo AB> foo.txt; echo CD>> foo.txt` producing `ABBC` is either a bug in COMMAND.COM, the emulator, or something else? That can't be correct.
95.
▲
by
purplesyringa
2y ago
> If you don’t want to do any of this trampoline stuff, you can also do the One Big Switch approach which stuffs each of the funs and conts into a case in a massive switch statement. Calls become gotos. Just wanted to add that this is ve
96.
▲
by
purplesyringa
2y ago
So if it's not a bug in the emulator, then it's a bug in COMMAND.COM? I don't think that's the case, surely it couldn't have been missed by Microsoft at the time. The article goes on to talk about fread/fwrite
97.
▲
by
purplesyringa
2y ago
This article is kind of fine overall but gets so many specifics wrong. I guess this is to be expected from someone just beginning to verse in assembly, but still. if '0' <= x && x <= '9' || 'a&#x
98.
▲
by
purplesyringa
2y ago
I must be missing something. The article lists three libcs (Open Watcom, Microsoft Visual C++ 6.0, IBM C/C++ 3.6 for Windows) from the good old times. Does the emulator link to Open Watcom, i.e., does it emulate DOS on machines about a
99.
▲
by
purplesyringa
2y ago
I meant something close to https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p04... Perhaps a simple way to look at it is that it's like a dynamic array, but when the capacity is ex
100.
▲
by
purplesyringa
2y ago
Ah yes, the most reliable solution to a wrong choice of a data structure: add data-specific hacks until it works. For the life of me I can't figure out why people never consider replacing linked lists. Even without worst-case O(n) inse
101.
▲
by
purplesyringa
2y ago
Is it just a coincidence that the name is https://en.wikipedia.org/wiki/CQD , the old SOS?
102.
▲
by
purplesyringa
2y ago
I tried a similar approach with 32-bit FP before, and the problem here is that fast conversion is only fast in the sense of latency. Throughput-wise, it takes 2 uops instead of one, so in the end, a plain float<->int conversion wins.
103.
▲
by
purplesyringa
2y ago
It's odd that the only reason AVX-512 long division wins in the end is that it's compared to AVX2 reciprocal. Would it be possible to compare it to AVX-512 reciprocal computation?
104.
▲
by
purplesyringa
2y ago
I love this. I've been wondering how the picture is drawn with less than one `echo` per pixel, and it's very clever: the game is "not really" 3D, so you can run raytracing just once per column, and then you only need t
105.
▲
by
purplesyringa
2y ago
antirez: You already got it wrong. You've got a double indirection, with `groups[i]` pointing to a heap-allocated instance of `DynamicArray`, which supposedly stores the actual heap pointer. It's not about the language being low-l
106.
▲
by
purplesyringa
2y ago
> This exercise will show you for instance that you'll have to immediately choose if to append_to_dynamic_array() or add_to_linked_list(). Linked lists, that's what you're worried about? `[...]` is not a linked list in P
107.
▲
by
purplesyringa
2y ago
Again, what would you suggest instead? If you can't guess that `list` is supposed to represent an array of consecutive elements, I have trouble thinking of a language that'll make that clear without being exceedingly verbose for n
108.
▲
by
purplesyringa
2y ago
What concise and readable language would you suggest instead?
109.
▲
by
purplesyringa
2y ago
> It's a little surprising that this works at all, since the partitioning step in the radix sort is itself the same kind of sharding operation. The key property here is the number of groups. When sharding data to n groups, only n lo
110.
▲
by
purplesyringa
2y ago
That's true, perhaps my wording is off. I believe that the devil in the details. Sure, knowing that better access patterns result in better performance is common. But the fact that the access pattern can be optimized when the problem i
111.
▲
by
purplesyringa
2y ago
Uh? The post very clearly says: "I’m using Python as pseudocode; pretend I used your favorite low-level language". The goal is to show what's possible when you do your best, of course I'm not going to use Python for anyt
112.
▲
by
purplesyringa
2y ago
That's good food for thought. My hardware is quite old, but I agree that the numbers seem somewhat suspicious. I believe that RAM can only be RMW'd in cache lines, so modifying just 8 bytes still requires 64 bytes to be transmitte
113.
▲
by
purplesyringa
2y ago
This permission does not grant the hasher any ability to detect when flushing is most efficient. Nor does constant flushing help with performance.
114.
▲
by
purplesyringa
2y ago
Interestingly, this library seems to suffer from the opposite problem: where setTimeout can trigger earlier than expected, setBigTimeout can trigger never at all! The problem is that when setBigTimeout is invoked with a floating-point numbe
115.
▲
“Bad Apple” in Minecraft
(purplesyringa.moe)
406 points
by
purplesyringa
2y ago
|
64 comments
116.
▲
by
purplesyringa
2y ago
The solution's obvious, but if I followed it, I wouldn't have a fun topic to discuss or fake internet points to boast about, huh? :) I'll probably switch to Cloudflare Pages someday when I have time to do that.
117.
▲
by
purplesyringa
2y ago
It's unfortunately Chromium-only for now, and I wanted to keep code simple. I've got a PoC lying around with VideoFrame and whatnot, but I thought this would be better for a post.
118.
▲
by
purplesyringa
2y ago
A nojs version is compiled separately and is linked via a meta refresh. Not ideal, and I could add some safeguards for people without webgl, but I'm not an idiot.
119.
▲
by
purplesyringa
2y ago
This technique is amazing and way cooler than my post. Kudos!
120.
▲
by
purplesyringa
2y ago
Hmm? I'm not sure where you're taking that from. The webp is inlined.
More ›