Readit News logoReadit News
GrantMoyer commented on Rv, a new kind of Ruby management tool   andre.arko.net/2025/08/25... · Posted by u/steveklabnik
dismalaf · 2 days ago
Please no types... They're worse than pointless for a dynamically typed language.
GrantMoyer · 2 days ago
Pyright catches an awful lot of dumb mistakes I make in Python.
GrantMoyer commented on Wildthing – A model trained on role-reversed ChatGPT conversations   youaretheassistantnow.com... · Posted by u/iamwil
GrantMoyer · 4 days ago
Is there any reason to explicitly train for role reversal? Can't you instead swap the input labels on any instruct tuned LLM? The model is trained on both sides of the chat log either way, right?
GrantMoyer commented on A deep dive into Rust and C memory interoperability   notashes.me/blog/part-1-m... · Posted by u/hyperbrainer
phkahler · 24 days ago
Something I'd like to know for mixing Rust and C. I know it's possible to access a struct from both C and Rust code and have seen examples. But those all use accessor functions on the Rust side rather than accessing the members directly. Is it possible to define a structure in one of the languages and then via some wrapper or definitions be able to access it idiomatically in the other language? Can you point to some blog or documentation explaining how?
GrantMoyer · 24 days ago
Rust bindgen[1] will automatically generate native Rust stucts (and unions) from C headers where possible. Note that c_int, c_char, etc. are just aliases for the corresponding native Rust types.

However, not all C constructs have idomatic Rust equivalents. For example, bitfields don't exist in Rust, and unlike Rust enums, C enums can have any value of the underlying type. And for ABI reasons, it's very commom in C APIs to use a pointer to an opaque type paired with what are effectively accessor function and methods, so mapping them to accessors and methods on a "Handle" type in Rust often is the most idomatic Rust representation of the C interface.

[1]: https://github.com/rust-lang/rust-bindgen

GrantMoyer commented on Vet is a safety net for the curl | bash pattern   github.com/vet-run/vet... · Posted by u/mooreds
sgc · a month ago
Given the conversations in this thread about the annoying package management that leads to so much use of curl | bash, I have a question: Which Linux distro is the least annoying in this regard? Specifically, I mean 1) packages are installed in a predictable location (not one of 3-5 legacy locations, or split between directories); 2) configuration files are installed in a predictable location; 3) Packages are up to date; 4) There is a a large selection of software in the repositories; 5) Security is a priority for the distro maintainers; 6) It's not like pulling teeth if I want/need to customize my setup away from the defaults.

I have always used Debian / Ubuntu because I started with my server using them and have wanted to keep the same tech stack between server and desktop - and they have a large repository ecosystem. But the fragmentation and often times byzantine layout is really starting to grind my gears. I sometimes find a couple overlapping packages installed, and it requires research and testing to figure out which one has priority (mainly networking...).

Certainly, there is no perfect answer. I am just trying to discover which ones come close.

GrantMoyer · a month ago
Try Arch Linux. It hits all your points except maybe 5.

1. It symlinks redundant bin and lib directories to /usr/bin, and its packages don't install anything to /usr/local.

2. You can keep most config files in /etc or $XDG_CONFIG_HOME. Occasionally software doesn't follow the standards, but that's hardly the distro's fault.

3. Arch is bleeding edge

4. Arch repos are pretty big, plus thete's the AUR, plus packaging software yourself from source or binaries is practically trivial.

5. Security is not the highest priority over usability. You can configure SELinux and the like, but they're not on by default. See https://wiki.archlinux.org/title/Security.

6. There are few defaults to adhear to on Arch. Users are expected to customize.

GrantMoyer commented on A media company demanded a license fee for an Open Graph image I used   alistairshepherd.uk/writi... · Posted by u/cheeaun
mister_mort · a month ago
I guess the big question for me here is - what is the state of stuff like "implied licenses" in Britain?
GrantMoyer · a month ago
There's no implied license because the news site that told them to use the image — through the OpenGraph protocol — is (supposedly) not the rights holder.
GrantMoyer commented on Valve confirms credit card companies pressured it to delist certain adult games   pcgamer.com/software/plat... · Posted by u/freedomben
thallium205 · a month ago
Adult content is considered a high risk merchant category - meaning it is susceptible to high chargeback and fraud rates. This is because after someone pays for and consumes adult content, a certain level of "clarity" overcomes them resulting in the execution of chargebacks against the merchant.

