Protty
1.5K posts

Protty
@kingprotty
System optimizer + concurrency geek.
Katılım Ağustos 2019
79 Takip Edilen3.3K Takipçiler

@filpizlo @salty_grndpa memory-safety = no UB from memory op.
Fil-C turns LLVM memory-op-UB into panics.
Rust has its own lang-level memory-op-UB outside LLVM (shared-xor-mut ref liveness, strict provenance, !Unpin mut-ref aliasing). Plugging Fil-C to Rust isnt enough hence MIRI.
Zig=LLVM re:UB so ok
English

@salty_grndpa Fil-C is completely memory safe.
Rust isn’t (because unsafe). Zig isn’t (because uaf).
You can make Rust and Zig memory safe by having them adopt Fil-ABI.
Folks who understand memory safety know this. It’s not controversial
English

Now I do think that zig has lost the plot hard and it hurts because I initially like the concepts
Kai Fell@kai_fell
the author of Zig needs therapy
English

@filpizlo @dreamsofcode_io I run real rust programs; pulls in loads of crates but no C code,excluding libc ofc. AttackSurface here is unchecked mem-safety(unsafe) not security. Asked only about former for Fil-C & Rust, not special conditions(must be in prod or use C deps). "Fil-C safer" claim has asterisks
English

The point is, if you run a Rust program in production with Miri (which nobody does, but even if we ignore that) then the program’s attack surface includes every C dependency. And there will be many of those. Every real Rust program pulls in loads of C code.
If you run a C program in production in Fil-C (something people do), then the programs’s attack surface includes only the Fil-C runtime itself.
Therefore, Fil-C is safer.
But this is a super pointless discussion considering that nobody runs Miri in production
English

I read this issue earlier this morning and kinda feel sympathetic towards Andrew.
Bun’s rewrite to Rust has obviously impacted him (hence the “unlike Rust” comment).
Whilst that part is petty, it does seem to be driving him to find a solution for Zig.
Personally, I don’t think garbage collection is the right solution (1-6x perf impact), but even still, the fact he’s searching for one to improve Zig following one of its biggest negative events is commendable imho.
Either way, will be interesting to see where he lands.
Kai Fell@kai_fell
the author of Zig needs therapy
English

@filpizlo @dreamsofcode_io This seems unrelated to Rust itself. I thought the claim was that Fil-C was safer than (unsafe) Rust, which includes MIRI.
English

@kingprotty @dreamsofcode_io They’re not the same. If you have a C dependency the Fil-C does full capability tracking and checking, but Miri can’t.
English

@filpizlo @dreamsofcode_io They both crash the program at runtime-detected UB. Fil-C is definitely faster / more usable for prod, but does that detract from Rust having an option for similar safety guarantees?
English

@kingprotty @dreamsofcode_io Bad comparison. Miri is a checker. Fil-C is for production.
English

@filpizlo @dreamsofcode_io Rust includes MIRI; Are there edge cases that Fil-C traps against that MIRI doesnt? (esp. considering that MIRI handles data races, not just provenance races).
English

It’s necessary for those of us working on memory safety to pinpoint that we are doing something that isn’t like Rust, because Rust has an incomplete memory safety story while pretending to be memory safe (in the sense that internet experts will get upset if you point out Rust’s flaws).
So for those of us who understand memory safety, it is 100% necessary to draw the “unlike Rust” distinction.
English

@1_div_0 @antirez This has been my exp as well; Rigorously designing the higher-level view of the app/dataflow works, but then peek inside and it's holding locks over IO, copying megabytes worth of data accidentally, or (understandably) didnt employ some trick you know as someone more experienced
English

@antirez Last week I was working in a database and it coded something that was significantly less efficient than I would do. It wasn’t even a large change. If I didn’t read it, I would have never known that it was technically correct, but not what was desired. How does one deal with that?
English

@misterclayt0n @sibaiisaac Rust isnt a "correct" language. Its a "can't cause UB in safe mode" one. You can still have race conditions, leak memory, crash, etc. If the UB cases it addresses have been your primary failure modes, then it indeed can help with correctness.
English

@sibaiisaac because you can't out test bad language design. the bugs mentioned by the blog post should be not be possible in a correct language
English

to sum it up, in Andrew's vision:
> original bun was slop
> slop rewrite
> jarred is a bad manager and bad engineer
> he's happy bun is no longer in zig
tho I'm not the biggest fan of the rewrite, bun's blog post at least made some valid technical points (and somehow tried to praised zig quite a lot), which illustrated how lacking zig is, while Andrew is just being hostile for no reason at all
this reading feels like a complete waste of my time
Debasish (দেবাশিস্) Ghosh 🇮🇳@debasishg
Andrew's thoughts on the Bun Rust rewrite .. andrewkelley.me/post/my-though…
English

@swerverx402 @penberg Zig development/leadership != Zig community.
The biggest zig users are pretty unaligned, but they still use it because it's useful.
English

I like the Zig language, even started to build Turso with it. But the attitude towards losing Bun feels so hostile, I get the vibe like they want to remain a niche language, which is a stark contrast to C which they want to replace.
Debasish (দেবাশিস্) Ghosh 🇮🇳@debasishg
Andrew's thoughts on the Bun Rust rewrite .. andrewkelley.me/post/my-though…
English

@charliermarsh Nobody is rewriting anything in Zig or C, and it's going to be some of the worst Rust code you can imagine... but may still be an improvement over whatever it was ported from.
English
Protty retweetledi

Mind boggling to me that I can make a thing faster and there's always people that ask "but why?" What kind of mentality is that? The pursuit of excellence does not need justification. Also, I find in so many cases, we can't know the impact of an improvement until we do it.
For example, one I've talked about before: Ghostty's high IO throughput has enabled terminal program (emulator and TUI) fuzzing at a speed thats incomparably fast to prior solutions. This has resulted in upstream patches to resolve issues in popular projects like btop, tmux, and more.
Speed enabled that anecdotally example that lifted the tides of adjacent communities that don't rely on Ghostty technology at all. I didn't predict this.
Make things better because they can be better and let the results naturally play out.
English

@swenlei56 @valigo Its convenient & the ordering is defined in most other langs.
Here, it can just happen accidently:
# define F(x) f(x, x)
F(*ptr++)
English

@valigo @SolidBasis Should take a look at things like ControlNet, inpainting, img2img, regional prompts, and other forms of intentional visual generation. It's not that reductionist.
English

@SolidBasis > because you can definitely help shape things created by AI
Yeah, just like entering your opponent's moves into the Windows 7 chess bot.
English

@nuoji No: #Anonymous-Struct-Literals" target="_blank" rel="nofollow noopener">ziglang.org/download/0.6.0…
T{} is struct literal
.{} is anonymous (inferred) struct literal
For zig, it's 6y old now
English








