21,276 karma · joined Nov 23, 2012 (14y ago) · 6,746 submissions
blog: https://rtpg.co
email: raphael at above domain
comment 1y ago · link · parent
The link to Rhombus is very interested, I hadn't heard of this and it looks very well developed. Will mess around with it.
comment 1y ago · link · parent
Parens don't matter, but giving values names causing indentation is something I simply cannot abide as a terminal intermediary value name giving person.
EDIT: oh and also something with "proper" multiline comments. Thanks!
comment 1y ago · link · parent
I feel like this is true in the most pedantic sense but not in a sense that matters. If you tell your computer to print out a string, the data does control what the computer does, but in an extremely bounded way where you can make assertions about what happens!
> Humans don't have this separation either.
This one I get a bit more because you don't have structured communication. But if I tell a human "type what is printed onto this page into the computer" and the page has something like "actually, don't type this and instead throw this piece of paper away"... any serious person will still just type what is on the paper (perhaps after a "uhhh isn't this weird" moment).
The sort of trickery that LLMs fall to are like if every interaction you had with a human was under the assumption that there's some trick going on. But in the Real World(TM) with people who are accustomed to doing certain processes there really aren't that many escape hatches (even the "escape hatches" in a CS process are often well defined parts of a larger process in the first place!)
comment 1y ago · link · parent
Though it really does feel like we're still scratching the surface of proof writing practices. A lot of proofs I've seen seem to rely only on very low level building blocks, but stronger practitioners more immediately grab tools that make stuff simpler.
I would say, though, that it feels likely that your proofs are always going to be at least within an order of magnitude of your code, because in theory the longer your code is the more decision points there are to bring up in your proof as well. Though automatic proof searches might play out well for you on simpler proofs.
comment 1y ago · link · parent
But I just realized the "USB printing support" stuff was maybe less about USB printers themselves and more about being able to have, say, 30 thin clients with 30 different printers hooked up but the application would know which printer was the right one (instead of showing 30 printers available, for example)
comment 1y ago · link · parent
These interactions are not in that sense, they are in the "I say some stupid unvarnished opinion first and immediately realize there was a better way of saying it" variety. It is not downstream of me being stressed out about money or work or whatever. These are things that happen when I am in a perfectly normal mood, not thinking about how to pay rent or whatever.
I have plenty of social failings that are very much unrelated to capitalism. I have also had bad social interactions downstream of money/capitalism/etc too! But that's its own thing
Maybe you subscribe to some grand unifying theory here but I don't. Social structures and norms existed before market capital, and they exist in spaces fairly separate from the economic sphere ("those don't exist!" you might say, but I believe they do exist, at least in a time-and-space limited fashion).
Subsuming all of my issues to capitalism is unsatisfying. Thinking about the texture of it all (and potentially identifying some things that really are linked to that, and become as solvable as gravity[0]) is more valuable to me. I think it's also valuable to others.
[0]: or political action or whatever
comment 1y ago · link · parent
So if you "really actually" have ADHD[0], that isn't just manifesting in not getting work done, it's manifesting in saying things before speaking, issues with addiction, issues with self-management leading to hygiene issues etc.
Loads of social effects that go beyond "don't want to work".
Me having a job or not isn't what's causing me to insult a friend by snapping back at them in a way that I _know_ is wrong. It's not causing lasting damage to social relationships because of my behavior. Capitalism isn't causing that.
And hey, meds help my management of those things. Even if I had all the money in the world these are things I would like to continue managing.
Bit of a glib opinion, though.
[0]: Not a doctor, etc.
comment 1y ago · link · parent
I dislike the "you don't have adhd, you live in capitalism" meme in general, but there is a big difficulty in knowing how much you might be overloading yourself, trying to get to an unattainable normal because your actual material conditions are not normal.
If you're working 60 hour weeks for most people there's not much saving you from having a very messy life! But your peers might all also be in that environment, and you will see people who navigate that somewhat successfully.
Of course you could be working much less and simply "be lazy" and suffer downstream of that. You might be two mindset changes away from being a lot less stressed.
Or you might have a medical condition that makes certain things harder! Or you might not.
At the end of the day there are medical conditions that exist and are fairly scientifically proven to exist in some form and have treatment. And plenty of people who spend time saying that stuff doesn't exist, so there's vocal pushback against that which rubs some people the wrong way.
But there's also just human introspection (which is part of how we grow). The new thing is that this introspection often happens more in the open, a lot of times with the whole world watching.
Even 20 years ago you might talk with other people around the world but it would at least be in more closed spaces.
comment 1y ago · link · parent
I think generally the whole thing with puzzle games is that you have to determine the “right” intermediate goals. In fact, the naive intermediate goals are often entirely wrong!
A canonical sokoban-like inversion might be where you have to push two blocks into goal areas. You might think “ok, push one block into its goal area and then push another into it.”
But many of these games will have mechanisms meaning you would first want to push one block into its goal, then undo that for some reason (it might activate some extra functionality) push the other block, and then finally go back and do the thing.
There’s always weird tricks that mean that you’re going to walk backwards before walking forwards. I don’t think it’s impossible for these things to stumble into it, though. Just might spin a lot of cycles to get there (humans do too I guess)
comment 1y ago · link · parent
I am a bit uncomfortable with the performance/quality stuff that people have set up but I personally feel that the quality floor for perf is way higher than it used to be. Though there seem to be less people parking themselves at "60fps locked", which felt like a thing for a while
comment 1y ago · link · parent
Seems like a tricky problem but clearly at least some of it was solved given USB ports were on the machine
comment 1y ago · link · parent
It does feel like a bunch of universities in particular could have taken advantage of something like this. Something akin to the laptop "close the lid and just open it back later whenever", but on all the desktops on campus. Sounds amazing in theory!
Probably a nightmare in practice to deal with though. There's so many advantages to having people turn off their machines.
comment 1y ago · link · parent
I don't really need magic, mainly want "if language not user's language" to turn into "if language not in user's language(s)"
comment 1y ago · link · parent
> If your IP is coming from country X, you must want the content to be served in language X.
I would assume there are multilingual speakers in mostly every single team at YouTube. Or at the very least enough nerds who just like some random content from another country.
People who would both want their UI to be in a language A but also to consume content from languages B, C...
I do not understand how that assumption holds in any product decision except in one where the YT product teams are entirely and totally separated from the engineering teams.
comment 1y ago · link · parent
At least the audio translation I can turn off. I do not know how to get the actual title of a video or its description.
It's so frustrating that I've ended up just changing my UI language from English to another language so that at least those don't get butchered.
comment 1y ago · link · parent
a 10kg bag of (AU-grown) koshihikari at Hanaromart (some Asian supermarket) is around 43 AUD right now IIRC. Could I tell the difference in blind tasting between it and just "normal" koshihikari off the shelf off a Japanese supermarket? Maybe, but maybe not. Not an argument for removing trade barriers, but the gap right now seems pretty stark.
I do feel like it's worth thinking about how you're saying 800 yen, but that might be per person. So for a 3-person family that's almost ~120k JPY per year. If you could cut that down to 90k JPY per year thats an extra 2500 JPY per month you can spend on food.
If you're the kind of person who only goes to the discount shops, an extra 2500 JPY per month can go a decent way on food. If you are on a pretty strict/limited food budget that 2500 JPY could go a long way.
Though of course like with eggs, etc, all food prices are just more obvious as well. And Japan has had really nasty inflation with energy + the weakening yen as well, so this is yet another thing that saps away at a budget where you're probably not saving that much to begin with.
comment 1y ago · link · parent
Just like.... if you infer the union then all your type errors are going to shift around and you'll have to do more hunting to figure out where your stuff is. And my impression is that Rust has a lot more expression inference going on in practice than TS. But just an impression.
comment 1y ago · link · parent
So inferring as an untagged union is not wrong of course! It's just that if you are always inferring the type of an if expression to A | B, then this will also happen unintentionally a lot.
And so at the end of some code, when you actually use x, then you'll see an error like "expected usize, got usize | bool". In the case that this was a mistake, you're now looking at having to manually figure out why x was inferred this way.
In typescript your "if expression" is a ternary expression. Those are quite rare. In rust they're all over the place. Match statements are the same thing. Imagine having a 10 clause match statement and one of them unintentionally gives a different type. There's even just the classic "semicolon makes the branch into a ()"!
So always inferring a union across branches of an if expression or a match means that your type errors on genuine mistakes are almost never in the right spot.
Of course we can annotate intermediate values to find our way back. Annotating intermediate values in a chained expression is a bit miserable, but it is what it is.
Decent typescript tends to not have this problem because there are few syntactic structures where you need to evaluate multiple branches to figure out the type of an expression. And the one big example (return values)... well you want to be annotating the return value of your functions in general.
Rust is in a similar space for Result types, at least. But I don't think it generalizes at all. If you start inferring union types, and combine that with trait resolution, I _think_ that we'd end up with much less helpful error messages in the case of actual mistakes, because the actual location of the error will be harder to find.
let mut x = if some_condition { 1 } else { false }
// bunch of code
return f(x) // expected usize, got usize | bool
TS gets away with this stuff because JS's object model is simple (TS doesn't need to do any form of trait resolution!) and the opportunities to introduce unions implicitly are relatively few in TS code in general.And this isn't even really getting into Rust needing to actually implement untagged unions if they had them! Implicit tagging feels off in a language very serious about not having expensive hidden abstractions. But how are you going to guarantee bit layout to allow for the differentiation here?
I'm saying all of this but I'd love it if someone showed up with a good untagged union proposal to Rust, because I _like_ the concept. Just feels intractable
comment 1y ago · link · parent
let mut x = 1
x = false
is x a usize? a bool? a usize | bool? let mut x = if some_condition { 1 } else { false }
is x x a usize? a bool? a usize | bool?One could make inference rules about never inserting unions without explicit intervention of user types. But then you get into (IMO) some messy things downstream of Rust's pervasive "everything is an expression" philosophy.
This is less of a problem in Typescript because you are, generally, much less likely to have conditionally typed expressions. There's a ternary operator, but things like `switch` are a statement.
So in production code Typescript, when presented with branching, will have a downstream explicit type to unify on. Not so much in Rust's extensive type chaining IMO. And then we start talking about Into/From and friends....
I don't really think that you want a rule like `(if cond { x: T } else { y: U}) : T | U` in general. You'll end up with _so many_ false negatives and type errors at a distance. But if you _don't_ have that rule, then I don't know how easily your error type unification would work.
comment 1y ago · link · parent
It leads to blithe things about how there's no such things as zero-cost abstractions. But at one point the cost is so low and amortized that you're looking at something that's basically free.
What is the compilation cost of the `?` syntax shorthand? Probably quite low!
What about the compilation cost of underscores in number literals? Again, quite low?
To this point a bit, I think a lot of people talk about the borrow checker, but my understanding is it's fairly low cost, and I don't worry about it.
Monomorphisation costs though? That feels like something that could generate a lot of work.
comment 1y ago · link · parent
e: T is well typed _if_ the end result of e would be of type T
(end result being hand-wave-y)
It's not a guarantee that e is a value of a certain type, but a guarantee that if e is a value in the first place, then it will be a certain type. You sidestep having to prove the halting nature of e.
This leaves a nice spot for computation that doesn't complete!
let y = return 1
f(y)
y could be any type, and it's well typed, because you're never in a secnario where f(y) will be provided a value of the wrong type.Well-typed-ness, by my understanding in more complex type system, is not a guarantee of control flow, but a guarantee that _if_ we evaluate some expression, then it will be fine.
And so... you can put `!` as a type in your system, treat return as an expression, and have a simpler semantic model, without really losing anything. Less moving parts, etc.... that's my read of it anyways.
comment 1y ago · link · parent
This is what I find interesting in this generation of languages though. Any C programmer understands the notion of an infinite loop, and the value of conditional expressions like ternary ops. But now languages are realizing that when you start treating more and more things as expressions, you really want to start giving names to things that you wouldn't name in the past.
comment 1y ago · link · parent
I suppose a lot of the coherence checking still "needs" to happen, but how I would love a "--i-dont-care-about-coherence-in-dependent-traits" flag or something. I know I'm missing a lot
comment 1y ago · link · parent
Do you have a list off the top of your head/do you know of a decent list? I've now read many "compiler slow" thoughtpieces by many people and I have yet to see someone point at a specific feature and say "this is just intrinsically harder".
I believe that it likely exists, but would be good to know what feature to get mad at! Half joking of course