Better HN
topnewbestaskshowjobs
Log inSign up

ImprobableTruth

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

Submissions

comment 6y ago · link · parent

>That is effectively how I got my last 2 jobs in software engineering

Are you saying that you had no qualifications at all before? Because that's what they're saying, just applying for any high-paying job, even if you don't have the requirements.

comment 6y ago · link · parent

>In this version, tactics write code - you use tactics to generate a term (Haskell code), and then you can edit the term itself. Save and load the file, and all you get is the Haskell code: the tactics only existed for codegen.

There's nothing preventing you from already doing this. You can use Isabelle's hammer/CoqHammer to generate a proof, dump the proof term and then replace your usage of the hammer tactic with the term. It's just, why would you want to edit the proof term manually? I'm pretty sure you can do this with Haskell's normal metaprogramming facilities too, it's just really not the intended way.

>Why?

Because it's a lot harder to maintain. Not only do you lose out on information about the generation (Why/How was it generated?), if you change the code it was generated from, you'll have to either manually edit the generated code (especially troublesome because the information of how it was generated was thrown away!) or you'll have to figure out how to do it using tactics again (in that case, why not just keep the tactics as documentation?).

>As you yourself pointed out, tactics would be terrible as an opaque metaprogram - they only work if you don't care about the particular term they generate.

Tactics aren't 'opaque', it's just a pain to manually look at the generated code and I don't see how the same doesn't apply here.

>Because it's built out of several tactic steps, which the article goes into the construction of. You could still (presumably) have built it piece by piece, by applying each tactic one at a time - and each step only modifies the term slightly, leaving a hole for later steps.

You could, but it seems pretty clear to me that this is not the intention. If you just want some form of 'quick actions' you don't need a tactics system. Having an option to 'try filling this hole' heavily indicates that this is to be used for more heavy automation.

comment 6y ago · link · parent

>Code has a clear context (variables and functions in scope) and a clear goal (return type).

At the top level, sure, but if you have a more complex proof term this breaks completely down. You'd have to evaluate potentially arbitrary expressions to determine the types and furthermore there is nothing to indicate the 'human' rather than mechanical structure of the proof since metavariables are just completely gone. It's just not my experience that I could look at a complex proof term (where I don't already know the underlying proof) and figure it out without using an interactive prover.

>Add or remove a tactic, and the rest of the proof can be completely invalidated

Just like if you randomly removed a part of a proof in term form it wouldn't typecheck anymore? 'stupid' tactics are just as localized as inserting the corresponding term with metavariables . If you're talking about how automation tactics are heavily context dependent, this is more of a fundamental quality of automation rather than tactics. Automation done via reflection suffers from the same issue.

comment 6y ago · link · parent

I'm not sure what you mean? The induction tactic uses the induction principle (dependent eliminator) of the corresponding type. If you unfold the dependent eliminator, it boils down to a combination of fix and match. I don't see how you could get a term simpler than that, unless you mean something else by readable?

comment 6y ago · link · parent

Edinburgh LCF already had tactics, both the book about it and the paper "A Metalanguage for Interactive Proof in LCF" from 1978 mention it and I wouldn't be surprised if there was an even earlier mention. Pretty crazy to think about how ML was devised to allow a safe working with tactics.

comment 6y ago · link · parent

>Editing proofs written with tactics is a nightmare

How so? Writing proofs in Agda is a joy, but it completely fails to document what I spend most of my time looking at: The context and the subgoal. Tactics only documenting this when you're able to step through them isn't something I'd hold against them, they're intended for interactive provers after all.

comment 6y ago · link · parent

>Note that these are tactics for metaprogramming - the tactics are themselves for programming, not for use in programs.

I don't understand what this is supposed to mean. How are e.g. coq tactics not the exact same?

>The commands to the LSP tell it how to generate the code, and the code sticks around for editing afterwards.

Not having the metaprogram which generated the code around just strikes me more as an anti-feature.

>What is "normal" metaprogramming?

Arbitrary, "non-sequential" code transformations.

>The particular benefit of using tactics would be that they're designed for small steps of in-flight editing, rather than generating something all at once

Well, for me tactics definitely invokes more serious proof automation than just what you could also do using Agda's emacs commands. This is also the impression I get from the article, the image presented uses some form of auto tactic to generate an entire term in one go. Certainly not what I'd call "small steps of in-flight editing".

comment 6y ago · link · parent

I hate to be a downer, but I just don't trust automatic code generation. Proof automation is nice because proofs are ultimately irrelevant. It doesn't matter what the proof is, only that there is one. With code, it's another matter. If I have to depend on heuristics for it to choose the right option that means that I'll actually have to read and verify whether it chose the correct one. At that point, I feel like I'm not really winning anything over just writing it myself.

It's possible to write a complex specification to ensure the generated code would be correct, but current automation already struggles with generating proofs for hand written code, let alone generating code and verifying it.

Also, it isn't clear to me whether tactics programs are supposed to be kept as code or just used by the LSP which the gif makes it seem like. To me the strongest benefits of tactics are that they can be used to document what the author was trying to do and that using an IDE they can be executed step-by-step. If it's just to be used by the LSP: What is the point of using tactics vs normal metaprogramming?

comment 6y ago · link · parent

>If I do want to sell someone a car, I can specify a contract or license that they must follow if they buy my car.

Only in a limited form e.g. exhaustion doctrine prevents you from restricting resale. If someone wants to resell their exclusive Ferrari, there's nothing Ferrari can legally do (though this'll probably get you blacklisted from ever receiving an exclusive vehicle).

