Better HN
topnewbestaskshowjobs
Log inSign up

ImprobableTruth

1,706 karma · joined Dec 9, 2019 (6y ago) · 623 submissions

Submissions

comment 4y ago · link · parent

If other languages were taught like Greek or Latin, I'm certain there would be almost no interest as well.

comment 4y ago · link · parent

A lot of people depend on corporations for employment and the services they provide. So if a large store gets burned down and doesn't reopen that will likely just lead to decay and harm the community, especially if it's in a low-income area where sources of fresh food are already generally rare.

>Also worth noting i read an interview with a restaurant owner near the target whos restaurant was burned down that effectivly said "yeah this really really sucks, but at the same time i understand the wider context." That's what happens when you're actually a member of the community and get caught up the fallout from these things

No, what this means is that this owner is privileged enough that this isn't life ruining to them. A lot of small business owners in poor areas have partial coverage at best and will never recover, having their store burned down is having their livelihood burned down.

comment 4y ago · link · parent

>It's not that simple. You also have to specify the effect set of the algorithm, meaning, assuming we do in place sort

I implicitly assumed that state would be encapsulated, since after all dependent types are fundamentally incompatible with observable state, but you're right that this is part of the spec. However I have severe doubts about the usability of any specification language that takes more than a one-liner to specify this.

>You also have to specify what happens for general sorting predicates

If you want to admit more general sorting predicates, sure, but normally you'd just allow pure functions.

>The sorting example shows that this largely doesn't work in practise. In my experience for non-trivial programs you tend to have to carry around invariants whose complexity matches the size of the program you are verifying.

If you include lemmas derived from the spec then I'd agree, but then the spec you have to check would still be a lot smaller. If not, then the only specs where I've experienced anything close to this are ones that are just the operational semantics of existing programs i.e. cases where you want to analyze a specific program. Otherwise I'm frankly uncertain as to what even the point of giving a spec would be.

>Haskell and Scala have (local) type-inference. That makes those complex types (somewhat) digestible.

Might make it more tractable to use, but I find my issue is that it's less direct and often obfuscates the meaning.

comment 4y ago · link · parent

I'd agree that "what you are able to do" seems like it's intuitively part of expressiveness, but due to Turing completeness you don't have any situation where language A can compute something that language B can't. So the only difference in capabilities seems to be in how easy it is to compute something, rather than if one is able to do something.

comment 4y ago · link · parent

>the core reasons why in the vast majority of cases either no specification/documentation exists

I feel that is much too pessimistic.

>will only cover a small case of the actual specification.

If the same applies to proofs: so be it. Don't let perfect be the enemy of good!

>For example I would bet money that not a single function in the C, C++, Java and Python standard libraries is fully specified, in the sense of nailing down the program up to observational equivalence.

I'd imagine so as well, but I think that's more indicative of how even a (superficially) simple language like C is not all that amenable to specification.

> A lot of code refactoring I've done was trivial (e.g. changing the order or arguments), but ripples through the program and proof structure.

This is not my experience. If you use sufficient proof automation, something like this should have next to no impact on proof structure. Univalence is useful, but a lot of refactoring is not just switching to isomorphic representations, so I'm convinced that larger scale proof automation is way more essential than HoTT.

> Java exception specifications

I'm not convinced that this is fundamental to specifying exceptions rather than just Java having particularly poor ergonomics for it. I've never met a person that actually liked implicit exceptions and if you ask people who dislike exceptions, that's often one key part of it.

> In contrast, expressive type-theories constantly force you to prove a lot of trivialities.

For all large dependently typed languages that actually bill themselves as programming languages (Agda, Idris, Lean) there is some sort of 'unsafe' feature that allows you to turn the termination checker off - at your own peril of course. But you only pay for what you use, if you don't need the additional correctness, you don't need to put in any more work, just like with unit tests.

