Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
skitter
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
13 ms
·
121.
▲
by
skitter
3y ago
Funnily enough I did the same in an early wip version of my toy JVM. Ended up using unsafe to use 'static references internally but only hand out wrappers that include a reference to the JVM. This also ensures that objects/classes
122.
▲
by
skitter
3y ago
Is this an instance of Cole's law: The fastest way to get the right answer is to post the wrong answer?
123.
▲
by
skitter
3y ago
As the top level comment was about knowing the length of a string: GTA Online's loading times were atrocious because of a null-terminated string.
124.
▲
by
skitter
3y ago
They might need to contact their RelationYoungerCousinMothersSiblingsDaughterOrFathersSistersDaughter[1] [1] https://developer.apple.com/documentation/contacts/cnlabelco...
125.
▲
by
skitter
3y ago
Is this the case here too though? My impression was that dynamic languages grew popular because of deficiencies in static type systems, making it hard to express things while requiring a lot of boilerplate and not providing enough runtime s
126.
▲
by
skitter
3y ago
Not quite what I was getting at: On an implementation with 32-bit ints, the code is valid – the values get promoted to 32 bit, added and then truncated to 16 bit. Yet on a platform with 16-bit ints (and microchips & unusual platforms is
127.
▲
by
skitter
3y ago
I agree with your point about Python, which is why I'm glad type hints see adoption but dismayed that they're essentially fancy comments that don't enforce the actual runtime types. The thing is, I'm not convinced avoidi
128.
▲
by
skitter
3y ago
> The AI tools know how to generate good C code Are you sure about that? ChatGPT doesn't understand C. It wouldn't even have enough context to reason about UB even if it understood UB.
129.
▲
by
skitter
3y ago
There might just be new functionality added with no change to existing behavior. And sure, someone might rely on undocumented behavior[1], but that's a bug in their program – nobody can reasonably complain that you've improved per
130.
▲
by
skitter
3y ago
What do you think about e.g. Roc having whole-program type inference that always works and always infers the most general types?
131.
▲
by
skitter
3y ago
I'm confused — how would one use exceptions if not for control flow?
132.
▲
by
skitter
3y ago
Do you need to directly access it – isn't JS glue code (such as provided via Emscripten) enough?
133.
▲
by
skitter
3y ago
I think a bigger difference is that the XML is parsed by a Ruby program and the generated Ruby code is parsed by a C program.
134.
▲
by
skitter
3y ago
The borrow checker rejects many otherwise valid programs. So if you do your job in correctly in C/C++, the borrow checker might accept the Rust equivalent or it might not.
135.
▲
by
skitter
3y ago
For files, it's not that wrong – copying can be seen as a two step process of selecting what to copy and then where to copy it to, at which point the copy is actually performed. Undoing only the first part wouldn't undo the copy.
136.
▲
by
skitter
3y ago
Relatedly the JVM specification section 4.4.5 says (as the same holds for the cp and stack): In retrospect, making 8-byte constants take two constant pool entries was a poor choice.
137.
▲
by
skitter
3y ago
Sadly Go doesn't force you to handle the error (this passes go vet): a, err := strconv.Atoi("blah") b, err := strconv.Atoi("123") if err != nil { log.Fatal(err) } return a + b This c
138.
▲
by
skitter
3y ago
With browsers being operating systems that do sandboxing by default. If I know I want to run an app, I prefer a native version, but browsers are superior for trying things out.
139.
▲
by
skitter
4y ago
This might be about ACPI's Windows Platform Binary Table, which allows malware like Superfish to persist across installations.
140.
▲
by
skitter
4y ago
You cannot e.g. store a string as a slice of another string (unless the slice reaches the end).
141.
▲
by
skitter
4y ago
I recently deleted my Windows partition, but I recall how after an update it blocked me from login in until it could tell me I really should try out Office 365, informed me Edge is better for me than whatever browser I was using (Firefox) a
142.
▲
by
skitter
4y ago
That would be great if it was possible, but how do you specify & implement sensible behavior for this: void foo(int *a, int b) { a[b] = 1} At runtime there is no information about whether that write is in bounds and no way to p
143.
▲
by
skitter
4y ago
As far as I know, the C standard reserves words that - start with two underscores - start with one underscore (file scope) - start with is, to, str, mem, atomic_ or a bunch of other prefixes and continue with a lower case letter, consist of
144.
▲
by
skitter
4y ago
I'm curious, why focus entirely on parsing? I only read parts of the Dragon Book, but it didn't go in much detail about other topics, such as types, either. Couldn't you just use a very simple syntax such as S-expressions or
145.
▲
by
skitter
4y ago
There's a recent paper¹ claiming Kahneman & Deaton's study was flawed and happiness does increase above $75k/year. ¹ https://www.pnas.org/doi/epdf/10.1073/pnas.2208661120
146.
▲
by
skitter
4y ago
Go has it's own fundamental problems. Something very basic that turns me off is what happens to the original slice when appending to a it (done by calling append(slice, item) and using the result). Does it get modified? It may or it ma
147.
▲
by
skitter
4y ago
This is the most infuriating kind of answer: There are concrete complaints and this comment addresses none of them. Claiming that there are people who prefer Java's syntax to be inconsistent isn't useful without saying why they do
148.
▲
by
skitter
4y ago
Just holding an invalid reference is UB, even if you don't do anything with it (the example still works as the reference gets invalidated by safe code).
149.
▲
by
skitter
4y ago
As far as I can tell, Priority #1 is backwards compatibility. For example, std::regex can be slower than launching PHP and running the regex there¹, but that won't be fixed because it would require an ABI break. I'm not sure how t
150.
▲
by
skitter
4y ago
> if you keep more than one hard reference to an object around, it'll prevent collection Which is the behavior the parent comment asks for.
More ›