Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
estebank
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
17 ms
·
271.
▲
by
estebank
1y ago
While acknowledging the risk of causing a pile-on (which I don't want!), would it be possible to have a link to them or a description of what the unsafe blocks accomplish? I'm intrigued if they are for performance or API ergonomic
272.
▲
by
estebank
1y ago
RyanAir is famously one of them. Edit: I was recalling articles claiming the company purposely fueling less than other airlines in order to increase their rate of claims for priority landing to have a better "on time" statistics.
273.
▲
by
estebank
1y ago
If you have let a: u8 is 0..100 = 1; let b: u8 is 0..100 = 2; let c = a + b; The type of c could be u8 in 0..200. If you have holes in the middle, same applies. Which means that if you want to make c u8 between 0..100 you&#
274.
▲
by
estebank
1y ago
The counterpoint I'd have for this argument is that code that isn't multithreaded or with complicated ownership scheme ends up being very simple looking Rust, so the difficulty of the language doesn't come into play.
275.
▲
by
estebank
1y ago
You can do the same in Rust with Box::leak, which takes an owned pointer and gives you back a 'static borrow. The only caveat is that unless you reconstitute the type its Drop impl won't be called, but that's likely exactly w
276.
▲
by
estebank
1y ago
Have you read https://rust-unofficial.github.io/too-many-lists/ ?
277.
▲
by
estebank
1y ago
There's one reason I could think of for translating from C to Rust without further changes: simplifying the build. If you can remove the need for a build.rs script running make, that's one headache less. At that point you have e
278.
▲
by
estebank
1y ago
Its highly dependent on the kind of project. A few years back libxml and libxmlsec1 were a consistent pain in the neck for me. I don't know about now, I simply moved on from the project that needed me to interact with them.
279.
▲
by
estebank
1y ago
Congestion pricing works when there are alternatives. If you have both no public transport and congestion pricing, what you have is only increased tax collection with no behavioral change.
280.
▲
by
estebank
1y ago
You might want to look at anyhow and thiserror, the former for applications and for libraries the latter. thiserror "just" makes it easier to do what I suggested of writing a manual `impl From` so that `?` can transform from the e
281.
▲
by
estebank
1y ago
> But it doesn't address all kinds of other logic errors/bugs. It's like closing one door to the barn, but there are six more still wide open. Could you point at some language features that exist in other languages that Ru
282.
▲
by
estebank
1y ago
Out of curiosity, why are you borrowing that many times? The following should work: while let Some(page) = object_stream.next().await { match page { // ListObjectsV2Output Ok(p) => {
283.
▲
by
estebank
1y ago
Individuals in the US, even if a vast majority, being nice and happy that you visit doesn't stop the possibility of legally being held at a port of entry for any reason, even with a valid visa. This isn't new, although the frequen
284.
▲
by
estebank
1y ago
> Worst case is that the compiler does a bad job at explaining the error and you don't find it immediately. By the way, the project considers this a bug and accepts reports for that. In many occasions they are easy to fix. In others
285.
▲
by
estebank
1y ago
I'm proposing this not as a specific feature but as a general strategy: everything the compiler can conceivably recover from in a way that allows the rest of the application to run, should. Think borrow checking, for example. If it cou
286.
▲
by
estebank
1y ago
If only we had type ascription on expressions... ducks
287.
▲
by
estebank
1y ago
The thing is I want an equivalent to `todo!()` for the type-system . A mode of operation where if you have some compile errors, you can still run tests. Like for example, if you have fn foo() -> impl Display { NotDisplay::
288.
▲
by
estebank
1y ago
The only issue with it is that Rust's aversion to half-baked code means that you can't have "partially working code" during the refactor: you either finish it or bail on it, without the possibility to have inconsistent c
289.
▲
by
estebank
1y ago
The security concerns are those of "Trojan source", where the displayed text doesn't correspond to the bytes on the wire.[1] I don't think a wire protocol should necessarily restrict them, for the sake of compatibility w
290.
▲
by
estebank
1y ago
To drive the point home: https://github.com/rust-lang/rust/pulls?q=is%3Apr+author%3Aj...
291.
▲
by
estebank
1y ago
Unused variables are a warning: https://play.rust-lang.org/?version=stable&mode=debug&editio...
292.
▲
by
estebank
1y ago
One option would be to ignore the orphan rule withing workspaces.
293.
▲
by
estebank
1y ago
It's a matter of what use cases are catered to by default , and what use cases are possible . For example, having debug symbols on by default makes it easier to start using the language and debug your applications, at the cost of mor
294.
▲
by
estebank
1y ago
Valhalla is indeed the one effort that could close the biggest gap with native languages. Java Vs C or Rust for networked applications have comparable CPU utilisation with comparable throughput, but memory consumption can be >100x. Proje
295.
▲
by
estebank
1y ago
It sounds like you'd want the entry API: https://doc.rust-lang.org/std/collections/struct.HashMap.htm...
296.
▲
by
estebank
1y ago
> I don't think it's possible to write a tool like ripgrep with its performance profile in a GC language. I think it is possible to make a language that has both a GC and a borrow checker, treating the GC types as a third lev
297.
▲
by
estebank
1y ago
> And that is especially likely when you use indices manually. But that is never the recommendation Rust practitioners would give for graph data structures. One would instead recommend using a generational arena, where each index holds t
298.
▲
by
estebank
1y ago
The get_default example requires only one to use the stdlib API: https://doc.rust-lang.org/std/collections/hash_map/enum.Entr...
299.
▲
by
estebank
1y ago
Making partial borrows to be expressable in method definitions would allow the design pattern to be expressed without breaking the current lifetime evaluation boundary. Allowing the borrow checker to peek inside of the body of local methods
300.
▲
by
estebank
1y ago
You're making it sound like the success of a language is determined purely by its advertising budget by pointing at languages that had financial backing, which disregards that financial backing allows for more resources to solve techni
More ›