(There are also ways to safely defer termination proofs, but to be fair the experience isn't the best currently.)

>I don't know what you mean by declarative (other than: leaving out some detail).

Specs tell you the what but not (necessarily) the how. Take the spec for all sorting algorithms (giving observational equivalence):

1. The output list is a permutation of the input

2. The output is sorted in regards to some predicate.

That's a couple lines at most (or a one-liner if you don't count the building blocks like the definition of a permutation), which is a good amount shorter and easier to verify than e.g. a full heapsort implementation.

>But they cannot be smaller in general: if every program P had a full specification S that was shorter [...] then you've an impossibly strong compressor

The compression is stripping away the 'how', that's why you can't 'write a spec for a spec' and compress further.

>What you see in practise is that you only specify some properties of the program you are working on.

Sure, writing a fully specified program of non-trivial size is currently really only possible if you're willing to ~waste~ invest a decade or more.

>Moreover, if you only work with a partial specification, you can ask the question: what level of partiality in my specification gives me the best software engineering results.

Why would you assume that there is a single level of partiality that gives the best results? I agree that HM style types are a great fit for 'general' programming because it has such low impedance, however I also believe that most programs have some areas where they would benefit from more specification. (I think people have a clear desire for this and that it's at least partially responsible for some of the crazy type hackery as seen in Haskell or Scala, which could often be greatly simplified with a richer type system.)

Having a richer type system doesn't mean that you always have to fully use it. It's perfectly possible to just use a HM style/System F fragment. Using dependent types just for refinement is already one of the dominant styles for verification. If dependent types ever become mainstream in any way, I imagine it will also be largely in that style.

comment 4y ago · link · parent

Heh, I would actually consider automatic transmission to be the more expressive one, since to me expressive means how easy it is to express something. Analogously e.g. C++ (manual) is more efficient and allows finer control, but makes it harder to express the same thing as in a 'higher level' (automatic) language.

Otherwise, since Assembly provides the most control out of all, would you consider it the most expressive? ;-)

comment 4y ago · link · parent

>your programs evolve very rapidly. Since with dependent types you loose type-inference, you now what to evolve two programs rather than one.

Yes, just like you have to evolve your specification/documentation. Similarly, in the exploratory phase you'll stick to very 'rough' typing and next to no proofs and as the program gets clearer and solidifies, you can continuously refine your types (with the amount of refinement depending on how much certainty one wants). A mature program with a rigid spec is going to be harder to change, but that's just how it is anyway.

>Moreover proofs are non-compositional: you make a tiny change somewhere and you might have to change all proofs.

People on HN keep repeating this, but it's trivial because it's actually just a statement about the nature of properties. Proven invariants provide an interface to be used by the rest of the program. If the changes you make don't break your invariants but only the proofs, then you just have local adjustments to make. If your change cascades through the entire program, then it's because all the invariants get invalidated and your 'tiny' change actually changes a good deal about the semantics (and thus the spec) of the program.

The exact same thing applies to unit tests, but you don't see people constantly bemoan the non-compositional nature of unit tests even though a 'tiny' change could break all your unit tests.

>After all, your specification is just as likely to be buggy as your implementation code.

Not only are specifications declarative, they're generally magnitudes smaller. If you're as confident in your spec as in your code, something is very, very wrong with your spec. Well, or your code is your spec, but in that case you get what you pay for.

comment 4y ago · link · parent

How would you define expressiveness (as its commonly used, so a definition where Turing complete languages can have different expressiveness) if not as how much something can be simplified and thus aiding comprehension, rather than detracting from it?

>Programming languages are not theoretical things. They're concrete, practical tools that _enable_ other stuff. Engineering, not science.

You can't escape theory, engineering is applied science.

comment 4y ago · link · parent

Is that why Google has a DI code generation tool for Go (Wire)?

comment 4y ago · link · parent

An earlier article from techrepublic written in 2001: https://www.techrepublic.com/article/egoless-programming-the...

This is the earliest google hit for "Ten Commandments for egoless programming".

Curiously, the author, Lamont Adams, does not explicitly state that the commandments are from the book. Maybe "I present The (Almost) Ten Commandments for egoless programming" means that it's a summary by Adams?