In general, terms can't go against existing laws and have to be 'conscionable' to be enforceable (i.e. they can't be obviously 'unfair').

comment 6y ago · link · parent

There's nothing stopping nvidia from theoretically offering a gpu that is only rented out rather than sold. It's just not really considered acceptable for hardware (at the moment).

comment 6y ago · link · parent

16 hour fasting seems to be the most popular form of intermittent fasting (especially as a way to lose weight), so I think it makes sense to focus on it.

comment 6y ago · link · parent

But is the issue receiving a null or is it how unexpected the null is? Assuming that functions always can return null is way too tedious, so in practice my issue with dynamic languages like Python is that I'm never sure whether a function can actually return null.

comment 6y ago · link · parent

I agree that this is an issue, but I think the answer is simply using a very flexible basic data representation (which admits invalid state) and then using predicates to refine it. e.g. starting with a list of (start,end) intervals and then adding predicates for valid intervals (start <= end), ordered, non-overlapping and continuous.

If any of the requirements change, it's easy to either add more predicates or relax/even outright remove them.

comment 6y ago · link · parent

While I agree that a standardized notation would be great (though it's hard, e.g. I think e[v/x] is a lot harder to understand than e[x := v] if you've never seen it before), I take issue with the idea that if people struggle with notation that it must be the fault of the notation.

The author quotes a tweet about someone complaining about the notation used for a basic type judgement for being cryptic. Any introductory text will immediately cover this and looking it up, you can learn the notation (which is really rather simple) in about 5 minutes. Yet, the tweet author claims that they saw this notation 12 years ago and still can't understand it. Well, to me the only reasonable conclusion is that they simply didn't bother spending a few minutes looking it up and instead expected that they would magically understand it after enough time has passed. I seriously doubt that gammas being used instead of the word 'context' is why they're struggling.

And this is my core issue with a lot of these "notation is a barrier" complaints. Instead of being valid complaints about esoteric notation (and especially using this notation without defining it!), it's people who believe that knowing how to program means you should be able to read any PL text without any preparation which is just unreasonable. If you want to seriously engage with a paper, you'll have to read up on the basics first in literally any field.

comment 6y ago · link · parent

Would you consider android a linux distro?

comment 6y ago · link · parent

