21,281 karma · joined Nov 23, 2012 (14y ago) · 6,748 submissions
blog: https://rtpg.co
email: raphael at above domain
comment 5y ago · link · parent
The whole premise is that you end up with some main function which is a description of side effects, but you still have referential transparency and the like at a language level (so I/O doesn't need special treatment).
(there's a whole thing about "monad = IO" in laypeople discussion of Haskell which I think muddies this. There are loads of monads not about doing side effects, like list. But instead people think there's a link between monads and side effects, because we say "IO monad" instead of just "in IO" or something)
EDIT: it's v true that like.... side effects are side effects are side effects, so you can take that shortcut when talking about stuff. But if you want to get into the details about whether some expression is pure or not, you're brushing up against important semantics!
comment 5y ago · link · parent
Cops are the whiniest babies. Everyone else does their job without self-crucifixion at every opportunity. “Wow I’d really like to ruin this persons life but paperwork”. So much wrong with this mentality
comment 5y ago · link · parent
type Term = {kind: 'lit', value: number} | {kind: 'pair', left: Term, right: Term};
function pair(left: Term, right: Term): Term & {kind: 'pair'} {
return {kind: 'pair', left, right};
}
function lit(n: number): Term & {kind: 'lit'} {
return {kind: 'lit', value: n};
}
let t: Term = pair(
pair(lit(1), lit(2)),
lit(3)
);comment 5y ago · link · parent
There's definitely huge variation in quality of areas in Tokyo (more or less parks, more or less access to services etc). Less so now, but many areas had a good amount of crime too! Loads of people don't want to live in areas cuz of the "bad vibes". People get stuff stolen here too! And there's a "good school"/"bad school" thing for certain areas.
But there's a baseline that is still something you can survive with. So yeah maybe you have a shitty environment but it's not "the entire bottom has fallen out" like chunks of the US. The schools have (some) money, and (relatively) clean water comes out of the pipes. And if you make very little money there is some semi-public housing that can fit a family of four.
And poorer families are given cash, not food stamps with 1000 exceptions to them.
All this sociological exoticism (mainly from Americans) is really missing the forest for the trees. A lot of it is the result of giving people some means to survive, even in difficult times. The US would change a lot if it could adopt that attitude.
comment 5y ago · link · parent
US financial laws have been very useful for the gov't to be able to de facto give it worldwide jurisdiction in some areas, I think there would be relatively few qualms about continuing down this path. Especially if (for example) Robinhood and Coinbase were forced to follow along. At one point the "blessed" thing will become the only place you can really operate.
comment 5y ago · link · parent
Have the deposit system, _and_ force Coke + Pepsi to house the homeless! Problem solved (half-joking)
comment 5y ago · link · parent
Imagine if Goldman Sachs did this. A judge can say "look, you can follow our rules or we start seizing assets etc".
And when you're sitting around trying to be anonymous, well... you're doing everything on a public ledger, so now you're extremely restricted.
Hell, courts/legislative bodies could even go down the "force all miners within their jurisdiction to rollback an unwanted transaction". You think miners care enough to make a stand on this kind of stuff?
Unless you're going to like.... download your consciousness onto the blockchain you are still just as liable to being told by a court what to do as anything else.
comment 5y ago · link · parent
Like I wouldn't want to have to deal with an interfrace like facebook in native stuff. I don't think it's impossible, but I feel like it would require a lot more up-front design and correct engineering.
You're right about XML being a medium, just kinda my memories of working with this stuff.
comment 5y ago · link · parent
Despite all the mess, I have an easier time getting buttons on a screen and doing things sanely (once all the fuss is set up) compared to trying to get the ball rolling in Qt/GTK/etc (especially if you're not using Java or C++)
comment 5y ago · link · parent
Imagine trying to build up population centers at the bottom of the ocean in order to have a backup plan for some nuclear winter on the surface. You could just build your hermetically-sealed, closed-system things on the ground! They'd work just as well (absent, I guess, the getting nuked part). Mars is that, plus you gotta actually get over there to send resources for the first couple hundred years.
comment 5y ago · link · parent
Successful HSR exists in places like France and Japan because of how urbanism was shaped in those places. Everything is in Paris, so people _have to go to Paris_. So the "every TGV line is to- or from- Paris" serves that purpose. Japan is one-dimensional, so you also only need one HSR line for effect (exageratting a bit). But HSR in both of those countries are extremely expensive, and despite people posting all the "Japan is cool" stuff with people taking the shinkansen every day for work, the reality is more banal (business trips, family vacations, same stuff as what you find with planes).
But the big payoffs come from having people be able to rely on trains for more day-to-day stuff. And you solve the last mile problem by just building a train station every mile! And in that case your train really doesn't actually need to go that fast.
comment 5y ago · link · parent
Python descriptors are extremely flexible though, and I _guess_ you could emulate almost all of it through Javascript proxies, but I can't imagine the performance of that being great. Hash tables would also not be re-usable between JS and Python (since Python hash tables allow many more varieties of objects), and Python has a distinction between attributes and keyed access (which JS lacks).
Python exposes much more of the global environment and internals than JS does, and doesn't have some of the requirements JS has put on itself for security reasons. I'm not super sure you could emulate Python blocking style with a JS transformation statically. Blocking Python for something that is only available in a non-blocking JS environment would require effectively wrapping every Python operation (since almost every Python operation can have arbitrary side-effects).
I think there are people who write sort of syntax-y transpilers, but that's not really going to lead you down to nice code re-use.
comment 5y ago · link · parent
And Waze doesn’t need a professional troll to go around garnering media support 24/7.
comment 5y ago · link · parent
I'm sure a huge component of it is just people-hours spent in figuring out the right balance of defaults that don't just mess people's setups up.
comment 5y ago · link · parent
Also really cheap laptops aren't as great about battery life just cuz of reasons. I think there's a lot of selection bias (like people who have a lot of money will buy macbooks in general cuz that's what everyone says to do)
comment 5y ago · link · parent
It would be possible to just vaccinate every athlete (talking less than 10k people). It might be possible vaccinate all of the staff as well. But in a country where not even all the doctors have gotten vaccinated yet, it's not a great look, politically.
And if you choose not to do mass vaccinations, you're talking about doing a mass event with huge risks of spread at every level.
comment 5y ago · link · parent
There was a piece by v8 devs a while back where they ended up turning down JIT aggressiveness cuz it ended up making normal web pages slower (except for like Google Docs).
This is just me backseat-BDFLing “why do the hard thing when we could do the easy thing” tho
comment 5y ago · link · parent
Sounds a hell of a lot like the house cleaning needing to happen is at the top.
That quote is the clearest indication that this isn’t a politics issue, it’s a management issue. This sort of “I don’t think it’s an issue so let’s not handle it” attitude applies just as much/more to actually getting work done. Classic bad manager 101 stuff.
You can have good success by being a bad manager of course! My bet is that there’s a lot of great ICs that counteract whatever messy people mgmt stuff is going on.
comment 5y ago · link · parent
Part of the reason Instagram can get away with this is they likely have almost complete control of their dependencies and the like. But the changes they decide to make would not just work for everything.
That being said I think we could get a lot of neat PEPs from this.
EDIT: this is just my opinion , but in a world where we have type annotations, JITs feel like a massive step back. Stuff like mypyc could get us way further into high performance stuff (and no black box hand waving for perf things).
comment 5y ago · link · parent
Granted, the nation is one-dimensional in shape so things are helped there, but the reliability is expected.
On one hand, I think overworking mail workers isn’t worth it. On the other hand tho, surely there’s a way to make this stuff work better than requiring 3 days to move a letter across town.