Readit News logoReadit News
klodolph commented on Go is still not good   blog.habets.se/2025/07/Go... · Posted by u/ustad
xyzzyz · 3 days ago
Imagine that you're writing a function that'll walk the directory to copy some files somewhere else, and then delete the directory. Unfortunately, you hit this

https://github.com/golang/go/issues/32334

oops, looks like some files are just inaccessible to you, and you cannot copy them.

Fortunately, when you try to delete the source directory, Go's standard library enters infinite loop, which saves your data.

https://github.com/golang/go/issues/59971

klodolph · 2 days ago
IMO the right thing to do here is even messier than Go’s approach, which is give people utf-16-ish strings on Windows.
klodolph commented on Go is still not good   blog.habets.se/2025/07/Go... · Posted by u/ustad
Kinrany · 3 days ago
> You validate that strings are UTF-8 at the place where you care that they are UTF-8.

The problem with this, as with any lack of static typing, is that you now have to validate at _every_ place that cares, or to carefully track whether a value has already been validated, instead of validating once and letting the compiler check that it happened.

klodolph · 3 days ago
In practice, the validation generally happens when you convert to JSON or use an HTML template or something like that, so it’s not so many places.

Validation is nice but Rust’s principled approach leaves me high and dry sometimes. Maybe Rust will finish figuring out the OsString interface and at that point we can say Rust has “won” the conversation, but it’s not there yet, and it’s been years.

klodolph commented on Go is still not good   blog.habets.se/2025/07/Go... · Posted by u/ustad
duckerude · 3 days ago
The big problem isn't invalid UTF-8 but invalid UTF-16 (on Windows et al). AIUI Go had nasty bugs around this (https://github.com/golang/go/issues/59971) until it recently adopted WTF-8, an encoding that was actually invented for Rust's OsStr.

WTF-8 has some inconvenient properties. Concatenating two strings requires special handling. Rust's opaque types can patch over this but I bet Go's WTF-8 handling exposes some unintuitive behavior.

