Readit News logoReadit News
james-mcelwain commented on Haskell GHC 9.0.1-alpha   mail.haskell.org/pipermai... · Posted by u/harporoeder
necubi · 5 years ago
Rust has affine types (can be used no more than once), but not linear types (must be used exactly once). Linear types would be a nice feature for rust, and there's been some discussion about how to add them, but as far as I know there hasn't been any real progress there.

Affine types in Rust are anything with move semantics; for example you can create a method that consumes itself like this:

    impl A { 
      fn use(&mut self) { 
        // takes a mutable reference to self, so it
        // can be used again later
      }

      fn consume(self) {
        // moves self into this function, which means
        // it cannot be used again
      }
    }

james-mcelwain · 5 years ago
> Rust has affine types (can be used no more than once), but not linear types (must be used exactly once)

Obviously it's not part of the type system itself, but doesn't the must_use attr get pretty close?

james-mcelwain commented on Show HN: A SQL database implemented purely in TypeScript type annotations   github.com/codemix/ts-sql... · Posted by u/phpnode
ricksharp · 5 years ago
But if you declare a string literal as const, then the string runtime value will match the string type. So it would be possible to have a runtime result (that executes an actual db query for example) that is paired with the type result.
james-mcelwain · 5 years ago
No, TypeScript is compile time only. There's no runtime type info.
james-mcelwain commented on Why Not Rust?   matklad.github.io/2020/09... · Posted by u/dochtman
xuejie · 5 years ago
> I feel like the plethora of (partially incompatible) extensions make the language very complicated and messy. There is no single Haskell. Each file can be GHC Haskell with OverloadedStrings or GADTs or ....

Aren't macros, especially proc macros these days in Rust having the same effect? Personally I feel like this is a tradeoff every language has to play with: you either limit to a special way of writing, or adding some sort of ad-hoc system that enables rewriting syntax and even to a degree, semantics.

james-mcelwain · 5 years ago
Anecdotally, proc macros just aren't that common. Almost every Haskell tutorial I read introduces language extensions, and it seems like many users have a set of extensions that they always enable by default. I don't think proc macros are really comparable in that sense, although maybe they will be in the future?
james-mcelwain commented on Police-issued "courtesy cards" help friends and family out of minor infractions   vice.com/en_us/article/v7... · Posted by u/danso
mortenjorck · 5 years ago
Some perspective.

114 unarmed Americans were killed by police in 2019. [1]

While any number other than zero is unacceptable, that is also 0.000035% of the US population, or a one in 2.8 million chance. If you are African-American, that goes up to a one in 1.5 million chance – also unacceptable, while at the same time a vanishingly rare occurrence.

You are 328 times – that's 32,800% – more likely to die of suicide than to be killed by police. You are 733 times more likely to die of diabetes than you are to be killed by police.

Police reform in the US is absolutely needed. But suicide prevention and healthy eating are objectively much greater problems that need solving, and are at very least worth as much of "a talk" with developing children.

[1] https://mappingpoliceviolence.org/nationaltrends [2] https://www.cdc.gov/nchs/fastats/deaths.htm

james-mcelwain · 5 years ago
These statistics don't include all the discriminatory interactions with the police that don't end in death. Being killed by the police is only one way that racialized policing can have a disparate effect on policed populations.
james-mcelwain commented on Asana S-1   sec.gov/Archives/edgar/da... · Posted by u/sean_lynch
dman · 5 years ago
Am going to short this one once it is out- saying this as someone who has been a user.
james-mcelwain · 5 years ago
Hope you have good margin rates, you could be waiting a long time. A lot of these are steaming piles of shit if you think about fundamentals but the market doesn't care about fundamentals.
james-mcelwain commented on Asana S-1   sec.gov/Archives/edgar/da... · Posted by u/sean_lynch
siemprenocasa · 5 years ago
Related - why are there so many IPOs particularly right now?

It seems like there is more than usual IPOs this August compared to previous years: https://www.nasdaq.com/market-activity/ipos

james-mcelwain · 5 years ago
Just look at the price action on any big tech stock and pretend you're a tech investor looking for a big exit. People are pouring money into equities, particularly tech.
james-mcelwain commented on Asana S-1   sec.gov/Archives/edgar/da... · Posted by u/sean_lynch
jolux · 5 years ago
We are currently in a large, broad recession. Unemployment is at 10%.
james-mcelwain · 5 years ago
There's no alternative to equities. These prices could continue to go up for years, even if the bottom totally falls out.
james-mcelwain commented on Asana S-1   sec.gov/Archives/edgar/da... · Posted by u/sean_lynch
adventured · 5 years ago
We were. It's doubtful that we still are. GDP growth has clearly popped back above negative for the third quarter, which will break the two quarters technical requirement. Most economic readings right now are strong, from manufacturing to retail to job creation.

It's more like we're in the equivalent of the first or second inning of the post great recession recovery now.

This recession isn't broad, it's unusual in its disjointed hit. It's primarily hammering lower income labor and specific types of small businesses. 40% of low income households lost jobs just in the March and April shutdown. That's where most of the job damage was at:

CNBC "Households with income below $40,000 were hit hardest by the coronavirus pandemic. Almost 40% were laid off or furloughed by early April, according to the Federal Reserve."