comment 4y ago · link · parent

>The price for iOS distribution is determined by Apple; whether that price is a good value is determined by market forces. Again, it seems that it is indeed a great deal, because vast (and silent majority) of developers accept it.

The famous monopoly cases (e.g. Standard oil or Bell system) also had tons of customers, that's what happens when demand is rather inelastic. If you want to say that artificially inflated prices due to e.g. a monopoly can still be a good deal because people are still willing to buy it, then we shouldn't be content with just good deals because they still cause harm to society overall by not being pareto efficient. Apple can't charge the rate they do purely by the strength of their distribution service - it's the device base that is the real value and only by anti-competitive measures can they keep the price up.

>But it is not. You can reach your user via Web or if they are mobile via Android or Windows phone.

What if Apple also decided that every transaction made through their browser had to give them a cut? The situation doesn't fundamentally change (you could still just offer your app to android/desktop users), but I think it's pretty clear that this would be anti-competitive. They might not have a monopoly on smartphones/devices, but they have such a large share that boycotting them isn't really an option.

Users are also currently funneled into apps due to how web is limited in functionality as determined by Apple. e.g. if your app needs long term local storage you now need an 'real' app because Apple changed it so that web app local storage gets cleared on the regular. Windows phone has also been dead for years now.

comment 4y ago · link · parent

No, volume does not indicate that something is a 'good deal'. When market failure occurs (e.g. due to lacking competition), prices are distorted. How much this impacts volume depends on elasticity. A good with relatively inelastic demand will have high volume whether there is a good deal or not.

And you can frame it however you want, the price for iOS distribution is not determined by market forces because there is no competition for it. Distributing an application on android is not an alternative, but complimentary. It's like if there were two delivery services in the US, each covering one part of the country. It doesn't matter that there isn't only one delivery service, both of them still have a monopoly because they're not competing in regards to what they actually sell.

comment 4y ago · link · parent

No, I think it's pretty easy to point at: They monopolize distribution. (Un)fortunately Microsoft missed the boat on that one.

comment 4y ago · link · parent

Is this a joke? Of course it's the 'most efficient' way to distribute an app on iOS - it's literally the only one. 30% wasn't determined by market forces, because it's a monopoly and there is no competition. Your only other choice is to forsake >50% of total smartphone users.

comment 4y ago · link · parent

... and how do you ensure that it's execution is deterministic?

comment 4y ago · link · parent

We store books in public libraries even if they aren't public domain and authors can do nothing to prevent them from doing so.

comment 4y ago · link · parent

When something like "we believe that many of the changes proposed by the CMF are deeply misguided and will disproportionately harm under-resourced students" is marked in bold, it seems absurd to me to characterize this as "some acceptance, some feedback, some concern". To me it's quite clearly a very negative letter.

comment 4y ago · link · parent

This is just the usual "proprietary software is higher quality, we swear".

Accurately voicing my thoughts on this would probably go against the HN guidelines, so I'll just let this sentence from the article speak for itself:

>But our vision is a grand one—unify all of computation into a single coherent language, and for that, the FOSS development model is not well suited.

Well, good luck with that.

comment 4y ago · link · parent

I mean, it being not the standard is exactly why it's a debacle, right?

comment 4y ago · link · parent

This is absurd. There's a world of difference between an object that you can kill yourself with or an object that just randomly kills you.

comment 4y ago · link · parent

>References are either an explicit thing you create (as in, int &b=a; or such), or a parameter passing mechanism

This strikes me as an unusual definition. I'd say that references are simply a pointer that is treated like the underlying value i.e. they're 'boxed' values. This is a notion that is essentially present in all languages. e.g. Java (or Scheme) which don't have some explicit reference feature, still have 'unboxed' values (e.g. integers) and 'boxed' values (e.g. lists).

>They deal with bindings.

