Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
demurgos
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
61.
▲
by
demurgos
2y ago
Rust statically enforces that you have exclusive access to a collection to mutate it. This prevents also having an active iterator. You also have languages using immutable or persistent data structures in their std lib to side-step the prob
62.
▲
by
demurgos
2y ago
Agreed that the type system treated `T` as nullable, but code may also have comments, annotations and invariants placing stronger constraints. This means that "a null may occur" also lived with "this won't ever be null b
63.
▲
by
demurgos
2y ago
You need an explicit marker for compat with legacy code. The issue defines unspecified as "a null may occur, but we don't know whether its presence is deliberate". Explicit nullability fixes the missing information in older c
64.
▲
by
demurgos
2y ago
There's some precedent in Kotlin, C# and PHP using a postfix marker for nullability. Overall it seems to work good there. Keep in mind that some types may be complex (e.g. when using generics) so using a keyword for the modifier may ca
65.
▲
by
demurgos
2y ago
> You can't look at this in a vacuum. By make a general purpose datetime library more complex, you risk the introduction of new and different types of errors by users of the library that could be much worse than the errors introduce
66.
▲
by
demurgos
2y ago
I'm not familiar with Mojo, so my understanding above was based on their blog post that you linked, and assumptions based on context. Checking their website, I find a sentence equating "identity" with "having an address&
67.
▲
by
demurgos
2y ago
This is about the "pit of success", being correct and predictable by default. A difference of timestamps not returning the corresponding elapsed wall-time is _very_ surprising. I want to be able to compute durations between timest
68.
▲
by
demurgos
2y ago
The main issue I have with existing time libraries, in Rust or other ecosystems is poor support for leap seconds. This is mostly caused by using UNIX timestamps instead of TAI internally, and this lib is no different unfortunately. There se
69.
▲
by
demurgos
2y ago
My understanding of _value identity_ refers to the `StableDeref`/yoke approach to self-regerential structs. The value is constructed at a stable address (usually some heap allocation) and you always access it through some pointer. The
70.
▲
by
demurgos
2y ago
There are reasons unrelated to pointer implementations such as the interval argument from Dijkstra's article or conversions between flat and multidimensional array indexes. There's a reason why most mathematical sequences start at
71.
▲
by
demurgos
2y ago
see schoolbook algorithm for the n^3 bound: https://en.wikipedia.org/wiki/Computational_complexity_of_ma... It comes from directly applying the definition of matrix multiplication on a square matrix.
72.
▲
by
demurgos
2y ago
As mentioned in the article, you can declare a binding named `undefined` and assign a value to it. This shadows the base `undefined` binding (since it's NOT a keyword). `void 0` ensures that you get the `undefined` value regardless of
73.
▲
by
demurgos
2y ago
It's pretty unfortunate that we ended up with system dependent newlines. This means that text files are not byte-for-byte the same across systems so comparisons or hashing need normalization. This also makes reliable line splitting les
74.
▲
by
demurgos
2y ago
It's definitely an issue, but it's also an improvement to the situation in other languages as the await points were cancellation is possible are visible in the code. One solution would be linear types that can't be dropped, b
75.
▲
by
demurgos
2y ago
One of the problems is that return types and exception types are not unified so it makes composition harder. `Result` brings exceptions into the regular type system
76.
▲
by
demurgos
2y ago
Ideally Docker would support a lockfile format so you don't have to manually manage the hashes. I'm still surprised how commonly people use named Docker tags when Docker Hub let's you mutate the corresponding image. In the me
77.
▲
by
demurgos
2y ago
This is more about nominal VS structural typing. I don't see how named parameters or namespacing would prevent accidental structural type matches.
78.
▲
by
demurgos
2y ago
The poll_progress post linked above explains the situation. When polling the overall stream, you alternate between awaiting in the buffered interface or in the subsequent adapters. This is because the different futures are not peers with re
79.
▲
by
demurgos
3y ago
I was refactoring a project serving user uploaded files yesterday, and had the occasion to test caching. Both Firefox and Chrome used ETag and If-None-Match properly to check and cache queries. Which problems did you encounter? There was st
80.
▲
by
demurgos
3y ago
I 100% agree. I tried a few workarounds to get the same result, but it quickly gets out of hand. The two main solutions I'm using is to define the individual variants as in your post, and then one enum per union I care about; even with
81.
▲
by
demurgos
3y ago
What I want is something similar to the switch from lexical to non-lexical lifetimes; but for enums and pattern matching. `@` is a construct depending on lexical scoping In following code, it would be nice if the second match could use the
82.
▲
by
demurgos
3y ago
I really enjoy Rust's enums; but I feel that that actually their integration could be even better. TypeScript's flow typing or Rust's work on pattern types [0] are better version of what we have currently. The main issue is t
83.
▲
by
demurgos
3y ago
First of all I agree that it's no big deal. But it's also a nice convenience feature; I'm pretty happy that my computer works for me automatically. Then to reply to your points. I don't use a VPN, but I regularly travel
84.
▲
by
demurgos
3y ago
Thank you for mentioning point 7.3 this as it's a very important, but gets often ignored. I hope that it gets strictly enforced. _It shall be as easy to withdraw as to give consent._ Regarding the link you posted, they have a banner at
85.
▲
by
demurgos
3y ago
On a laptop, it avoids forgetting to update it when travelling.
86.
▲
by
demurgos
3y ago
Really sad to see it go. It powers KDE Plasma's geolocation for its Night Colors feature among other FOSS projects.
87.
▲
by
demurgos
3y ago
Oh that's great. I always used the following `.gitattributes`: # Enforce `lf` for text files (even on Windows) * text=auto eol=lf I'll try your config too. My current position is that anywhere you can choose between C
88.
▲
by
demurgos
3y ago
I really enjoyed this Minute Physics and 3Blue1Brown video describing hidden variables and Bell's theorem: https://www.youtube.com/watch?v=zcqZHYo7ONs As you said, it's implies that we're not failing to measu
89.
▲
by
demurgos
3y ago
The original report was discussed a few days ago in https://news.ycombinator.com/item?id=39237567
90.
▲
by
demurgos
3y ago
They could, but for compatibility reasons it would be opt-in. The strength of Rust is that you can't opt out of the borrow-checker (even with unsafe).
More ›