It has nothing to do with any sort of puritanical premise.

GrantMoyer · a month ago
I don't think that can explain why they're only targeting certain sub-categories of porn, and it's also contradictory to the public statements by Valve:

> We were recently notified that certain games on Steam may violate the rules and standards set forth by our payment processors and their related card networks and banks

Individual games violating "rules and standards" doesn't really fit with prohibiting a category because of high rates of fraud.

GrantMoyer commented on Helix Editor 25.07   helix-editor.com/news/rel... · Posted by u/matrixhelix
GrantMoyer · a month ago
I'd love for Helix to implement a "Kakoune mode". I develop on Windows at work, where Kakoune is not ideal, so Helix seems like it'd be a perfect fit, except I can't get over the keybindings. Its keybinding philosophy encourages verbosity instead of Kakoune's terseness, which bothers me more than it probably should, and as far as I can tell its keymap configuration isn't yet powerful enough to emulate Kakoune well.

Vim's inconsistent keybinds and behavior are what pushed me to Kakoune — which I find has more consistent and elegant bindings and behavior — in the first place, and Helix feels like a step backwards on that front.

GrantMoyer commented on Most ints are not floats   johndcook.com/blog/2025/0... · Posted by u/zdw
deckar01 · 2 months ago
You could change the scaling factor to target any bounds you want. On average the precision is equal. The mantissa just adds linear segments to a logarithmic curve.
GrantMoyer · 2 months ago
> On average the precision is equal. The mantissa just adds linear segments to a logarithmic curve.

Yes, exactly; the linear regions are needed to more evenly distribute precision, while the average precision remains the same. Alternatively, you can omit the mantissa, but use an exponent base much closer to 1 (perhaps 1 + 2⁻²³).

GrantMoyer commented on Most ints are not floats   johndcook.com/blog/2025/0... · Posted by u/zdw
deckar01 · 2 months ago
https://gist.github.com/deckar01/f77d98550eaf5d9b3a954eb0343...

Here is a visualization I made recently on the density of float32. It seems that float32 is basically just PCM, which was a lossy audio compression exploiting the fact that human hearing has logarithmic sensitivity. I’m not sure why they needed the mantissa though. If you give all 31 bits to the exponent, then normalize it to +/-2^7, you get a continuous version of the same function.

GrantMoyer · 2 months ago
Without a mantissa, way too much precision is allocated to the near zero range and not enough to the "near infinity" range. Consider that without a mantissa, the second largest float is only half of the largest float. With a 23 bit mantissa, there are 2^23 floats from half the largest to the largest.
GrantMoyer commented on Weird Expressions in Rust   wakunguma.com/blog/rust-w... · Posted by u/lukastyrychtr
AIPedant · 2 months ago
Hmm my read is this is a slight overstatement - Rust was always built with the idea of expressions as first class citizens, but practicality and performance requires expression-breaking keywords like “return” which don’t fit neatly in an ML-ish language and have a few plain old hacks associated with implementing them (not “hack” as in lacking robustness; I mean theoretically/formally inelegant). Likewise there’s some stuff (u8) which is a simple syntax quirk. But a lot of these return/etc oddities are because Rust is ultimately an imperative language with strong influence from functional programming.
GrantMoyer · 2 months ago
Haskell has `bottom`[1] (see also [2]), which acts like Rust's `return` from a type checking perspective.

I wouldn't call using a uninhabited type for the type of a return expression theoretically inelegant. On the contrary, I find it quite pleasing.

[1]: https://wiki.haskell.org/Bottom

[2]: https://en.wikipedia.org/wiki/Bottom_type

u/GrantMoyer

KarmaCake day2045April 3, 2024View Original