Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pcwalton
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
41 ms
·
541.
▲
by
pcwalton
4y ago
It's perfectly reasonable to take the position that it's deeply problematic for a language aiming for wide use in 2022 to not be memory safe. There's no requirement that you "focus on tradeoffs", especially since re
542.
▲
by
pcwalton
4y ago
> Lacking an unsafe keyword does make it more unsafe, but in my experience, not very much. The problem is not "lacking an unsafe keyword", it's that Zig is not memory safe . Not being memory safe, in my experience, makes
543.
▲
by
pcwalton
4y ago
How is Spark2014 easier to understand than Rust? The borrowing rules [1] are more or less the same. [1]: https://docs.adacore.com/spark2014-docs/html/ug/en/source/la...
544.
▲
by
pcwalton
4y ago
Memory safety isn't in conflict with low-level control over memory layout.
545.
▲
by
pcwalton
4y ago
The fact that this doesn't seem exploitable shows the value of defense in depth: although numerous safety measures were defeated, exploitation was ultimately blocked by a guard page. If that guard page hadn't been there, the outco
546.
▲
by
pcwalton
4y ago
Well, let's turn this around. Is C++ spatially memory safe? C++20 has slices (ranges). They're bounds checked, via the .at() method. You can get the integer overflow semantics of Zig with "-fsanitize=signed-integer-overflow -
547.
▲
by
pcwalton
4y ago
> Rust has the same thing. In Rust all of those features are delineated by unsafe. For one, you can disable unsafe with a compiler switch; Zig has no such equivalent feature. Moreover, we shouldn't assume that Zig pointers are the o
548.
▲
by
pcwalton
4y ago
> rust is not well-suited for interfacing with FFI That's a surprising comment, given the massive deployments of hybrid Rust/C++ apps at huge scale that exist! Does Zig have any equivalent to cxx for interfacing with C++ code?
549.
▲
by
pcwalton
4y ago
> you get used to it after some time - much better than for example rust, where you have to figure out all the lifetimes, muts and generic traits before. They aren't comparable. Everything you mentioned in Rust is necessary for type
550.
▲
by
pcwalton
4y ago
I didn't say that multi-element pointers were a bad feature, simply that they're a counterexample to the claim that Zig has spatial memory safety. Generally in memory-safe languages the corresponding features are behind some kind
551.
▲
by
pcwalton
4y ago
> Zig has full spatial memory safety, which is already a huge improvement over C. I don't believe this is true. Zig has pointers to unknown numbers of items, which don't seem bounds checked: https://ziglang.org/
552.
▲
by
pcwalton
4y ago
-Werror by default would still be mildly annoying, but I'd like it a lot better than what Go and Zig do. At least then I could shell alias "go" to "go -Wno-error".
553.
▲
by
pcwalton
4y ago
You realize that these are notable because they're so rare, right? The vast majority of these would never even be filed as CVEs in C++. Like, consider https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-4569...
554.
▲
by
pcwalton
4y ago
> The borrow checker doesn't stop most memory errors, just the easy ones at the cost of making it painful to write basic data structures. This is completely untrue. Anyone who has maintained a large Rust project and a large C++ proj
555.
▲
by
pcwalton
4y ago
> Third: There are a lot of cases where the cost of memory safety just isn't that high, and Zig's mitigations are more than sufficient. But then why not just use a GC'd language? It isn't 1995 anymore; most apps are
556.
▲
by
pcwalton
4y ago
Yeah, in general macros allow for Rust to do these things just fine. I wouldn't say that it's a fair statement at all.
557.
▲
by
pcwalton
4y ago
> Expecting downvotes still because it is criticizing progressives. The guidelines ask you not to do this.
558.
▲
by
pcwalton
4y ago
> It's turn based, so I don't need AAA game multi-threaded performance. Then you could just use a GC'd language. For example, you could use C# in Unity.
559.
▲
by
pcwalton
4y ago
> when the site’s back up, I’ll grab the screens of users in Hector’s streams that use the same exact eccentric writing style Byuu/Near did. That's more than a bit creepy. Please reconsider the lengths you're willing to go
560.
▲
by
pcwalton
4y ago
I mean, if the conclusion is "you shouldn't assume that JavaScript code is free of memory safety problems", that's absolutely true. JavaScript is a memory safe language, but the VM that executes it, and the native code t
561.
▲
by
pcwalton
4y ago
Obviously artists provide business value. That's why there is such a thing as the entertainment industry.
562.
▲
by
pcwalton
4y ago
A lot of people would say the same about programmers.
563.
▲
by
pcwalton
4y ago
> A national abortion ban can’t get 60 votes in the Senate. David Shor: "Unless we see big structural changes in the Democratic party's coalition, then the modal outcome for 2024 is Donald Trump winning a filibuster-proof trif
564.
▲
by
pcwalton
4y ago
Skia has code paths for everything: CPU path drawing, CPU tessellation followed by GPU rasterization with special paths for convex vs. concave paths, NV_path_rendering, Spinel/Skia Compute... It's actually hard to figure out what
565.
▲
by
pcwalton
4y ago
> You are literally talking to the Pathfinder author. No worries, I think they know :) And yeah, I considered doing fancier partitioning, but really toward the end (before work stopped due to layoffs) I was pushing on shipping, which me
566.
▲
by
pcwalton
4y ago
IIRC Loop-Blinn gives you a pretty good distance approximation using the 2D generalization of Newton's method to avoid having to solve the quintic. (Though I've never actually seen anybody implement Loop-Blinn for cubics because t
567.
▲
by
pcwalton
4y ago
This is essentially how Pathfinder works, with 16x16 tiles instead of 32x32. It also has a pure-GPU mode that does tile setup on GPU instead of CPU, which is a nice performance boost, though a lot more complex. Note that if you're doin
568.
▲
by
pcwalton
4y ago
Can a XOR-only decompressor do the standard LZ77 trick of encoding many repeated bytes with a copy operation that refers to not-yet-decompressed data? It seems to me that you'd have to have a lot of 0 patch bytes for that. Huffman codi
569.
▲
by
pcwalton
4y ago
The definition of money laundering is concealing the origin of money obtained from an illegal source. You may not like the fact that this is illegal, but it has a clear definition and most people want it to be outlawed, so it is. It's
570.
▲
by
pcwalton
4y ago
Yes, that "clear set of logical rules" is called the Rust ownership and lifetime system, and the system that enforces it is called the borrow check. And, having designed a lot of Rust's borrow rules, I'm telling you that
More ›