russell's Avatar

russell

@rpjohnst.bsky.social

70 Followers  |  128 Following  |  45 Posts  |  Joined: 02.10.2023  |  2.2066

Latest posts by rpjohnst.bsky.social on Bluesky

the proposals I've seen for actually adding negative bounds also tend to approach that by removing "excluded middle" style reasoning from the solver.

so if T merely lacks `impl Tr` you don't get `T: !Tr`. you need `impl !Tr for T` to get `T: !Tr`, and then it's a commitment *never* to impl it

21.10.2025 14:59 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

something I haven't seen in the thread yet is that this would introduce a bunch of unnecessary duplication at codegen time, because rust doesn't have a way to erase type parameters

21.10.2025 14:37 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

rust does currently default it to (), but due to the possibility of uninitialized values (important for rust's niche) it is not true that nothing ever needs the concrete type.

they went to change the default to ! when upgrading it to a real type (it wasn't before!) and had to do it over an edition

21.10.2025 14:34 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Haskell pre-monadic I/O I wonder how I/O were done in Haskell in the days when IO monad was still not invented. Anyone knows an example. Edit: Can I/O be done without the IO Monad in modern Haskell? I'd prefer an example...

This is how Haskell worked before the IO monad: stackoverflow.com/a/17004448

18.10.2025 01:21 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

CHATGPT: I understand where you're coming from. You worked really hard to get here, and now it's time to enjoy the fruit of your labors.

ISILDUR: So I should keep it? Elrond says I shouldn't

CHATGPT: The ring is precious. Sometimes friends don't have your best interests at heart.

ISILDUR: true

06.10.2025 13:58 β€” πŸ‘ 10581    πŸ” 2996    πŸ’¬ 40    πŸ“Œ 40
Post image

lol

04.10.2025 15:51 β€” πŸ‘ 4377    πŸ” 1326    πŸ’¬ 33    πŸ“Œ 41
It is the invincible meme based on the "look at what it takes to mimic our power" scene

The top panel is "look at the cow" with a scene from Harvest Moon 64 

The second panel says "moooo" with a close up of the cow

Harvest moon 64 is a well-known and loved Nintendo 64 game much like Quest 64

It is the invincible meme based on the "look at what it takes to mimic our power" scene The top panel is "look at the cow" with a scene from Harvest Moon 64 The second panel says "moooo" with a close up of the cow Harvest moon 64 is a well-known and loved Nintendo 64 game much like Quest 64

23.09.2025 18:35 β€” πŸ‘ 4761    πŸ” 1485    πŸ’¬ 32    πŸ“Œ 19
Video thumbnail

Here's a thing that's probably right up your Straße, you big mad oddball.x

16.09.2025 19:16 β€” πŸ‘ 803    πŸ” 277    πŸ’¬ 7    πŸ“Œ 90

I've implemented some of these for fun but never benchmarked them seriously- I'd be super curious to see how the various e-free constructions compare to removing epsilons after the fact, in terms of practical performance

13.09.2025 17:21 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Other e-free NFAs have fewer states than Glushkov's: both Antimirov derivatives and Ilie & Yu's follow automaton merge equivalent states of the position automaton. (And while Glushkov and Antimirov go e-free directly, Ilie & Yu go via an e-NFA which is smaller than Thompson's.)

13.09.2025 16:17 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I like to think of epsilon edges as corresponding to the regex tree edges from the non-symbol nodes: they're a linear-size way to encode the quadratic-size relation between pairs of adjacent symbol occurrences, which works by funneling through a shared parent node

13.09.2025 16:09 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Glushkov's (i.e. the "position automaton", and more generally any epsilon-free NFA) is worst-case quadratic to construct, while Thompson's is linear. This is just due to edges, though- Glushkov's generally has fewer states because it's always exactly 1 + the number of symbol occurrences in the regex

13.09.2025 16:04 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

my neighbor told me ivys keep rejecting his applications so I asked how many he applied to and he said he just goes to the computer and writes a new essay afterwards so I said it sounds like he's just feeding essays to admissions offices and then his daughter started crying

03.09.2025 03:39 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

the other thing rust gets out of it being unique is that monomorphizing on that type eliminates the indirect call (though whether you want this all the time is another question)

28.08.2025 17:10 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

earlier on I remember a few people (eddyb?) arguing for this kind of full featured existential as the thing trait objects desugar to, possibly as part of the "custom dst" stuff. would make a lot of things really convenient!

28.08.2025 15:53 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

if you want to be really pedantic about the "closure over fields" thing, then `self` would be a separate feature that only gives you recursive access to the methods, and fields would be accessible exclusively through lexical scope

27.06.2025 00:42 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Yacc is dead: An update

also including some entertaining back-and-forth blog posts arguing with Russ Cox: matt.might.net/articles/par...

26.06.2025 20:45 β€” πŸ‘ 4    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

lua and js (not sure about php) use different implementations within the runtime at least

22.06.2025 14:56 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

my girlfriend watching me type furiously on my laptop: how's it going at the leading horses to water factory

31.10.2024 22:25 β€” πŸ‘ 345    πŸ” 23    πŸ’¬ 9    πŸ“Œ 0

There's also a synergy where value semantics make it easier to store things in-line, making GC less expensive, and in the other direction having a GC gives you the flexibility to avoid excessive copying in some cases, making value semantics less expensive.

27.05.2025 23:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Instead what you want is to lean more toward value semantics by default, and make the "soup of mutable objects" case more visible and opt-in. And having a GC makes this case way simpler, both in high level languages and in low level languages.

27.05.2025 23:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

My take on the discussion here about borrow checking and GC is that a language at this level of abstraction both 1) should have *some* answer for local reasoning about state, but 2) it almost certainly should not look anything like borrowck.

27.05.2025 23:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

objects are & and functions are β…‹ so they should be unified into sum-of-products codata, the same way + and Γ— are for data

16.05.2025 22:55 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

it's the operation of creation, of the *other* &mut- that's the operation in stacked/tree borrows that invalidates conflicting references.

12.05.2025 16:24 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Rust Playground A browser interface to the Rust compiler to experiment with the language

how can they be statically invalidated? you can stash them off in whatever arbitrary (#[may_dangle]) data structure you want, and NLL + stacked/tree borrows still agree on when they get invalidated: play.rust-lang.org?version=stab...

there's no drop glue you could generate even in principle here

12.05.2025 16:13 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

in the operational semantics (stacked/tree borrows) it's the conflicting operation itself that invalidates the first reference, even

12.05.2025 15:39 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

what's the difference between this and NLL letting you switch to a conflicting mutable reference before the first one's scope ends? either way the justification is that the first one is "dead" in the dataflow sense

12.05.2025 15:38 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

"not having view types" is no more "sweeping developer experience under the rug" than "using a more dynamic language" is describable with "reeee"

making the type system more precise is certainly another axis here, but it doesn't inherently lead to a better developer experience

04.05.2025 00:17 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

of course you could also have a language that allows these programs to run and only fails at runtime, or even that assigns them some reasonable semantics instead of any kind of failure.

but runs into the question of the language's target domain, and what kind of overheads it can accept

03.05.2025 22:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

arguably the developer experience of a compiler error is still better than silent memory corruption. (even if the compiler error is conservative and only prevents hypothetical future memory corruption.)

03.05.2025 22:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

@rpjohnst is following 20 prominent accounts