Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 5y ago · link · parent

When I think of boilerplate I think of context that is made explicit. Things like type annotations, longer variable names, the lifetime or attributes of some class or data etc. These things are extremely helpful for a number of things - they convey context from writer to readers, they aid in proving the code correct, and they can make code faster.

The context almost always exists in the writers head. We all have a specification of our program based on our expectations, and we type out code to turn that model into an implementation. We only spend so much time conveying that model though - most of us don't write formal proofs, but many of us will write out type annotations or doc comments.

The cost is usually as simple as expressing and typing out the model in our head as code. Languages that are famous for boilerplate, like Java, enforce this - and it makes writing Java slower, but can also make Java code quite explicit (I'm sure someone will respond talking about confusing Java code, that's not the point).

Reducing the cost of conveying context from writer to reader means we can convey more of that context in more places. That's a huge win, in my opinion, because I've personally found that so much implicit context gets lost over time, but it can be hard to always take the time to convey it.

Think about how many programs you've read with single character variable names, or no type annotations, or no comments. The more of that we can fix, the better, imo.

Tools like this do that. TabNine autocompletes full method type signatures for me in rust, meaning that the cost of actually writing out the types is gone. That's one less cost to pay for having clearer, faster code.

comment 5y ago · link · parent

> Almost as if programmers think that writing programs is the worst part of the job and ready to be automated away.

writing the programs is definitely boring garbage work. Typing is so slow and annoying - hence autocomplete being a standard tool. This is, to me, just fancy autocomplete.

> to an increase in boilerplate and the acceptance of it because they make it easier to manage.

Boilerplate optimizes for the right things - code that's easier to read and analyze, but takes longer to write. IDEs and tools like this cut the cost of writing, giving us easier to read code and easier to analyze code for free.

IDEs have supported templates forever. I never write out a full unit test, I type `tmod` and `tfn` and then fill in the blanks. This is basically the same thing to me.

> Folks that still expect you to only check in code you understand and can explain will become a minority.

This isn't true at all. Having used TabNine I don't have it write code for me, it just autocompletes code that's already in my head, give or take some symbol names maybe being different.

All this is is a fancy autocomplete with a really cool demo.

comment 5y ago · link · parent

> Does it train a programmer for accepting less than ideal code because it was suggested? Similar to how some programmers blindly copy code from StackOverflow without modification.

Maybe juniors, but I don't see this being likely for anyone else. I've been using TabNine for ages and it's closer to just a fancy autocomplete than a code assistant. Usually it writes what I would write, and if I don't see what I would write I just write it myself (until either I wrote the whole thing or it suggests the right thing). Of course, barring some variable names or whatever.

I don't have it "write code for me" - that happens in my head. It just does the typing.

comment 5y ago · link · parent

Having been a TabNine user for a while I can say that it's less of a productivity boost and more of a quality of life win. It's hard to measure - not because it's small, but because it's lots of tiny wins, or wins at just the right moment. It makes me happy, and that's why I pay for it - the fact that it's probably also saving me some time is second to the fact that it saves me from annoying interrupts.

comment 5y ago · link · parent

Got it, yeah I think what you're saying now is a lot clearer to me, I definitely felt like I must have been totally missing something.

comment 5y ago · link · parent

> This is why whilst I don't trust banks, they do have big safes with locked boxes in.

This doesn't matter at all. Banks will hand your money over during a robbery - it's policy and it happens often. What matters is that banks have insurance and legal infrastructure to deal with theft. When a bank is robbed insurance covers the loss, the FBI begins investigations, etc. The lockboxes are for show (I worked in a bank, no one will tell you otherwise).

comment 5y ago · link · parent

> I strongly prefer there to be no record of the transaction.

Other than cash, this isn't viable. You'll have to launder your money no matter what, at some point. Crypto just makes transferring trivial, it's less regulated, you can't go to your bank and ask them for help, etc. It's good for criminals for these reasons.

There's radically more infrastructure for this sort of thing in existing systems. Crypto is far less regulated, you can transfer across countries easily, laundering becomes trivial, transfers via hacked accounts, etc.

comment 5y ago · link · parent

Can a single program be proven bug free? Sure. Can we do that for arbitrary programs? No.

This may interest you: https://en.wikipedia.org/wiki/Rice's_theorem

comment 5y ago · link · parent

This is consistently the case too, not just in financial systems. Even language, which is loosely structured and something we get 'wrong' a lot on a day to day basis, is better for that reason - strictness just doesn't fit into the world of human beings. We're much better at using context to make case by case calls - a rigorous, inflexible system is playing against our greatest strengths.

comment 5y ago · link · parent

Let's not throw words like 'bias' around when linking to Stallman.

> allowing third parties a say in what software is run is literally the entire point of remote attestation

No it isn't.

We're clearly of two very different minds, there's no way we're finding common ground on this, and I've already done the work of explaining to many people what TPM technology is, so I feel like I've done my part.

comment 5y ago · link · parent

> Moon stated that, while Kiwi Farms had in-home DDoS protection, he was looking for alternatives to Cloudflare, the security provider for Kiwi Farms.

