Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dbaupp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
92 ms
·
841.
▲
by
dbaupp
10y ago
I'm not looking for a formal mathematical model or anything, just a precise plain English description of a data race ( not a race condition), e.g. like the following: A data race is when - two threads access a single memory location,
842.
▲
by
dbaupp
10y ago
That has downsides like, for one, requiring allocations for every state transition, and the runtime infrastructure (plus loss of static assurances) required to do downcasts when one needs functionality that only exists on a specific state.
843.
▲
by
dbaupp
10y ago
None of that looks like a formalisation or even a description of a data race, at least not in the modern sense.
844.
▲
by
dbaupp
10y ago
> The claim I replied to said preventing things like data races was done till well into the 80's No, it definitely didn't: it said data races as a concept seemed to not be formalised until the late 80's.
845.
▲
by
dbaupp
10y ago
I don't have time to read it in full right now, but a quick glance over that paper doesn't show any formalisation of data races, which is specifically what that parenthetical is about, not just general "concurrency safety&quo
846.
▲
by
dbaupp
10y ago
Like steveklabnik, I'm extremely curious to hear more about how Smalltalk's concurrency model is just like Rust's. The latter is a fairly flexible model to defend against data races (which seems to be a concept only really fo
847.
▲
by
dbaupp
10y ago
When were you doing this? There's now a large chunk of the standard library[1] that's explicitly designed to be used in bare-metal/zero-dependency situations, and it even includes "fancy" things like the formatting
848.
▲
by
dbaupp
10y ago
There's too much undefined behaviour for even modern C++ to be considered type safe: a dangling reference or invalidated iterator allows you to break it easily, accidentally. (Even "opt-out type safety" is a stretch, opt-in-w
849.
▲
by
dbaupp
10y ago
A direct comparison like that is somewhat comparing apples to oranges. Don't get me wrong, defaults matter, but Rust still does offer the control required to get small binaries, and, those defaults are not nearly as bad for low-level d
850.
▲
by
dbaupp
10y ago
I think it is meant to parse as "[the hidden urls in] (photos, videos, GIFs, polls, and Quote Tweets) no longer count towards your limit", not "photos, videos, GIFs, polls, and (Quote Tweets no longer count towards your limit
851.
▲
by
dbaupp
10y ago
The API used to be what you suggest, but it was changed because it forces doing a new allocation for each line. By taking a mutable string, code can reuse the backing storage of a string (or append to an existing one), which is especially u
852.
▲
by
dbaupp
10y ago
STM is useless with full immutability: it is safe in Haskell because effects (including mutation) can be controlled/packaged into contained areas, via abstractions like monads. That said, one downside of STM is that it isn't as ef
853.
▲
by
dbaupp
10y ago
Note that "pass by value" isn't a copy in a language with affine types like Rust. I'm not sure passing everything by reference probably would gain much in a systems programming language in the vein of Rust: one would sti
854.
▲
by
dbaupp
10y ago
You are correct, but my point was implicitly that the default thing people reach for is assert, especially since the name precondition sounds like it is only ok to call at the start of a function.
855.
▲
by
dbaupp
10y ago
Many (maybe most) languages are OK with changing behaviour/code between debug and release builds, e.g. disabling `assert`s and even the optimisations themselves. Of course, this is suboptimal in some cases, and thus providing a way to
856.
▲
by
dbaupp
10y ago
Yes, I believe that's what I was saying, but your comment sounds like it is disagreeing. Could you clarify?
857.
▲
by
dbaupp
10y ago
There definitely can be problems: the reference may escape the for loop, and the reference may be invalidated by a modification of the container (even for something "stable" like ordered_map, the referent may be removed).
858.
▲
by
dbaupp
10y ago
This may have changed, but, at the time of writing, rr was tied to the terminal gdb interface, which many people understandably don't like to use (i.e. not what they mean by "decent"), preferring the more direct connection to
859.
▲
by
dbaupp
10y ago
A segfault on null is fine if the language defines it to be OK (i.e. dereferencing null is reliably a crash), but most environments that allow interacting with null (C, C++, LLVM IR) have dereferencing it be undefined behaviour, i.e. the co
860.
▲
by
dbaupp
10y ago
I disagree that there's more programming concepts to keep in mind: the core ideas between Rust and C++ are the same (especially modern C++ with move semantics), but in C++ you literally have to keep thinking about them or your program
861.
▲
by
dbaupp
10y ago
You can do exactly the same thing in Rust, just not in the same statement as importing the functions (which are just that, importing the functions). I regard this as one of the most powerful parts of Rust: wrapping unsafe code/APIs int
862.
▲
by
dbaupp
10y ago
I feel like this is taking a very rosy-eyed view of C++. C++ has a massive amount of accidental complexity. To mention just two: the difference between () and {} initialisation (for some types) especially in the presence of perfect forwardi
863.
▲
by
dbaupp
10y ago
The `.windows(usize)` function almost does this, but it uses a runtime width and so has to yield slices rather than tuples.
864.
▲
by
dbaupp
10y ago
A language allowing high performance code doesn't mean it automatically guarantees high performance code. The latter is essentially impossible. One common pitfall is not turning the optimiser on (with --release for cargo) i.e. benchmar
865.
▲
by
dbaupp
10y ago
The default answer for "is there a X to Y?" converter for text formats is pandoc, so one could possibly go markdown -(pandoc)-> texinfo -(makeinfo)-> info. I do not know if this is sufficiently high fidelity.
866.
▲
by
dbaupp
10y ago
The Go programming model is synchronous: the code executes an IO operation and that thread of execution halts until the operation completes. The Go runtime is implemented using asynchronous IO internally, and manages scheduling between thre
867.
▲
by
dbaupp
10y ago
The blocking (i.e. synchronous) syscalls for IO are doing asynchronous things internally, they just wait for the event to finish before returning. The kernel can even do similar scheduling things to a language runtime, e.g. when a thread do
868.
▲
by
dbaupp
10y ago
Lambdas in C++ are almost identical to Rust ones (each closure is a unique unnameable struct containing the captures, with an overloaded operator()), in fact, the current Rust scheme was explicitly inspired by C++11 closures. Historically (
869.
▲
by
dbaupp
10y ago
I believe it goes straight to LLVM IR.
870.
▲
by
dbaupp
10y ago
As discussed elsewhere in this thread, the most direct translation of that code would also be a linked list of futures, but I don't see an alternative for that sort of structure in general (i.e. every scheme for this sort of asynchrony
More ›