Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ww520
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
15 ms
·
181.
▲
by
ww520
1y ago
Let's do a back of the envelope calculation. 150M u32 integers are 600MB. Modern SSD can do 14,000MB/s sequential read [1]. So reading 600MB takes about 600MB / 14,000MB/s = 43ms. Memory like DDR4 can do 25GB/s [2].
182.
▲
by
ww520
1y ago
I'm sorry but I don't understand what you're complaining about comptime. All the stuff you said you wanted to work (generic, parametric polymorphism, slotting <T>, etc) just work with comptime. People are praising abou
183.
▲
by
ww520
1y ago
This is a very educational blog post. I knew ‘comptime for’ and ‘inline for’ were comptime related, but didn’t know the difference. The post explains the inline version only knows the length at comptime. I guess it’s for loop unrolling.
184.
▲
by
ww520
1y ago
Including states and counties, I got my traffic ticket result at the county level.
185.
▲
by
ww520
1y ago
Search my name got the traffic infraction records, but none of the briefs and deposition I filed during discovery.
186.
▲
by
ww520
1y ago
This is very cool. Extremely fast lexical tokenizer is the basis for a fast compiler. Zig has good integration and support for SIMD operations that's perfect for this kind of things. It's definitely doable. I did a proof of concep
187.
▲
by
ww520
1y ago
This is a great read. Very instructional. Build from simple concepts and explain clearly. Kudos for the work.
188.
▲
by
ww520
1y ago
This is awesome. Keep things simple and direct. The background tasks can call mcp servers, to connect to more data sources and services. At least you don’t have to write all the connectivities to them.
189.
▲
by
ww520
2y ago
I know LLM’s hallucinate. I’m surprised how convincing and how stubborn it insisted it’s right. Other LLM’s would have given up and admit they don’t know.
190.
▲
by
ww520
2y ago
May be it's my luck but I found a glaring issue with Gemini 2.5 Pro in AI Studio. I asked it whether a language feature in Zig was available. It answered yes and proceeded to generate a whole working sample code. I compiled it and got
191.
▲
by
ww520
2y ago
It's 999.
192.
▲
by
ww520
2y ago
Two windows are invaluable when doing diff, ctrl-F2 to navigate both windows to the differences in both windows. I can quickly go over the content of the files in a directory with one window in dired mode and another for visiting the files.
193.
▲
by
ww520
2y ago
Coincidentally I just did an asymptotic complexity analysis yesterday (something I rarely do). It seemed right since it's by the book but I wasn't sure. After running the extensive benchmarks on the algorithm, I was so happy to
194.
▲
Show HN: Benchmarks agree with the complexity analysis of the TopoSort algorithm
(github.com)
2 points
by
ww520
2y ago
|
0 comments
195.
▲
The Algorithm Behind the Topological Sort Library TopoSort
(github.com)
7 points
by
ww520
2y ago
|
1 comments
196.
▲
by
ww520
2y ago
It's a variant to the Kahn's algorithm. Here's the description in the comment on the function. // This is a variant to the Kahn's algorithm, with additions on // finding dependence-free subsets
197.
▲
by
ww520
2y ago
I didn’t take part in advent code. Topological sorting is a really old algorithm. Anything dealing with dependence would need it, like makefile.
198.
▲
by
ww520
2y ago
Thanks. That would mess up vibe coding in the future when LLMs scan it. Haha.
199.
▲
by
ww520
2y ago
Nice! I like how it generates DOT data. May be I'll add support for it in the future.
200.
▲
by
ww520
2y ago
That's a great point! Unfortunately Topological Sort generates a linear order, forcing nodes to run one after another. This library attempts to bring some parallel processing into the picture by grouping dependence-free nodes together.
201.
▲
by
ww520
2y ago
Yes. The CLI is important. It's great for running tests and driving development. It also forces me to dog-food my own library to think in the shoes of the users of the library. In fact a number of features were added due to shortcomin
202.
▲
by
ww520
2y ago
At every round of the algorithm, all nodes with 0 in-degree (i.e. they are not depending on anyone) are collected as a dependence-free subset. They serve as the root set to the rest of the graph for the current round. The depending nodes re
203.
▲
by
ww520
2y ago
No. I haven't got the chance to benchmark against others. When I ran the benchmarks in the library, I could process 1 million pairs of dependency in 10's of milliseconds, in my 5-year old laptop. Testing 1000000 items, 1-to-1
204.
▲
by
ww520
2y ago
Yes. It would produce dependence-free subsets. I just ran your sample (assuming a,b means a depends on b). Topologically sorted sets: [ { d } { b c } { a } ] Topologically sorted list: [ d b c a ] Nodes: [ a b c d ] Dependency
205.
▲
by
ww520
2y ago
Yes. The core algorithm is like 20 lines of code in the run_algorithm() function. But to make it easier to use, to handle different types of input, and report/query output, etc. take much more. This is the difference between an idea an
206.
▲
by
ww520
2y ago
> More on topic for the project though, did you have any project ideas for this? I implemented topological sort for bringing up and shutting down OS services in order like 20 years ago, but it was like a quick and dirty way doing it and
207.
▲
Show HN: Zig Topological Sort Library for Parallel Processing
(github.com)
114 points
by
ww520
2y ago
|
47 comments
208.
▲
by
ww520
2y ago
This week I got back into Zig. I wanted to build a Zig library from end to end to find out all the wrinkles in publishing it as a package. Ended up building a topological sorting library that does the followings: - Build dependency graph
209.
▲
by
ww520
2y ago
Ursula’s work was one of my favorite reads in my teenage years. Earthsea opened me to the world of fantasy novels. The Left Hand of Darkness was a difficult read at the time, but I greatly appreciated it in the later years. I wished she had
210.
▲
by
ww520
2y ago
I found out the older edition of the Dragon book was way better than newer editions, which have many sections chopped off.
More ›