Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dbaupp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
84 ms
·
691.
▲
by
dbaupp
10y ago
(If you indent text by two spaces, it will be formatted as code on HN.) Are you using the macros 1.1 versions of those crates? In particular, serde_macros should now be serde_derive: https://github.com/serde-rs/serde&#x
692.
▲
by
dbaupp
10y ago
The domain experts could be cops themselves, in a specialist department of a broader police force. I'm sure a lot of the basic training and equipment required is the same across agencies. In any case, the current hyper-local US system
693.
▲
by
dbaupp
10y ago
Smoking imposes one person's choice on many others, in terms of length and quality of life, via the negative effects of passive smoking (and also just day-to-day---I personally hate having to suffer through someone's acrid fumes
694.
▲
by
dbaupp
10y ago
The malicious actor would find it very suspicious (especially if/when these features are in popular platforms and thus widely known), breaking the deniability.
695.
▲
by
dbaupp
10y ago
> I meant not having to manage different memory models and available access patterns The only way I can make this make sense, is having cross-platform abstraction around atomic orderings etc. (like the new C++11 std::atomics) that work
696.
▲
by
dbaupp
10y ago
> You can, but it is an extreme pain to do it, It is not extreme, and it isn't even necessary: just reuse one of the many arenas others have already written, e.g. https://crates.io/crates/typed-arena . Copy-
697.
▲
by
dbaupp
10y ago
> There is a cost to it, same as in Rust All of these things have a larger cost than Rust: you're forced to use pervasive reference counting and very defensive data structures. Rust allows you to get away with pointers deep into o
698.
▲
by
dbaupp
10y ago
This is wrong. There is a std::sync::atomic module, along with types like Mutex and RWLock.
699.
▲
by
dbaupp
10y ago
Rust gets all your favourite kinds of atomics and barriers, exactly like C. Other things are indeed hard to get safe, which is why Rust has `unsafe`: it is possible to use them, marking out the dangerous regions precisely, rather than the w
700.
▲
by
dbaupp
10y ago
Could you be specific about how the type system and polymorphic memory allocators defend against things like dangling references, iterator invalidation and use-after-free/move? I can't imagine an allocator affecting these unless i
701.
▲
by
dbaupp
10y ago
(*const is not valid syntax: the way to not-borrow something is to coerce/cast it to an unsafe pointer within the statement, so that the borrow ends at the ;, e.g. give x an explicit raw pointer type in the first example.)
702.
▲
by
dbaupp
10y ago
Rust doesn't have user-defined copy constructors and a return is always a move (semantically a memcpy), so I'm not sure it's so relevant as an optimisation for Rust.
703.
▲
by
dbaupp
10y ago
The alternative in other languages is the error (using a socket that has been closed/resource that has been semantically moved away) is only found at runtime. The compiler flagging a mistake like this exactly the point of having the
704.
▲
by
dbaupp
10y ago
The crates published by the Rust developers themselves seem quite similar to the standard library for this purpose. (But, yes, things like this are not as discoverable as they should be; it is one of many things people are working on.)
705.
▲
by
dbaupp
10y ago
I was unclear: the key bit from that first sentence is "any failures are flagged". Go does give more static control over stack vs. heap than Java, but it's still perfectly happy to implicitly promote things to the heap to mak
706.
▲
by
dbaupp
10y ago
Cargo doesn't require that you use things from crates.io without vetting them. It's possible to, say, write everything yourself, or only use specific crates that you've decided are good (whether that's by reading the sou
707.
▲
by
dbaupp
10y ago
Rust doesn't have escape analysis like Go (or Java, etc.), it is all done at compile time and any failures are flagged, meaning one has a stronger idea of the actual runtime behaviour of the code. Additionally, reference counting is us
708.
▲
by
dbaupp
10y ago
Go does accept pull requests, just not GitHub ones: https://golang.org/doc/contribute.html#Code_review (I don't disagree with the premise though, Go does seem to be less community-driven than Rust; e.g. Rust has 3
709.
▲
by
dbaupp
10y ago
Do you really expect any project to have nightly builds that are forward compatible? The whole point of regular development builds is to have a place to test and do experiments... which is pointless if every experiment needs to be support
710.
▲
by
dbaupp
10y ago
That's fair, but the complaint seems to be epoll not being possible at all, rather than it being annoying to call. (Obviously the latter is important, but the former shows a possible deeper misunderstanding of the language.)
711.
▲
by
dbaupp
10y ago
tokio 0.1 was released concurrently with (or slightly after) the initial investigations behind this post, so missing it/passing over seems reasonable. That said, as pointed out in the previous discussion about this, C also doesn't
712.
▲
by
dbaupp
10y ago
Rust lets you be precise about placing the locks exactly where they are needed, with compile time errors if a lock isn't locked when accessing data, or a lock is missing. Fixing data races with locks for arbitrary code, without more st
713.
▲
by
dbaupp
10y ago
Rust's "sharing xor mutability" guarantee eliminates data races by (usually statically but also dynamically) ensuring that a memory location won't be mutated when multiple places/threads can access it. Of course, th
714.
▲
by
dbaupp
10y ago
You personally not valuing the differences is very different to not having any differences, and the latter is what a lot of your comments seem to be implying, including the one I was replying to.
715.
▲
by
dbaupp
10y ago
As people keep saying, type assertions do not have as strong compile time assurances as ADTs.
716.
▲
by
dbaupp
10y ago
> All I meant to do was point out that exhaustiveness checks are not without their tradeoffs. And all I meant to do was point out that lack of exhaustiveness checks is not without its tradeoffs. :)
717.
▲
by
dbaupp
10y ago
It's like accessing fields on a struct, where you can only access the ones that are guaranteed to be valid. For instance, in existing Go, the struct method would be having two fields, * X and * Y, where (in theory) exactly one of them
718.
▲
by
dbaupp
10y ago
For both of the first points: I don't think anyone's proposing that closed sum types be the only polymorphism in Go (removing the existing open polymorphism would be a wild breaking change and so isn't even a remote possibi
719.
▲
by
dbaupp
10y ago
> Presumably you're adding to a "closed" set of types, so it's quite easy to grep for the type names in that type set Yes, that's an option, but it's not nearly as nice as the compiler automatically tellin
720.
▲
by
dbaupp
10y ago
y is of the type you asked for, yes, but that isn't necessarily the type that should be there if the programmer makes a mistake, or if the underlying code changes. With an enum, the types are written in one place, and the compiler conn
More ›