Jobs in the top 2/3 have largely been unscathed, which is why the broad housing market continues humming along in most regards (whereas housing got smashed in every way in the great recession). It's also why hiring has been so ferocious and unemployment has recovered dramatically faster than during the great recession; it's specifically because the context isn't all encompassing. The great recession didn't spare the middle class and higher income groups nearly so much, it was a very broad recession.

Which all makes sense, this wasn't a normal recession, it was a temporary forced shutdown of some parts of the economy due to a pandemic (further, not all of the economy was shuttered during the second quarter, the majority of the economy kept functioning throughout the pandemic).

james-mcelwain · 5 years ago
Ignoring the importance of the bottom 1/3rd for consumer spending.
james-mcelwain commented on Docker to rate limit image pulls   docker.com/blog/scaling-d... · Posted by u/AaronFriel
bsamuels · 5 years ago
There is very little reason for a build node to need to pull 200 images in 6 hours, and here is why:

When a machine issues a ``docker build`` command, the program reads the relevant dockerfile to check for any base images that need to be pulled (a la "FROM:")

These base images are identified based on the image repository, image name, and image tag. The first thing docker does is it checks its local registry and tries to find a match for the base image the docker build is requesting. If a matching image is located in the local registry, it uses that one in lieu of downloading the image.

This is significant - if your organization only uses a few dozen base images from DockerHub, those images will only be downloaded by each build node _once_, then never again.

Many docker users erroneously believe that if their Dockerfile requests a "latest" tagged image, docker build will always download the newest version of the image. However, the "latest" tag is literally just a tag, it doesn't have any special functionality built in. If the docker build command finds an image tagged "latest" in the local registry, it stops there.

The only way to get docker build to always use the "actual latest" version of the base image is to add the "--pull" parameter to the docker build command. This arg will tell docker build to check the repository remote to see if the SHA hash of the image tagged "latest" has changed, and if so, re-download and use it. In the absolute worst case, this means each build node will pull 1 copy of each base image when the base image is updated. So unless you use 200 different base images that all have updates deployed to Dockerhub each and every day, you are fine.

james-mcelwain · 5 years ago
Lots of tools built on top of Docker do imbue special meaning in latest, however.
james-mcelwain commented on Uber and Lyft shutdown in California averted as judge grants emergency stay   theverge.com/2020/8/20/21... · Posted by u/badwolf
Consultant32452 · 5 years ago
This is a great example of having the right ideas but not understanding workable systems with real people. Let's take just one industry and I can show you how it's not as simple as you make it out to be: socialized/single-payer medicine. This is a system which reduces incentives (profits) in exchange for some equity. This is a great idea because we don't like it when people suffer. But what are the costs? Basic economics/psychology informs us that when incentives affect behavior. When the profits in healthcare are reduced there is less incentive to create new products/treatments/services. This is the tradeoff we're making. What happens down the road? Of course no one knows exactly, but we do know what will tend to happen. A new drug that might've been created in 5 years takes 7 instead. And then the next advancement that builds off that one takes even longer still. The whiz-kid who might've invented the new surgical technique which saves hundreds of lives per year might go into finance instead. What does this mean? It means we've slowed the velocity/acceleration of advancement. So people who live 50 years in the future will not have as good of healthcare as they could've if we'd left the greater incentives in place. And the people who live 100 years in the future are relatively even worse off to where they would've been because we've had 100 year at the slower pace. Since the future is functionally infinite, we are causing infinite harm to people in the future (all the advancements they won't get) at the cost of providing some comfort for some people today. And this applies to every industry, every redistribution program, every set of regulations. It's not just politics/law either, we make these decisions in our own lives every day. Are you going to buy that Apple Watch, or are you going to put that extra $ into your 401k?

Stoicism teaches us that all negative emotion is rooted in a lack of understanding. So when someone says they don't want to raise the minimum wage, or doesn't want universal healthcare, or whatever... it's helpful not to have that knee jerk reaction of "This person is bad and wants people to suffer." That's almost never the case.

james-mcelwain · 5 years ago
First of all, "Basic economics/psychology informs" does not constitute empirical proof that UHC leads to decreased "innovation" (which is a weasel word in itself).

Second, even if we granted the premise that UHC leads to less healthcare innovation, this doesn't mean that there's "infinite harm" in to people in the future. Unless you're claiming you have a crystal ball, there is absolute 0 epistemic basis on which to make this claim. For all we know, not having UHC leads to nuclear war and we all die. Or, having UHC leads to the singularity. Etc.

Third, even if we grant that there's an innovation advantage to for-profit medicine AND we grant that you can predict the future, that still doesn't mean that there's "infinite harm", precisely because "harm" is comparative. I would argue that we've picked most of the low-hanging fruit of human medicine and that the marginal utility produced by new treatments is far outweighed by the human suffering of our for-profit system.

u/james-mcelwain

KarmaCake day663October 6, 2016
About
[ my public key: https://keybase.io/jamesmcelwain; my proof: https://keybase.io/jamesmcelwain/sigs/whSW5laGmslehwevVkVBiju8T2NK1noZ8yeuyKo2xEo ]
View Original