Sure, to create a closure, you need to capture the relevant bindings (the lexical environment). But how does on deal with bindings? Well, a binding associates a variable to a value. Now, when you capture a binding, you can either point to the original binding (capture by reference) or copy the value (capture by value).

>Why would you have to be wary about lifetimes?

I mean, that's just how these languages are, right? Even if you do something incredibly mundane, like returning a value or calling a function with a parameter, you constantly have to be aware of lifetimes. That's why to me it seems like a completely orthogonal issue to closures.

comment 4y ago · link · parent

Yeah, Spring is incredibly 'magic' heavy. Works great when you know the exact right annotation incantation, but it's a pain to actually understand what's going on.

I've found the official documentation to be very detailed, so it's helpful if you really need in-depth knowledge, but if you don't it's a bit hard to parse out the relevant bits. Copying something from the official guides seems often the easiest way...

In regards to the community, I didn't find it to be much smaller? The stack overflow tag is very active. I have the same experience that nobody I know wants to learn Spring out of their own volition though.

comment 4y ago · link · parent

I don't really understand your objection. How is

>at least a differently scoped variable of the same name referring to the same value, but that's not lexical scoping anymore

not lexical scoping? That's literally just how closures work under the hood.

And that's exactly why closures have to deal with references (or copies) - every implementation of them is a function pointer and a record for the lexical environment, the latter of which requires that at closure creation time the relevant bindings are captured, either by creating a reference or making a copy.

I also don't understand why C++'s (or Rust's) closures would be 'fake'. If you capture by reference, they work exactly like the closures of other languages. Not having a GC just means you have to be wary of lifetimes. If you use a reference counting pointer (/some other GC'd pointer) you literally have the same closures as other languages.

comment 4y ago · link · parent

They're talking about capture by value or reference. If you use capture by value, created closures will use the value of captured variables at the time the closure is generated.

e.g. in C++, where one has to make capture by reference explicit

    int i = 0;
    auto f = [x = i, &y = i] { //x captures i by value, y by reference
      std::cout << "Value:" << x << ", Reference:" << y;
    };
    i++;
    f();
will print out "Value: 0, Reference: 1".

comment 4y ago · link · parent

Go has lambdas

https://go.dev/ref/spec#Function_literals

comment 4y ago · link · parent

Centrally planned capitalism doesn't exist. Private ownership, while technically separate from market vs command, definitely has an influence on it. Even market socialism has central planning elements (e.g. initial public investment).

comment 4y ago · link · parent

I'm sorry, but if your definition of free market literally includes a government printing money to get rid of its debt (like the Weimar republic did), then your definition is just broken. The 'free' in free market literally refers to governments (or other actors) not interfering in trade. There is no prescribed free market monetary policy, but if you intentionally manipulate the market through monetary policy (as is common policy - the fed's goal isn't only monetary stability, they also account for things like unemployment), it's absurd to blame free markets if this goes wrong.

Using gold as your currency also isn't mercantilism. Mercantilism is about increasing exports while reducing imports. e.g. China today is quite mercantilist, despite not using gold.

comment 4y ago · link · parent

The key feature of automerge is that it's decentralized like git. Two people could work asynchronously and only occasionally merge their results.

comment 4y ago · link · parent

One sort of issue is that this only directly supports documents/DAGs, so representing many-to-many relationships is a bit iffy. This is similar to how Rust can't directly represent cyclic data structures.

It's not a huge deal, because working with indices works well enough, but it is a bit annoying.

comment 4y ago · link · parent

A lot of loans were restructured (both due to the government and because banks themselves don't want people defaulting on loans either), but for a lot of the really bad loans the slight help from restructuring wouldn't have been enough. That's also why giving homeowners a loan wouldn't have helped, which is essentially just restructuring.

>Also you’d have to explain how bailing out banks that made poor quality loans and are on the risk of insolvency isn’t “rewarding bad quality loans”.

It is, to an extent, but a loan is much less of a reward than someone paying off your debt. That's also why new regulations were introduced so that future behavior likes this from banks wasn't incentivized.

1
8910
21