News for hackers. Stuff that matters.
Re:Fuzzing Zig Code Using AFL++ by flohofwoe on Thursday September 23, 2021 @06:35AM (#28627406)
Specialized string types like Path, CStr and OsStr are stdlib types though (as they should be), not built into the language (AFAIK at least). Such high level "API enforcement" types also make sense in Zig. The question is rather whether something like Rust's 'str' should be builtin or also provided in the stdlib.
Re:Fuzzing Zig Code Using AFL++ by maemre on Thursday September 23, 2021 @06:49PM (#28636553)
Oh, that makes sense as an interesting question. I think, similar to API enforcement types, it is a good idea to separate strings from "byte strings" if the "core" language/library uses strings (which Rust does as part of panic!, one can argue that panic! or assert! should not be part of the core though). It is a hard problem, as Python's transition to Python 3 showed.

str could have a part of "core" library.

Re:Fuzzing Zig Code Using AFL++ by volta83 on Thursday September 23, 2021 @07:33AM (#28627777)
Is Rust `str` builtin?

I thought it was just a `struct str([u8]);` (a dynamically-sized type).

Re:Fuzzing Zig Code Using AFL++ by steveklabnik on Thursday September 23, 2021 @08:10AM (#28628049)
It is built in. It was almost switched to be exactly that before 1.0, but IIRC it provided no real upsides and several downsides. There was a PR with the discussion but I can’t find it right now.