Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
e-dant
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
91.
▲
by
e-dant
4y ago
I’d argue the best way to do that is to write stateless code and let the compiler figure out how to make it fast
92.
▲
by
e-dant
4y ago
Wouldn’t be hard to make a combinator with function pointers in C. I do it regularly. They compose well (and you can pass them state for context).
93.
▲
by
e-dant
4y ago
Which abstractions? I could see a monad being defined as a list of (typed) states with a functor. But they’re still stateless. I could also see immutable data structures being implemented in a stateful way (they usually are in non-FP langua
94.
▲
by
e-dant
4y ago
Woah — with all the declarative and functional languages, looks like someone has just discovered a (stateful) state machine. They’re trying to convince us that this is a useful thing in a hypothetical situation where people do ridiculous, u
95.
▲
by
e-dant
4y ago
Better question: Why do we endlessly produce so much state?
96.
▲
by
e-dant
4y ago
So, we have three (umbrella) paths to modeling intelligence: - Pattern theory - Abductive logic - Machine learning Do they converge?
97.
▲
by
e-dant
4y ago
Functions are universal. Choose them over everything else. Functional F# syntax or bust.
98.
▲
by
e-dant
4y ago
I recently had a conversation with a colleague who mentioned: “We can only be great at one thing. The rest we can only be good at.” This doesn’t quite answer the question, but I think it’s related.
99.
▲
by
e-dant
4y ago
http and tcp aren’t very comparable. Anyway, the whole OSI has problems. If it were up to me, I’d redo IP to include named ports and see what follows.
100.
▲
by
e-dant
4y ago
C strings are pointers to memory. There are semantics and assumptions encouraging null-character delimited strings, but not every API follows those rules (just got done working with a Windows API that doesn’t). Often, you have to both null-
101.
▲
by
e-dant
4y ago
I guess it’s nice for a C string API, but what’s the motivation to use and create this? Wouldn’t externing some C++ symbols (or Rust) work more smoothly?
102.
▲
by
e-dant
4y ago
When I began this project, I started with kqueue. The performance was wanting and there were bugs with very large file trees. I moved to a minimal std::filesystem-based watcher and optimized it from there. There hasn’t been a formal head-to
103.
▲
by
e-dant
4y ago
Near-zero is a bit loose. It keeps a relatively compact in-memory representation. You’re about right with your estimate. Having measured just now, it’s about 30mb for 1 million directories. The baseline Watcher’s efficiency has a wide sprea
104.
▲
by
e-dant
4y ago
You are right. I’ll make sure to give a deeper breakdown in the readme.
105.
▲
by
e-dant
4y ago
More technically, here’s what we have: A “baseline” filesystem watcher which uses only the standard library. It has been made to beat kqueue. And it does. A platform filesystem watcher for Darwin is used, but certain event properties are ha
106.
▲
by
e-dant
4y ago
https://github.com/e-dant/watcher/issues/10
107.
▲
by
e-dant
4y ago
It’s difficult to get it perfectly right. There is ongoing work attempting to make it more perfect. I expect a year or two before this is complete. For now though, it does do what it says. The tests I’ve run show that it is accurate over la
108.
▲
by
e-dant
4y ago
I’ve gone back and forth with inotify on Linux. Ned14 gave a great rundown of the ideal next steps for a best-possible implementation. You can check out issue/10 for a full description of how it works now, why neither inotify nor our c
109.
▲
by
e-dant
4y ago
What do you mean?
110.
▲
by
e-dant
4y ago
No perfectly good reason. I will look into that before version 1.
111.
▲
by
e-dant
4y ago
It’s efficient because it beats kqueue while reporting events accurately. A proper benchmarking program is in the works, however manual testing does show only minimal resource usage. For more, see this issue: https://github.com&#
112.
▲
by
e-dant
4y ago
https://github.com/e-dant/watcher/issues/10
113.
▲
by
e-dant
4y ago
I should test this. I haven’t seen a problem with that so far in my personal usage, so I’m inclined to say probably. That’s a good test case. I’ll make an issue.
114.
▲
by
e-dant
4y ago
It does one or the other. There are concerns about OS filesystem event hooks. The current solution isn’t ideal, and is being addressed here: https://github.com/e-dant/watcher/issues/10
115.
▲
by
e-dant
4y ago
It’s being addressed here: https://github.com/e-dant/watcher/issues/10
116.
▲
by
e-dant
4y ago
All are supported. Although, to be more efficient, I need to write system API calls for Windows. That will be the 1.0 release.
117.
▲
Show HN: Filesystem Watcher
(github.com)
91 points
by
e-dant
4y ago
|
73 comments
118.
▲
by
e-dant
4y ago
I thought we call it software because it breaks when I touch it
119.
▲
by
e-dant
4y ago
Those considering doing something like this (such as the author) might consider using my library: https://github.com/e-dant/watcher It hooks into system APIs where viable. (Otherwise, it uses std::filesystem.) It’s mea
120.
▲
by
e-dant
4y ago
Metrological?
More ›