Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
duckerude
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
duckerude
4y ago
The original implementation gave out a handle that waited for all the threads to end when it was dropped (i.e. went out of scope). That would prevent premature cleanup. But it was possible to leak the handle so that it would never be droppe
32.
▲
by
duckerude
4y ago
You're getting flak for this, but you have a point. I wouldn't say it changes very fast. If you look at the language features in the past two releases they're all of the form "allow {existing feature} to do {thing you&#x
33.
▲
by
duckerude
4y ago
Does it? GCC's Java frontend died and is no longer shipped, they need maintainers like any other compiler.
34.
▲
by
duckerude
4y ago
That problem also exists in sets because some values that aren't interchangeable still compare equal: >>> {1} | {1.0} | {True} {1} But the behavior for dicts is surprising even in that light: >>> {1: 1} |
35.
▲
by
duckerude
4y ago
I've found it very easy to get started with fuzzing in Rust using cargo-fuzz. I didn't do anything very advanced, and my closest point of reference is testing Python with Hypothesis, but it did turn up bugs. Here's a Rust fuz
36.
▲
by
duckerude
4y ago
Some people make the opposite claim: Rust lets you get away with less dynamic allocation (and more data shared between threads) because you can rely on the compiler checking your work. The effect might be positive or negative depending on t
37.
▲
DALL-E 2 vs. Google Images
(nostalgebraist.tumblr.com)
1 points
by
duckerude
4y ago
|
0 comments
38.
▲
by
duckerude
4y ago
It can, but it doesn't have a "do reasonable things" mode. Instead it notices when you do something unreasonable and undoes its optimizations.
39.
▲
by
duckerude
4y ago
> just like in every other mainstream language JavaScript doesn't do this, you can replace properties of window at will. I don't think Ruby does it, or Lua. PHP probably does it under some circumstances in modern versions but o
40.
▲
by
duckerude
4y ago
The oldest rustc version I target (for a tiny project, admittedly) is over 6 years old, and it's fine. When code works it also works on the latest release. When code doesn't work I get a reasonable compile-time error message, not
41.
▲
by
duckerude
4y ago
I don't think this article intends to give a full appraisal of Go. It highlights the downsides of a particular philosophical stance Go takes. That stance is very much real, even if it's best described by gesturing at half a dozen
42.
▲
by
duckerude
4y ago
I don't know if the world needs this language, but I'm glad it exists. There's a real charm to C's straightforwardness. It deserves to be expressed without broken array handling and a clunky preprocessor and overzealous
43.
▲
by
duckerude
4y ago
> the kernel is a service that end user applications interact with through an API. My thinking is that that API has to distinguish between many strictly defined error codes, while anyhow homogenizes errors and focuses on human-readable i
44.
▲
by
duckerude
4y ago
anyhow is for careless error propagation, where you know you won't do elaborate handling and just bubble it up to the user. It's suitable for (some) applications, but not for libraries, and a kernel falls on the "library"
45.
▲
by
duckerude
4y ago
That's true when running `cargo install` to install an application directly from crates.io, but not when running `cargo build` in an already checked-out repository.
46.
▲
by
duckerude
5y ago
For the spectral-norm one I think it's a failed attempt at parallelism. This code spawns 4000 tasks: parallel: for i in 0..<n: spawn times_i(v, u, i, n, reverse) ( https://github.com/hanabi1224&
47.
▲
by
duckerude
5y ago
That speedup is accomplished by using a third-party LRU implementation. I can also speed up the Rust version by 30% by plugging in https://lib.rs/crates/lru . (The thread points out that the Nim version uses a doubly-li
48.
▲
by
duckerude
5y ago
This thread inspired me—I found a way to remove 40K: https://github.com/clap-rs/clap/pull/3370 I'm sure it's possible to cut it more. It'll never be tiny, but it can be smaller than it is now.
49.
▲
by
duckerude
5y ago
One more data point here is that uutils yes can be even faster than GNU yes by taking advantage of Linux's vmsplice syscall: https://github.com/uutils/coreutils/blob/main/src/uu/yes/sr
50.
▲
by
duckerude
5y ago
uutils already (optionally) builds that way. The GitHub release has a single 8.4M binary. That doesn't seem so bad, the GNU coreutils Debian package has an Installed-Size of 17.9MB. Though there might be hidden drawbacks I don't k
51.
▲
by
duckerude
5y ago
At least 500K comes from clap, the argument parsing library. That's how much true's size drops if you comment it out. It's a lovely library. Generated help text with colors and line wrapping based on your terminal width, info
52.
▲
by
duckerude
5y ago
This looks like it would be pretty stable in practice. The iffiest assumption I see is that names are always ordered by first appearance. It would be worse if it touched the bytecode itself, I've seen that break even in a bugfix releas
53.
▲
How I think about writing
(danluu.com)
10 points
by
duckerude
5y ago
|
1 comments
54.
▲
by
duckerude
5y ago
If it works it works. Very few of my problems with shells can be blamed on C. (Maybe two in total?) The oldest commit is from 2013. Rust hadn't hit 1.0 yet, Go only barely.
55.
▲
by
duckerude
5y ago
I actually have experience with this specific code. I recently fixed a bug in a function that his PR also touches: https://github.com/nix-rust/nix/pull/1521 And I have a PR to fix problems in another Rust wra
56.
▲
by
duckerude
5y ago
> Posix shell is clunky has its limitations but there's nothing really flawed about it. I think shellcheck is the best argument against this. POSIX shell is just stuffed to the brim with weird gotchas, places where the obvious way t
57.
▲
by
duckerude
5y ago
Python's semantics make homogeneity less useful and hard to enforce. Everything's passed by reference, so the list has to contain pointers even if you know all its elements have the same type. And some objects can change their typ
58.
▲
by
duckerude
5y ago
> For example in Rust you can write a function that might mistakenly overflow a 32-bit integer and, in production it will just silently wrap. In WUFFS that function won't compile until you either decide explicitly what should happen
59.
▲
Stop the Vertical Tab Madness (2010)
(prog21.dadgum.com)
6 points
by
duckerude
5y ago
|
1 comments
60.
▲
by
duckerude
5y ago
I think it makes sense to prefer this hypothetical API: subprocess.run_escaped("tac -- %s | grep 1 > %s", "foo.txt", "bar.txt") over this: with open("bar.txt", "w") as outfile:
More ›