There is a desire to add a normal string API to OsStr but the details aren't settled. For example: should it be possible to split an OsStr on an OsStr needle? This can be implemented but it'd require switching to OMG-WTF-8 (https://rust-lang.github.io/rfcs/2295-os-str-pattern.html), an encoding with even more special cases. (I've thrown my own hat into this ring with OsStr::slice_encoded_bytes().)

The current state is pretty sad yeah. If you're OK with losing portability you can use the OsStrExt extension traits.

klodolph · 3 days ago
Yeah, I avoided talking about Windows which isn’t UTF-16 but “int16 string” the same way Unix filenames are int8 strings.

IMO the differences with Windows are such that I’m much more unhappy with WTF-8. There’s a lot that sucks about C++ but at least I can do something like

  #if _WIN32
  using pathchar = wchar_t;
  constexpr pathchar sep = L'\\';
  #else
  using pathchar = char;
  constexpr pathchar sep = '/';
  #endif
  using pathstring = std::basic_string<pathchar>;
Mind you this sucks for a lot of reasons, one big reason being that you’re directly exposed to the differences between path representations on different operating systems. Despite all the ways that this (above) sucks, I still generally prefer it over the approaches of Go or Rust.

klodolph commented on Go is still not good   blog.habets.se/2025/07/Go... · Posted by u/ustad
jerf · 3 days ago
While the general question about string encoding is fine, unfortunately in a general-purpose and cross-platform language, a file interface that enforces Unicode correctness is actively broken, in that there are files out in the world it will be unable to interact with. If your language is enforcing that, and it doesn't have a fallback to a bag of bytes, it is broken, you just haven't encountered it. Go is correct on this specific API. I'm not celebrating that fact here, nor do I expect the Go designers are either, but it's still correct.
klodolph · 3 days ago
This is one of those things that kind of bugs me about, say, OsStr / OsString in Rust. In theory, it’s a very nice, principled approach to strings (must be UTF-8) and filenames (arbitrary bytes, almost, on Linux & Mac). In practice, the ergonomics around OsStr are horrible. They are missing most of the API that normal strings have… it seems like manipulating them is an afterthought, and it was assumed that people would treat them as opaque (which is wrong).

Go’s more chaotic approach to allow strings to have non-Unicode contents is IMO more ergonomic. You validate that strings are UTF-8 at the place where you care that they are UTF-8. (So I’m agreeing.)

klodolph commented on AI is predominantly replacing outsourced, offshore workers   axios.com/2025/08/18/ai-j... · Posted by u/toomuchtodo
pluc · 7 days ago
Except AI support agents are only using content that is already available in support knowledge bases, making the entire exercise futile and redundant. But sure, they're eloquent while wasting your time.
klodolph · 7 days ago
Most of my questions are answerable from the support knowledge base.
klodolph commented on I Prefer RST to Markdown (2024)   buttondown.com/hillelwayn... · Posted by u/shlomo_z
betaby · 8 days ago
'asciidoc' is the middle ground.
klodolph · 8 days ago
I think of it less like the middle ground, and more like the best of the three

asciidoc > rst > markdown

It’s just that the available tooling goes the opposite way,

markdown tooling > rst tooling > asciidoc tooling

I end up using HTML for anything serious instead, because it has better tooling support than any of the three, and is also more flexible. It’s just more verbose, which is fine.

klodolph commented on PHP compile time generics: yay or nay?   thephp.foundation/blog/20... · Posted by u/moebrowne
fuzzy_biscuit · 15 days ago
I don't take issue with the naming but with the names that feel a bit beyond my ken. "Erased" makes sense when explained but not before. "Reified" is a word I simply do not use so it feels like academia run amok.

Regardless, I recognize myself as the point of failure, but those names do strike me as academia speak, though better than some/many. <shrug>

klodolph · 15 days ago
Another shrug, but part of it is that the PL community (programming language community) is pretty deep into its own jargon that doesn’t have as much overlap as you might think, with other subfields of computer science.

People describe a type system as “not well-founded” or “unsound” and those are specific jabs at the axioms, and people talk about “system F” or “type erasure” or “reification”. Polymorphism can be “ad-hoc” or “parametric”, and type parameters can be invariant, covariant, and contravariant. It’s just a lot of jargon and I think the main reason it’s not intuitive to people outside the right fields is that the actual concepts are mostly unfamiliar.

klodolph commented on The Gentoo Perl versioning scheme   wiki.gentoo.org/wiki/Proj... · Posted by u/RGBCube
aap_ · a month ago
Where is perl being used today? I imagine it has a diehard community, but it's not very publicly visible these days.
klodolph · a month ago
If you have a Linux system, try this:

    find / -name 'perl*' -prune -o -name '*.pl' -print 2>/dev/null
You will probably find a bunch of random scripts in various places. A lot of random system admin stuff got written in Perl, and those stick around for a long time. There is also a ton of miscellaneous software tooling that got written in Perl, like scripts to generate some C code that you compile.

Perl sometimes still gets used because it’s available on systems that don’t have Python.

klodolph commented on XAI seeks up to $200B valuation in next fundraising   ft.com/content/25aab987-c... · Posted by u/andsoitis
lemoncookiechip · a month ago
I find it odd that investors are still so motivated to drop money into AI, specifically LLMs, not because I don't see value in the technology, I do, but because it feels to me like it only takes a few months (if that) for your company which might currently dominate with the leading product, to be left behind by someone else who just came out with a better, cheaper, and faster product.

I guess this is true for most tech, but with LLMs it seems to be at a pace that just doesn't feel worth it to invest knowing someone else will just leap over your investment soon, and that in a year or two, when you want some return (maybe longer), that your tech might have completely stagnated and completely left behind by everyone else's. I dunno, just a weird thought.

klodolph · a month ago
My top suspicion is that xAI’s valuation is more about moving money around and less about belief in the actual underlying xAI projects.
klodolph commented on A Virginia public library is fighting off a takeover by private equity   lithub.com/a-virginia-pub... · Posted by u/sharkweek
potato3732842 · 2 months ago
The "profit" isn't money in the bank. It's overpaid bullshit jobs and work and perks that benefit the people in and around the organization.

It makes me understand better how the horrors of the history books came to be when the same exact demographics who'll complain about nominally nonprofit hospitals or educational institutions paying their people insane sums and doing random BS to burn money or comparable behavior from charity entities set up as tax shields by the wealthy refuse to see that having a profit cap creates an incentive for the insurance industry to behave the same way.

klodolph · a month ago
That second paragraph is a wild ride. I don’t think you’ve gotten a good understanding of history if this is how you’re connecting things.

u/klodolph

KarmaCake day24984August 31, 2009
About
Negative, I am a meat popsicle.
View Original