HNHacker News
TopNewBestAskShowJobs

hither_shores

249 karma · joined February 21, 2022

submissionscomments
hither_shores··on Learn how to unleash the full potential of the type system of TypeScript
Being able to opt in to unsoundness is arguably a feature, but TypeScript is still unsound even without using assertions or `any`.
hither_shores··on Learn how to unleash the full potential of the type system of TypeScript
> Almost all bugs are logic bugs or inconsistent state bugs (thanks OOP!), almost none are type bugs.

With a sufficiently powerful type system (and typescript is basically the only non-functional language that makes the cut here) these aren't all that distinct. But even in codebases that don't take advantage of that power, this has not been my experience. I recently converted about ten thousand lines of legacy javascript to typescript at work, and discovered several hundred type errors in the process. State bugs also slip through pretty often, but we almost always catch pure business logic errors at code review.

hither_shores··on Haskell's Operator Glossary
You can just borrow your intuition for when to use point-free style: `>=>` is to do-notation as `f . g` is to `\x -> let y = g x in f y`.
hither_shores··on Ask HN: Anyone Have Expertise in Trigonometry?
> by constant time i mean O(1)

O(1) in what?

hither_shores··on How does Glo generate basic income and lift people out of extreme poverty?
> Instead of (or in addition to) donating convert your USD to Glo and it will passively generate money for GiveDirectly. Our goal is to scale up the available money for GiveDirectly to give away.

That GiveDirectly isn't already doing something similar indicates to me that they believe it's not an effective use of money. You, I assume, disagree. Why should I trust your judgement over theirs?

hither_shores··on Subprime loans for college hiding in plain sight
Investment managers and the administrators who manage them, mostly. Senior school administrators often make high 6 - low 7 figures, but 2+ million is quite rare.
hither_shores··on Subprime loans for college hiding in plain sight
Feudalism, to the extent that it's a coherent concept at all, refers to a particular form of social organization prominent in medieval Europe. It is not a catch-all for all premodern societies.
hither_shores··on Subprime loans for college hiding in plain sight
> If you are going to invest into something, it should be good investment that gives returns. An Useless degree clearly do not give enough returns not even to pay for itself.

You're assuming that individuals capture the entirety of the value they generate for society (and that they do so exclusively in the form of income), which is essentially never the case.

hither_shores··on Ask HN: Inherited the worst code and tech team I have ever seen. How to fix it?
> If there's no good structure to build on, the units to be replaced will constrain the architecture of the new ship.

Which is why you do it in stages: add scaffolding until local rewrites are possible, then rewrite the business logic, then tear the scaffolding down.

hither_shores··on Why Racket? Why Lisp? (2014)
> Witness the pain of making JSON fit the type system in a lot of statically typed languages.

In something like Java, sure. But Java is to static types as BASIC is to structured programming: the execution is so primitive that reasonable people can be misled into rejecting the concept if that's all they know.

Here's a completely painless encoding of JSON in Haskell:

`data Value = JObject (Map Text Value) | JArray (Vector Value) | JString Text | JNumber Double | JBool Bool | JNull`

hither_shores··on Why Racket? Why Lisp? (2014)
> like how to use FP to solve expression problem

Some common approaches:

- Tagless final style: https://okmij.org/ftp/tagless-final/

- Datatype-generic programming: https://markkarpov.com/tutorial/generics.html

- Polymorphic records and variants: https://www.cl.cam.ac.uk/teaching/1415/L28/rows.pdf

hither_shores··on Scala isn't fun anymore
> But in the end we need to converge programming, math and logic, and once this is done, we will be ready for anything. And we won't need monads as a crutch, forced upon us by a type system.

1. Math is filled to the brim with monads, it's just that mathematicians are necessarily specialists, and tend to think about things in terms of their applications to their specialties: they talk about closure operators or algebraic theories or formulas in a formal language, rather than monads as such. But that doesn't mean the monad structure isn't there.

