Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
dbaupp
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
20 ms
·
181.
▲
by
dbaupp
7y ago
Similar to the C++, all of those are addressed by inserting lower-cased into the set, which can be achieved via an extra method call: set.insert(string.to_lowercase()) It also requires adjusting/deleting the type annotation on
182.
▲
by
dbaupp
7y ago
Huh, that is unfortunate!
183.
▲
by
dbaupp
7y ago
Why would moving a list have to allocate a new tail node? A lot of the value in moves is passing data around without having to copy/duplicate/allocate. The most useful aspect of having customisable move constructors like in C++ se
184.
▲
by
dbaupp
8y ago
If foo is an lvalue, then I believe (for example) *(foo[0].bar->baz) is also an lvalue, and those pointer dereferences can go anywhere. Those values occupy a location in memory, as you said, even if it isn't on the stack.
185.
▲
by
dbaupp
8y ago
Yes, section 8.2.1 "Value Category" (page 80) of the C++17 standard[0] defines the terms as: (1.1) - A glvalue is an expression whose evaluation determines the identity of an object, bit-field, or function. (1.2) - A prvalue is an
186.
▲
by
dbaupp
8y ago
The article starts by explaining lvalues and rvalues more precisely than that, and breaks them up into 3 additional value categories in modern C++ (the ones in the title). (Also, lvalues aren't tied to the stack: they can be anywhere i
187.
▲
by
dbaupp
8y ago
GHC Haskell offers in-source rewrite rules, which can be used to get this sort of deforestation optimisation: https://wiki.haskell.org/GHC/Using_rules Rust iterators (including the parallel ones in the Rayon library) a
188.
▲
by
dbaupp
8y ago
The compiler has implemented a lot of the infrastructure for reasoning about ownership, and has had optimisation for eliding reference counting operations for a long time (but the ownership stuff makes them simpler).
189.
▲
by
dbaupp
8y ago
Indeed, it is standard, but eliding the parentheses doesn't mean they aren't implicitly there, and doesn't turn non-associativity into non-commutativity. Commutivity means that these are equal: (((b + s) + s) + s) + s
190.
▲
by
dbaupp
8y ago
That sounds more similar to Swift's approach, where the compiler does aggressive optimisation to elide reference counts were possible. Do you agree?
191.
▲
by
dbaupp
8y ago
That is due to associativity. You're implicitly relying on a consistent left-to-right evaluation order, but the fundamental problem can be phrased as (using s for small and b for big): (((b + s) + s) + s) + s Can be different t
192.
▲
Terminal-to-HTML
(buildkite.github.io)
4 points
by
dbaupp
8y ago
|
1 comments
193.
▲
by
dbaupp
8y ago
Yeah, normalising and case folding will both potentially result in a new sequence of graphemes (and code points and code units), so slicing can't work.
194.
▲
by
dbaupp
8y ago
There's no fixed-width/non-allocating way to return a grapheme (unless one can return a slice into the original data, which cannot happen here), because they may consist of arbitrarily many codepoints (and code units) both in theo
195.
▲
by
dbaupp
8y ago
It seems to download the original source files, not PDFs, as described in https://arxiv.org/help/mimetypes
196.
▲
by
dbaupp
8y ago
Indeed, and the compiler still had the relicts of that functionality at least until Swift 4. I'm wondering how they got the impression Swift still has currying, given it sounded like a recent "discovery".
197.
▲
by
dbaupp
8y ago
It doesn't have automatic currying. What code/docs are you getting that impression from?
198.
▲
by
dbaupp
8y ago
The whole point of the article is that constant factors work in Hashbrown's favour.
199.
▲
by
dbaupp
8y ago
Yes, I suppose that's rather misleading, and that sentence contradicts with the actual behaviour that described later in the original comment. For a fixed set of dependencies, versions are only checked and changed on an explicit '
200.
▲
by
dbaupp
8y ago
You're misreading your parent. The download only happens for the first build using a new dependency. As they mention, once the version is written into the Cargo.lock file, that is the exact version that is used until there is an explic
201.
▲
by
dbaupp
8y ago
Yes: a GC means the programmer can avoid thinking about object lifetimes and just pretend every object lives forever. The garbage collector is deeply unsafe (as in, bugs may cause memory corruption): if a GC fails to account for even a sing
202.
▲
by
dbaupp
8y ago
I believe the blocks end up stored as an array-of-structs where the structs have 8*8 = 64 elements. Doing the DCT in multiple blocks requires somehow transposing this into a struct-of-arrays-like format, maybe a gather of every 64th element
203.
▲
by
dbaupp
8y ago
Yeah, other examples include image codecs, such as JPEG: the DCT performed on the 8x8 blocks can benefit from SIMD, but the lanes aren't independent at all (matrix transposes, various intra-block additions).
204.
▲
by
dbaupp
8y ago
That is a feature that is not yet implemented! Of course there may be unsolved questions. Neither of those are memory safety relevant. (A stack overflow is a reliable crash, not memory corruption, in Rust.)
205.
▲
by
dbaupp
8y ago
Java data structures are built on top of a pile of unsafe code (the JVM and especially the GC), in a similar manner to building things on top of the std data structures in Rust. For concurrency in particular the JVM exposes a more restricte
206.
▲
by
dbaupp
8y ago
I see no mention of memory safety or unsafety in the issue you linked. Could you be more specific?
207.
▲
by
dbaupp
8y ago
Oh, awesome! Thanks!
208.
▲
by
dbaupp
8y ago
There's the unsafety inherent to C, with the risks of bugs in the underlying library, and there's unsafety caused by misusing the API. Safe languages often provide enough power to make the latter impossible, for a C API that fits
209.
▲
by
dbaupp
8y ago
I think that's nice in theory, but not true in practice. If someone new to D comes across this post, their assumption will almost certainly be that this post comes from a place of deep expertise and represents some form of best practic
210.
▲
by
dbaupp
8y ago
If that's the case, I don't think it should be calling raptor_uri_copy, which allocates a whole new URI object (not just changing some reference counts). It could instead provide a "URI full_copy()" method that better mo
More ›