Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pornel
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
50 ms
·
631.
▲
by
pornel
2y ago
rustfmt uses 100-char lines by default (and can be configured to fill more), but that's not the problem with it. The problem is that as soon as a whole statement doesn't fully fit on a single line, rustfmt switches from "hori
632.
▲
by
pornel
2y ago
Rust is denser than C, but both Rust and C++ can work on similarly high level of abstraction. It may be just down to rustfmt. It really adds a lot of vertical sprawl. I personally can't stand how much rustfmt makes multi-line code expl
633.
▲
by
pornel
2y ago
There's nothing technically stopping Rust from supporting Cygwin, except lack of volunteers to complete the port: https://github.com/rust-lang/rust/issues/5526 (this feature request has been open for 12
634.
▲
by
pornel
2y ago
This is an inaccurate generalization of both C and Rust ecosystems, and an inflammatory framing. openssl has made several rounds of incompatible changes. ffmpeg and related av* libs make major releases frequently. libx264 is famous for havi
635.
▲
by
pornel
2y ago
The original announcement explicitly said it's not a rewrite, multiple times: https://daniel.haxx.se/blog/2020/10/09/rust-in-curl-with-hyp... > A rewrite of curl to another language is not consi
636.
▲
by
pornel
2y ago
> I also see all the time people showing off the Send+Sync traits. Yes, very nice, very nice. Magic abilities. And what? I do my concurrent code by sharing as little as possible all the time. So the patterns of code where things can be m
637.
▲
by
pornel
2y ago
The problem is typically caused by &mut self methods exclusively borrowing all of self. I wish this not-a-proposal turned into a real proposal: https://smallcultfollowing.com/babysteps//blog/2021/11
638.
▲
by
pornel
2y ago
A borrow checker that isn't "viral all the way down" allows use-after-free bugs. Pointers don't stop being dangling just because they're stashed in a deeply nested data structure or passed down in a way that [[life
639.
▲
by
pornel
2y ago
It is an abstraction, but the safety requirements are neither enforced nor abstracted away. C's type system can't communicate how long pointers are valid for, when and where memory gets freed, when the data may be uninitialized, w
640.
▲
by
pornel
2y ago
Bash is also memory-safe. Almost every programming language is memory-safe, but Smalltalk and most high-level dynamically typed languages require a fat runtime, and have a much higher overhead than C or Rust. For languages that can be credi
641.
▲
by
pornel
2y ago
This wasn't a rewrite-in-Rust effort, and I think that's the problem. Nothing valuable from curl has been rewritten in Rust. Only some existing Rust code has been added to curl, but the Rust ecosystem already has a better, safer w
642.
▲
by
pornel
2y ago
Yes, but curl-with-hyper needed Rust programmers to finish and maintain the integration with the C codebase, and couldn't find anyone interested enough, which I assume is because Rust users don't need curl.
643.
▲
by
pornel
2y ago
It's annoying that there's interest in these stats mainly as an argument against renewable energy, not from perspective of wildlife preservation. Just those particular birds are precious, not the others killed by other man-made st
644.
▲
by
pornel
2y ago
I think there was little traction in curl, because Rust users can just use hyper directly. https://lib.rs/curl is used in 1000 packages, https://lib.rs/hyper is in 21,000 packages. Curl is big and supports
645.
▲
by
pornel
2y ago
Rust's ownership model is close enough for translating C. It's just more explicit and strongly typed, so the translation needs to figure out what a more free-form C code is trying to do, and map that to Rust's idioms. For exa
646.
▲
by
pornel
2y ago
Because it's not merely mutable, it's exclusive . You get a static guarantee that, for as long as you can use this reference, this is the only reference in the entire program that can mutate this memory. This is automatically t
647.
▲
by
pornel
2y ago
It should be possible (it'd need to also save memory map), but for some reason Rust's standard library wants to resolve human-readable paths at runtime. Additionally, Rust has absurdly overly precise debug info. Even set to minimu
648.
▲
by
pornel
2y ago
Safety is not an extra feature a'la carte. These concepts are all inter-connected: Safety requires unions to be safe, so unions have to become tagged enums. To have tagged enums usable, you have to have pattern matching, otherwise you&
649.
▲
by
pornel
2y ago
It the image is watermarked, you can't remove it that way. Watermarks easily survive uniform noise higher than humans can tolerate. Watermark data is typically stored redundantly in multiple locations and channels, so uniform noise mos
650.
▲
by
pornel
2y ago
sqlite also has some runtime checks that are expected to be always true or always false, and solves that by using a custom macro that removes these branches during branch coverage test. The same would be possible in Rust. Everything that co
651.
▲
by
pornel
2y ago
The Rust implementation is also faster than the newer stb library even though it copied stb's SIMD code . This Rust library dates back to 2014, which is like K&R C for Rust. That was before Rust 1.0.0 release, before Rust had any
652.
▲
by
pornel
2y ago
A fourth hack may still be better than having to develop the four features on top of a wrong abstraction. If you end up having a poorly fitting abstraction, then you'll be spending extra effort on doing things "properly", b
653.
▲
by
pornel
2y ago
Oscillofun is the first one I've seen, and I still love the music: https://www.youtube.com/watch?v=o4YyI6_y6kw
654.
▲
by
pornel
2y ago
When search is cheap and quick, it's possible to improve search by postprocessing search results and running more queries when necessary. I use Tantivy, and add refinements like: if the top result is objectively a low-quality one, it&#
655.
▲
by
pornel
2y ago
Rust/Cargo has adopted this protocol: https://lib.rs/jobserver
656.
▲
by
pornel
2y ago
Hello https://xkcd.com/927 There's also WESL that aims to extend WGSL with modules and generics: https://github.com/wgsl-tooling-wg/wesl-spec and there's Naga project that can translate WGSL
657.
▲
by
pornel
2y ago
Rust's exclusive ownership can be used for things that can be called at most once (a method can require a non-copyable object as an argument, and takes ownership of it away from you, so you can't call the method again). Rust also
658.
▲
by
pornel
2y ago
The strong criticism Rust got in this area is being poorly suited for rapid throwaway prototyping. I think that's fair — slow compile times and language's focus on writing things properly on the first try are the opposite of what
659.
▲
by
pornel
2y ago
Before Rust, C was my preferred language. It's really hard to talk about Rust in a way that doesn't sound like talking trash about C, because Rust's main reason to exist is preventing safety issues that… people programming in
660.
▲
by
pornel
2y ago
The same happened to the Twitter API, so it's not a surprise.
More ›