2. Convergence between math and programming (which I agree is desirable) will almost certainly see type theory become more prominent, not less. There is some chance that programmers turn to constraint solvers or ML models for program verification instead, but if they do, mathematicians will not follow.

hither_shores··on San Francisco's Postwar Sex District (2006)
GP was obviously using "100" to mean "many", not "literally exactly 100".
hither_shores··on Ask HN: Do I have a chance to get into FAANG as a slow thinker?
> all publicly available interview questions (published on leetcode, interview prep groups, or anywhere else) are prohibited.

And how thoroughly is that prohibition enforced? Do you scrape libgen, for instance? Coursework on university websites? Mathoverflow? I'm guessing not.

Personally, I have asked people old "folklore" questions in interviews, and probably will again. They're not on leetcode, but anyone who paid attention in a sufficiently good CS program has seen them before - and honestly, I don't really care to filter those people out, given the overall state of the candidate pool.

hither_shores··on Python type hints are Turing complete
In principle, this means you can ask mypy to check arbitrary properties of your code at compile-time. (It won't necessarily succeed, because not all properties can be checked, but you can make it try). In practice, python is very poorly suited to this kind of work.
hither_shores··on Python type hints are Turing complete
You're thinking of Peano numerals. The Church encoding of 3 is `lambda f: (lambda x: f(f(f(x))))`
hither_shores··on The Fate of Rome
> Rome once had a democracy sort of right?

Not really.

The Roman Republic had legislative assemblies and elected magistrates, but the deck was firmly stacked in favor of the aristocracy. Votes in the Centuriate assembly, which elected all senior magistrates, were heavily weighted by wealth. Originally the highest two classes, comprising those with at least 10,000 denarii in assets, controlled an outright majority of the votes. (1 denarius is on the order of 1 day's income for an unskilled laborer).

The weighting was somewhat reduced in the mid 3rd century, but Sulla's reforms around 80 BC reverted the change, and additionally stripped the more democratic plebeian and tribal assemblies of most of their powers.

The senate (ostensibly an advisory body, but by the middle republic actually a legislature) was never elected. During the early republic, senators were appointed by the consuls. Later, they were appointed either by the censors, or automatically upon election to a senior magistracy. In either case, appointment to the senate was for life.

hither_shores··on Avoiding space leaks at all costs
> Or maybe the feature you adopted does get standardized but in a slightly different and incompatible way and now you've got a big problem on your hands.

Haskell is de facto a single-implementation language: an extension is not going to be made incompatible with some future Haskell standard without having been long since deprecated in GHC.

hither_shores··on Why React Re-Renders
> But it is tremendously wasteful to make a complete copy of a large data structure!

You don't make a complete copy: you make a shallow copy of the spine, and then only descend along the fields you actually modify. The number of operations scales as O(branching factor * depth), not O(size).

hither_shores··on Why React Re-Renders
GP's claim is a little too strong, but in my experience most uses of `useMemo` / `useCallback` are only necessary because people define things in the wrong scope, or write giant spaghetti components with 15 different props and no internal structure. The best memoization technique is not calling things repeatedly in the first place.
hither_shores··on Robotic motion in curved space defies standard laws of physics
That "swimming" in curved spacetime is possible is well-known. The paper describes the implementation of a system for doing so.
hither_shores··on Robotic motion in curved space defies standard laws of physics
Sure, sensationalist copy as well. The point is that press releases are written by people who neither know nor care about the subject, and can't be trusted to accurately reflect the state of the field or the content of the papers they refer to.
hither_shores··on Robotic motion in curved space defies standard laws of physics
No, it really is possible to violate momentum conservation in suitably curved spacetimes. But this is a straightforward consequence of the laws of physics, not a "defiance" of them: it falls right out of general relativity. We still have a conservation law for the stress energy tensor, given by ∇_{μ}T^{μν}=0, it just doesn't give rise to separate global conservation laws on each component.

The same applies to the system they actually built, except that the nonconserved "momentum" is not the same as the usual notion. It's the conjugate momentum(https://en.wikipedia.org/wiki/Canonical_coordinates) for the coordinates on the surface.

hither_shores··on Robotic motion in curved space defies standard laws of physics
Press releases don't get peer reviewed: they're not by or for researchers. Hence the sensationalist title. The actual paper (https://www.pnas.org/doi/10.1073/pnas.2200924119) was peer reviewed, and is perfectly reasonable.
hither_shores··on One more clue to the Moon’s origin
At these scales, there are no rigid bodies, and so no single "chunk". If the giant-impact account is correct, the moon coalesced out of ejecta in orbit.

> And why wouldn't the chunk either escape or fall back down, rejoining the main mass?

Some material likely did escape, but that takes much more energy than getting into orbit. You need to leave the surface of the Earth at about 11km/s to escape, but only 6km/s to reach lunar orbit.

hither_shores··on Dark Matter Doesn't Exist
> Again, I'm on the outside looking in, I don't work in the field so I'm not 100% sure if this is accurate

It's not. Point by point:

> I've always heard that string theory was an untestable theory

True in a certain light, but misleading. Any theory of quantum gravity is going to be untestable with current methods: the relevant energy scales are just too high. That doesn't mean they won't ever be testable. We might figure out a qualitatively better collider design, or find a way to get useful data from astronomical observations, or find some other clever way around the problem. Or we might not. Theorists would love to have more experimental evidence to work with - but wanting doesn't make it so.

A somewhat more legitimate concern is the size of the "string landscape": (perturbative) string theory permits many, many, many different possible values for different physical constants. It's likely, but not certain, that this is also true nonperturbatively. If so, then we can't use the measured values of those constants as evidence for or against string theory. This is unfortunate, but hardly unique: the standard model, after all, permits infinitely many such possibilities.

> and research on it soaked up a large amount of academic budgets and grant money

Not really. Most physics funding goes to applied research, most pure research funding is for experimental work, and the majority of theory funding is not for high energy theory. I don't know whether most high energy theory grants go to string theorists: it's possible.

> And was ultimately fruitless

Only insofar as all work on quantum gravity has been "fruitless".

hither_shores··on Dark Matter Doesn't Exist
> PV = nRT

For an ideal gas. Plasmas are extremely far from being ideal gases.

> According to some models. Do these models have reproducible experimental evidence?

Yes, general relativity is extremely well supported by the evidence.

hither_shores··on Dark Matter Doesn't Exist
> The results of using basis vectors for derivations aren’t riddled with artifacts of any particular coordinate system, as it would become immediately clear when expressing Christoffel symbols, for example - they wouldn’t be equal with other approaches.

But the Christoffel symbols are artifacts of a particular coordinate system - the real object is the connection, of which the Christoffel symbols are just basis-dependent components.

hither_shores··on Dark Matter Doesn't Exist
> What if the "dark matter" is actually ions not observable from our telescopes?

We have radio telescopes that can see all the way down to a few tens of MHz. This is far colder than the CMB, and certainly much too cold for the intergalactic medium.

> Plasma Physics hold ions permeating the Universe as a premise & has physical experiments reproducable in the lab to back up their claims

Yes, plasmas exist. There are lots of them in space. This is completely uncontroversial.

> And can use classical EM equations explain how the stars & galaxies work

Absolutely not. Galaxies are firmly in the nonclassical regime.

hither_shores··on Dark Matter Doesn't Exist
> I have to admit that it smells like phlogiston and aether to me

You know what else smells like phlogiston? Oxygen. There really is an invisible, odorless, tasteless gas responsible for combustion, plant growth, and breathing. 17th century chemists thought that it was released during combustion, absorbed by plants, and expelled by the lungs. Turns out it's absorbed during combustion, released by plants, and taken in by the lungs.

Phlogiston was a reasonable theory, well supported by the available evidence at the time. It was also wrong. Most theories are. But this could not have possibly been predicted a priori.

← PreviousPage 3 of 6Next →