Is Cloudflare seriously hosting them? Just lost so much respect for that company if so.

comment 5y ago · link · parent

> Everyone is free to hold their own opinion, of course.

How convenient! Thanks for letting us all know, after you felt the need to respond to the announcement of someone's death, from a friend, that you didn't like their language!

I'm out.

comment 5y ago · link · parent

> How is the person speaking for the dead qualified to make this accusation?

How are you? You clearly assert this isn't murder. Convincing someone to commit suicide has at least garnered a manslaughter charge in the US.

edit: I also fall squarely in the "this is murder" side of this. This isn't even close to the first time KiwiFarms has done this - there is obvious intent, they seek people out to harass who are unstable, repeatedly. If you directly aim to kill someone, and your actions lead to their death, that is murder - a knife or a gun or doxxing as the weapon isn't relevant.

comment 5y ago · link · parent

> You can't by design get the key out of the tpm nor necessarily control which keys are trusted by local software nor remote machines.

I know this... I've even repeatedly stated as such in this thread.

The rest of your post is just a silly hypothetical and frankly linking gnu is just discrediting.

comment 5y ago · link · parent

I'm talking about any program that provides an execution environment for other, untrusted programs.

comment 5y ago · link · parent

> Regarding the mechanisms underlying the correlation between low carbohydrate diets and death, Professor Banach noted that animal protein, specifically red and processed meat, has already been linked with an increased risk of cancer. He said: “The reduced intake of fibre and fruits and increased intake of animal protein, cholesterol, and saturated fat with these diets may play a role. Differences in minerals, vitamins and phytochemicals might also be involved.”

I wouldn't be surprised if most people doing keto have way, way less fiber than they should.

comment 5y ago · link · parent

If you're asking about TPM in general, the answer is, among other things, cryptographic identity tied to a device. So, assuming it's everywhere, no more phishing for user credentials, no more password re-use attacks, no session exfiltration, and those are just a few - there are many more. Personally, I would rank those threats as being the top threats for the vast majority of users and organizations, so that's not nothing.

If you're asking about 1.2 vs 2.0, 2.0 makes considerable progress on the original specification both in terms of hardening of the TPM and its capabilities, allowing for it to be used in a much more broad set of authorization and authentication schemes.

If tomorrow every user had a TPM, and major services supported it, it would massively change the security landscape - I really can't stress enough that it eliminates some of the most widely exploited attacker techniques.

comment 5y ago · link · parent

You're just saying what I just said back to me, except with the confusing assertion about memory safe languages being the basis for language VMs isolation. I'm clearly missing something.

edit: > Programs in those languages generally cannot read the entire address space, unless they have unsafe hooks.

Also, this isn't true? Unless we're splitting hairs about semantics (ie: "read that exact address that isn't allocated yet). Lots of memory safe languages can allocate and compute arbitrarily, and there is no isolation of what subroutines can or can't read the memory of others.

Anyway IDK what points you're trying to make, this all seems very specific to VMs, and this post is tackling other problems.

comment 5y ago · link · parent

> Once people realize they have to literally drink heavy whipping cream [..] the medications don't sound so bad.

sounds great tbh

comment 5y ago · link · parent

Every program can already read its entire address space. What you're probably trying to refer to is when a subroutine is hosted within a virtual machine, given a side channel the subroutine can read the address space of the VM host.

This is an extremely niche scenario, basically it's just browsers. Most people don't accept arbitrary programs to execute in their address space.

comment 5y ago · link · parent

> not only did Microsoft claim to not abuse its position as only entity able to sign code that would run on nearly all secure boot enabled devices

???

And how is HP fucking their eufi up a Microsoft problem?

comment 5y ago · link · parent

I'm not defending Microsoft, personally my belief is that:

a) The intel stuff they're pushing is silly and should be loosened, and made part of their Windows 10 label OEM thing

b) TPM 2.0 will be a massive step forward for security, possibly the most significant since XP Service Pack 2, and I understand why Microsoft is getting aggressive about this.

Frankly, I think most people discussing this don't seem to know what the hell they're talking about. I'm really just presenting facts.

comment 5y ago · link · parent

OK? So you log into a website with an email and password and you're OK with moving the cookie to another computer and using it there, rather than having to re-prove that it's you? I don't think you know what a TPM does honestly, there's a clear ignorance in this thread as to how this identity functions - it does not have privacy or tracking implications.

comment 5y ago · link · parent

> You absolutely have to trust whoever manufactured the tpm module not to have back doors.

Why? What would a backdoor in the TPM do?

comment 5y ago · link · parent

I'm not saying otherwise.

comment 5y ago · link · parent

Sure, but I think most people expect sessions to be tightly tied to identity - especially given the common login process.

comment 5y ago · link · parent

Yeah I'm referring to an authenticated session like a login cookie you get when you sign into some site.

comment 5y ago · link · parent

It's unrelated to secure boot.

comment 5y ago · link · parent

Really? Which computers? I don't know of any. To my knowledge the entire secure boot thing was blown way out of proportion - Linux users still can install Linux, they can even sign their own bootloaders.
1
888990
164