Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
skitter
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
skitter
2y ago
I believe post-monomorphization errors don't show in cargo check, and those are rather rare in Rust.
32.
▲
by
skitter
2y ago
The vec already gets allocated with capacity == length https://doc.rust-lang.org/nightly/src/alloc/slice.rs.html#16...
33.
▲
by
skitter
2y ago
merde_json should also be relatively small.
34.
▲
by
skitter
2y ago
We do in fact talk about technologies that don't exist. Creating new technologies would be rather difficult otherwise.
35.
▲
by
skitter
2y ago
Adding an enum variant can be backwards incompatible just as easily in languages that don't do this, you just don't get to see the error at compile time.
36.
▲
by
skitter
2y ago
According to Stroustrup & co, it's less: They see a good dev optimistically writing 2k lines of finished non-test code a year , and that's when rewriting code ¹, so that checks out! (To be clear, I'm joking and agree w
37.
▲
by
skitter
2y ago
I agree that list comprehensions aren't any easier to read. A proper streaming interface on the other hand lets you easily follow how the data is transformed: foo .stream() .filter(x -> x.contains("banned"
38.
▲
by
skitter
2y ago
The type checker is specified in Prolog and rejects the above scenario: instructionIsTypeSafe(fadd, Environment, _Offset, NextStackFrame, ExceptionStackFrame) :- validTypeTransition(Environment, [float, float], float, StackFr
39.
▲
by
skitter
2y ago
I think it's appropriate linking directly to Kriesel's blog¹ or his talk, as that's about the scanner creating fake data and not about rce. Though technically it too is not an OCR bug as there's no ocr in JBIG2. ¹: http
40.
▲
by
skitter
2y ago
Afaik the import sets the module in the importing module's context only after the code in the imported module is run. Edit: Oh, you don't mean in the importing module's globals, you mean `sys.modules`. Yeah that works!
41.
▲
by
skitter
2y ago
Time team's great, glad to see them back.
42.
▲
by
skitter
2y ago
Maybe it's because I don't use it that intensely, but I've found the default a bit noisy, so I switched my default layout to only contain `pane` and turned pane frames off.
43.
▲
by
skitter
2y ago
> Well, make a choice and write it down. Or don't and don't allow unnecessary ambiguity. For * and +, there's a agreed upon order of operations far more universal than a programming language, but it's sensible to use
44.
▲
by
skitter
2y ago
Compilers don't claim that part of the standart doesn't exist, they just go eith option 1: Ignoring the situation. E.g. if one branch of an if-statement is UB, compilers ignore that that branch can happen and only need to compile
45.
▲
by
skitter
2y ago
Related, this article discusses difference generators and tradeoffs for Go using them as Source: https://zephyrtronium.github.io/articles/randomness.html
46.
▲
by
skitter
2y ago
Pedants would say that null pointers exist in safe Rust too.
47.
▲
by
skitter
2y ago
> This sounds good when the system is small and tight and applications are written mostly by people who designed the whole system. I think that's intentional because that's what Hubris is aimed at.
48.
▲
by
skitter
2y ago
Impressively, there's Mess Detector, a machine built in Minecraft itself that predicts the internal state of the rng, using the position a lit tnt (instead of a block drop): https://www.youtube.com/watch?v=FPmQ0rnJjNc
49.
▲
by
skitter
3y ago
> it's a local binding getting bound to different values on each scope entry. It is, I just wanted to point out that the term "immutable variable" is sensible. I think a good way to put it is that b is a variable, and whe
50.
▲
by
skitter
3y ago
Immutable variable isn't a oxymoron. It can still vary between instantiations. If you have (a)=>{const b = a}, b can have different values even though it can't be reassigned.
51.
▲
by
skitter
3y ago
Sadly enums are too advanced of a concept to be included in Go.
52.
▲
by
skitter
3y ago
And Rc can still be useful for multithreaded programs. Not every value needs to be shared between threads.
53.
▲
by
skitter
3y ago
Thanks! So it is/was indeed UB.
54.
▲
by
skitter
3y ago
I don't think it's undefined behavior though. Looking at (the working draft of) the C ISO standard, I don't see a requirement that the comparison function must be transitive. The closes thing there is 7.22.5.2 §4: "If tw
55.
▲
by
skitter
3y ago
They already mention the issue of using substraction for comparison; here's another different accidentally intransitive comparison function: int cmp(const float *a, const float *b) { if (*a < *b) { return 1
56.
▲
by
skitter
3y ago
Valgrind can only detect this for single executions, not for all possible ones.
57.
▲
by
skitter
3y ago
> C can teach you useful things, like how memory is a huge array of bytes Careful: In C, memory isn't a huge array of bytes.
58.
▲
by
skitter
3y ago
> panic = very serious problem, what do you expect? Even the Go standard library itself panics (and recovers) when you try to e.g. json-encode a NaN, which doesn't seem like something that should make the system unstable.
59.
▲
by
skitter
3y ago
Shouldn't this simply return true instead of throwing?
60.
▲
by
skitter
3y ago
Afaik for C & C++, that's not true – you can turn const references into normal references and are even allowed to mutate the object they point to unless said object is declared as const.
More ›