Probably to the "academia is a lousy place to do novel research" part. I don't know about you, but I also took this as really dismissive of the work done by people in academia.

comment 6y ago · link · parent

>I know that this is probably a terrible thing to bring into the world given all the conspiracy theory groups (it keeps them in their filter bubble),

So exactly what social media sites do already?

comment 6y ago · link · parent

>Reform and revolution are a false dichotomy.

Reformist and revolutionist actions aren't contradictory, but reform and revolution absolutely are. People who advocate for revolution (which Zinn does in the above quote) fundamentally reject the idea that peaceful, incremental legislative reform could be used to transform the democratic system.

>Social movements and popular unrest effect the electoral process significantly

Sure, but Zinn isn't advocating for that. This bit

>The situation required not just a new president or new laws, but an uprooting of the old order, the introduction of a new kind of society

makes it pretty damn clear that he thinks real change won't come through the electoral process.

comment 6y ago · link · parent

Far left is a pretty fuzzy term, but I don't think you need to be far-right to consider someone advocating for revolutionary anti-capitalism to be part of it.

comment 6y ago · link · parent

>He said it's not self-correcting, meaning people have to take charge to build the country that they need and want.

Yeah, and he believes that this has to happen through a revolution, because the democratic system can't fix itself _even if the people vote and try to change laws to do so_.

>That's not the same as saying it can't be fixed.

Maybe you call tearing down a system and replacing it wither another 'fixing', but I (and likely most others) certainly don't. At the very least, it's a hell of a lot more pessimistic than reformism.

comment 6y ago · link · parent

He's literally saying that he believes that American democracy is fundamentally flawed and that it can't be fixed, therefore necessitating a revolution.

comment 6y ago · link · parent

>5gbps of bandwidth and 12TB of storage that I've dedicated to the service (costing me ~£30/mo, so a fairly trivial sum).

I assume you're using hardware you own and the thirty pounds are just networking costs?

comment 6y ago · link · parent

... but chess doesn't have 3 spatial dimensions.

comment 6y ago · link · parent

For me it's actually the opposite, I find using the priority makes it actually a lot more readable, especially once you have a lot of operators. It's also quite close to a generalized (and potentially dynamic) version that is just a function that takes in a priority and returns the correct parser.

comment 6y ago · link · parent

I too love dependency hell.

comment 6y ago · link · parent

arbitrarily? Nvidia invests a lot in software R&D, why should they just give it away to their competitor AMD who basically invest nothing in comparison?

comment 6y ago · link · parent

If the modifications go far enough (e.g. something like completely suppressing all human emotions) I'm pretty sure it's fair to say that we'll be gone. At least I don't see any reason why we should view these potential future 'humans' as any thing more related to us than say a potential 'species' of robots.

comment 6y ago · link · parent

Eh, I think I can understand where he's coming from. There's a difference between choosing "high" from a drop down and manually typing out "Importance: High". The former is kinda throwaway, while the latter is more serious. He's definitely super awkward about it though.

comment 6y ago · link · parent

>What do you call linux distro's package managers then?

If you want to count them as package managers, they're by far the worst ones of all the well known languages (with some notable exceptions e.g. guix's and nixos's).

They're not portable between distributions or even different versions of the same distribution (!), since it's non-trivial to install older versions of libraries (or, hell, different versions of the same library at the same time). Not to mention that it's a very manual and tedious process in comparison to all the other language specific package manager. 'Dependency hell' is a problem virtually limited to distro package managers (and languages like C and C++ that depend on them).

Getting older, unmaintained C programs to run on Linux is an incredibly frustrating experience and I think a perfect demonstration of how the current distro package manager approach is wholly insufficient.

comment 6y ago · link · parent

The Either monad is a very nice solution for this in my opinion, in Haskell it's just

  do bar
     baz
     bazz
with it immediately returning after the first error value it encounters or returning the actual result (this is also how Rust solves it, though they introduce specific syntactic sugar for it rather than an universal monadic sugar).
1
161718
21