Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pcwalton
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
pcwalton
1y ago
But Unity game objects are the same way: you allocate them when they spawn into the scene, and you deallocate them when they despawn. Accessing them after you destroyed them throws an exception. This is exactly the same as entity IDs! The G
32.
▲
by
pcwalton
1y ago
> We were writing an animation system in Bevy and were hit by the painful upgrade cycle twice. I definitely sympathize with the frustration around the churn--I feel it too and regularly complain upstream--but I should mention that Bevy d
33.
▲
by
pcwalton
1y ago
Most game engines other than the latest in-house AAA engines are leaving comparable levels of performance on the table on scenes that really benefit from GPU-driven rendering (that's not to say all scenes, of course). A Google search
34.
▲
by
pcwalton
1y ago
> Just a mode to automatically coerce between numeric types would make Rust so much more ergonomic for gamedev. C# is stricter about float vs. double for literals than Rust is, and the default in C# (double) is the opposite of the one yo
35.
▲
by
pcwalton
1y ago
> Nobody has really pushed the performance issues. This is clearly false. The Bevy performance improvements that I and the rest of the team landed in 0.16 speak for themselves [1]: 3x faster rendering on our test scenes and excellent per
36.
▲
by
pcwalton
1y ago
> Do people actually travel between SF and LA? Yes. The most obvious example of a company that's built around that corridor is Netflix: tech in the Bay Area, film production in L.A.
37.
▲
by
pcwalton
1y ago
> I do not understand how people expect to write convincingly that tools that reliably turn slapdash prose into median-grade idiomatic working code "provide little value". Honestly, I'm curious why your experience is so di
38.
▲
by
pcwalton
1y ago
> The OP cites these ( https://github.com/devkitPro/libogc/blob/52c525a13fd1762c103 ... and https://github.com/atgreen/RTEMS/blob/2f200c7e642c214accb7cc ...), but that's h
39.
▲
by
pcwalton
1y ago
That statement seems extremely hyperbolic. Just today I tried automating some very pedestrian code for a system that wasn't particularly well-documented and ChatGPT 4o hallucinated the entire API . It was deeply frustrating and wasted
40.
▲
by
pcwalton
1y ago
I'm a Rust compiler author, and I'm fully in favor of "UB exploitation". In fact, LLVM should be doing more of it. LLVM shouldn't be holding back optimizations in memory-safe languages for edge cases that don't
41.
▲
by
pcwalton
1y ago
That example is an instance of unspecified vs. undefined behavior, but the correctness of the pointer provenance-based optimization example I gave doesn't depend on whether writing to an out-of-bounds pointer is unspecified or undefine
42.
▲
by
pcwalton
1y ago
Hence why I (and many other compiler developers) are inherently skeptical whenever anyone says "just stop exploiting undefined behavior".
43.
▲
by
pcwalton
1y ago
"Exploiting undefined behavior" occurs when a simple semantics (however one defines "simple") results in behavior A, but the compiler chooses behavior B instead based on the actual, more complex, language semantics. The
44.
▲
by
pcwalton
1y ago
Note that if you change the code to this you have the same issue: int g(int n) { int arr[3], i = 0; arr[n] = 5; return i; } Without "exploiting UB" it's incorrect to optimize this to "
45.
▲
by
pcwalton
1y ago
Yeah, I would have liked to see the paper specify whether the LTO they tried is fat LTO or ThinLTO.
46.
▲
by
pcwalton
1y ago
At FAANG scale the cost is prohibitive. Hence the investment in ThinLTO.
47.
▲
by
pcwalton
1y ago
I notice that the paper doesn't claim to eliminate all reasoning about undefined behavior for optimizations. For example: int f() { int arr[3], i = 0; arr[3] = 5; return i; } Optimizing this to &q
48.
▲
by
pcwalton
1y ago
Nice to see this finally out! I wrote much of the GPU-driven rendering code for this release, which really helps Bevy's rendering performance with large scenes.
49.
▲
by
pcwalton
1y ago
I'm surprised that the article didn't mention that Richard Garfield (creator of Magic ) himself has a Ph.D. in combinatorial mathematics. I imagine that, if he's aware of this, that he'd get a kick out of it.
50.
▲
by
pcwalton
1y ago
My feeling is that dependent types add complexity to a language that's already well-known for having a complex type system, so I'm nervous about blowing the complexity budget. But I'm bullish on tools like Verus, Prusti, and
51.
▲
by
pcwalton
1y ago
You can mutate variables at compile time in D. See the compile time Newton's method example: https://tour.dlang.org/tour/en/gems/compile-time-function-ev...
52.
▲
by
pcwalton
1y ago
> The important thing is that the feature performs the duty of those other features. Zig's comptime doesn't do everything that Rust (or Java, or C#, or Swift, etc.) generics do, and I know you know this given your background in
53.
▲
by
pcwalton
1y ago
I tried ChatGPT 4o to help me reverse engineer some game code with the symbols missing and the results were quite disappointing. To say it had a tendency to hallucinate is an understatement. It didn't have any clue what was going on. F
54.
▲
by
pcwalton
1y ago
The point is that comptime isn't dependent types at all. If your types can't depend on runtime values, they aren't dependent types. It's something more like kind polymorphism in GHC (except more dynamically typed), somet
55.
▲
by
pcwalton
1y ago
That's still just a function of type ∀K∀L.K → L with a bound on K. From a type theory perspective, a comptime argument, when the function is used in such a way as to return a type, is not a value, even though it looks like one. Rather,
56.
▲
by
pcwalton
1y ago
I think another way to put it is that the fact that Zig reuses the keyword "comptime" to denote type-level parameters and to denote compile-time evaluation doesn't mean that there's only one feature. There are still two
57.
▲
by
pcwalton
1y ago
> This is one half of the innovation, dependent-types lite. But that's not dependent types. Dependent types are types that depend on values. If all the arguments to a function are either types or values, then you don't have dep
58.
▲
by
pcwalton
1y ago
But Zig's comptime only approximates the features you mentioned; it doesn't fully implement them. Which is what the original article is saying. To use your analogy, using a touchscreen to eliminate a keyboard isn't very impre
59.
▲
by
pcwalton
1y ago
Well, if you strip away the curly braces and return statement, that's just a regular type definition. Modeling generic types as functions from types to types is just System F, which goes back to 1975. Turing-complete type-level program
60.
▲
by
pcwalton
1y ago
When we're responding to quite valid points about other languages having essentially the same features as Zig with subjective claims about ergonomics, the idea that Zig comptime is "revolutionary" is looking awfully flimsy. I
More ›