Better HN
topnewbestaskshowjobs
Log inSign up

coder543

6,699 karma · joined Jul 18, 2012 (14y ago) · 1,967 submissions

My email is at gmail using my username.

Backend-focused full-stack engineer with 8+ years of experience, mostly focused on Go, Rust, and TypeScript, but open to other options.

Resume: https://drive.google.com/file/d/1VNC272B3n7ZEfppMHkm2wGgaINwYl4Av/view

Submissions

comment 4y ago · link · parent

I hope it happens soon!

But, if I understood correctly, that design both requires you to explicitly mark a type as a value type when you define it and it doesn’t support inheritance, so I’m skeptical that it will see any real adoption for a long time.

Java hasn’t had decades to develop a culture around this feature the way that C# has, and neither are like Go where everything is value typed unless it is one of the built in pointer types, or you explicitly put the value behind a pointer. (The pointers themselves are values, of course, but I think few people are interested in that distinction here.)

Go isn’t perfect by a long shot, I just don’t think adding the millionth keyword is going to be a silver bullet for Java’s predisposition towards GC pressure.

comment 4y ago · link · parent

> This depends on implementation. ZGC is not generational yet, but I don’t see how generational or not would invalidate a GC benchmark for the default implementation.

I never said the benchmark was invalidated, I said that you interpreted the meaning of the benchmark wrong. I like how your reply completely ignored what I said the benchmark meant. That benchmark has a very narrow focus, and generational makes a huge difference for that one benchmark.

> And honestly if I was in Vegas I’d still bet that ZGC (Java’s non-generational, latency sensitive GC) would beat Go’s implementation here.

I would love to see a holistic set of benchmarks comparing them. Even just that one very narrow benchmark you linked would be fun to see — if ZGC is so good, surely one of the implementations of the benchmark on the website is using ZGC? But I haven’t had time to dig through them.

But, part of Go’s charm is that idiomatic code rarely puts tons of pressure on the GC anyways, and a GC can never be faster than stack allocation for a multitude of reasons… which is also why C# has value types.

comment 4y ago · link · parent

Even that simplification is too much. Java uses a generational GC, so the fewer objects that survive the nursery, the less work it has to do.

That benchmark does not mean Java's GC is faster when you're "actually allocating on the heap". It means Java's GC is faster when you're spewing garbage onto the heap as fast as possible.

Since Go makes heavy use of stack allocation where possible, short-lived garbage usually doesn't end up on the heap, but this benchmark is designed to force that outcome. Go's garbage collector is optimized to minimize latency and STW, but this does come at the cost of decreased throughput. The opposite can be said of the majority of Java GC implementations, which trade latency and STW time for increased throughput.

comment 4y ago · link · parent

Go doesn’t use segmented stacks anymore, but it does still have resizable stacks that start small and are technically able to grow to any size.

IIRC, they were artificially capped at 1GB a few years ago since it was decided that stacks larger than that usually indicate an obvious bug, and if infinite recursion causes a goroutine stack to consume all memory on a machine, the OOM killer would make this harder to diagnose than a reproducible panic with a backtrace.

comment 4y ago · link · parent

As I recall, C#'s GC famously has very few knobs as well. I don't think you can swap the GC implementation, either, which is a source of even more complexity in the world of Java.

comment 4y ago · link · parent

You clearly seem to be here to troll / just crap on Go while trying to appear fake-earnest, and that goes against HN guidelines. I believe this falls under "sneering".

I've actually also used Rust plenty in professional contexts over the last five years. Once again: no tool is perfect for every job.

comment 4y ago · link · parent

2 knobs after a decade vs how many in Java? Yes, that is exactly what simple looks like.

After years of real world experience, I can say that the Go garbage collector worked fantastically across a range of applications that I've been involved in. No tool is perfect for every job, of course, and having hundreds of knobs does not make Java perfect for every job either.

comment 4y ago · link · parent

I've seen exactly one person in real life get gunk build-up in a USB-C port, making things feel loose, and just cleaning that out solved the problem. Considering the moving part is on the cable, the port itself should be fine.

I've never personally dealt with loose USB-C or lightning ports on any of my devices, which is why I pointed out that a technically inferior design just doesn't matter at all here, but you can find plenty examples online of people complaining about Lightning ports too if we just want to talk anecdata.

In practice, they're both fine for charging devices. Even if Lightning were technically superior at charging devices, which it doesn't seem to be, it still wouldn't matter. Lightning sucks for other reasons, like requiring me to bring an additional cable on trips, and not supporting USB 3 speeds on devices that have enormous storage and where Apple intentionally helps you generate enormous files that need to be transferred. That's why I placed so much emphasis on these points in my comment, and said none of the earlier stuff mattered.

comment 4y ago · link · parent

If you're just going to declare all of that to be factual, what response should anyone give? If there is "no improvement, none whatsoever" then obviously Lightning should win! But that's not the case at all.

Lightning places the springs inside the port, instead of on the cable. So, when the springs wear out, you need a new phone instead of a new cable.

Lightning directly exposes the pins on the cable to the environment and corrosion, which is not a better design for durability and longevity.

I have no idea where you're getting the idea that USB-C is more fragile than Lightning. It isn't, although this seems to be a persistent belief. All evidence I've seen points to the opposite conclusion, at least as far as the port is concerned, and everyone should care a lot more about the port than the cable. Ports are much more expensive to replace than cables. We're also not talking about the flimsy microUSB connector, which was rife with problems.

The USB-C port has also been repeatedly proven to be small enough to fit into the current crop of iPhones, so why does the minuscule difference in size matter? It isn't the limiting factor for anything.

But, none of that really matters. What matters is that approximately all of my other devices use USB-C, but I have to either carry around a Lightning cable or a wireless charger just for my phone. Why? It's incredibly annoying to need yet another type of cable, and Lightning isn't better at anything. If Lightning was so much better, Apple should have pushed for it to become the standard instead of USB-C, as Apple has been part of the USB-IF for a very long time, and Apple would have used it on their laptops instead of USB-C... but they didn't do either of those things. Even Apple is moving away from Lightning, first on their iPads, but it is clear they're going to do this across the board over time.

Even worse, Lightning is limited to USB 2.0 speeds on iPhone. Apple introduces iPhones with a terabyte of storage and the ability to record massive 4k ProRes video files... but how are you supposed to get those multi-gigabyte files onto a computer for editing? Lightning at slower-than-WiFi speeds? WiFi at 600Mbps instead of USB-C at 10Gbps? None of it makes any sense.

It is way past time for Apple to switch the iPhone to USB-C, but it apparently won't happen until next year.

comment 4y ago · link · parent

Can you cite your sources?

AWS "reliability" has been the direct cause of a number of sleepless nights for me over the years. Comparing to a few years ago when I worked on a large-scale product hosted on bare metal servers that worked beautifully, I don't think AWS is all it is hyped up to be.

Anecdotal, I know, but even with no experience using Backblaze or Bunny, the bar they would have to meet is a lot lower than you're implying.

comment 4y ago · link · parent

You should also check out recent wireless options like T-Mobile's 5G Home Internet, which reportedly works quite well, and it makes a lot more sense (in my opinion) from an infrastructure standpoint than urban Starlink, unless you just absolutely require an internet connection that can continue working during a city-wide internet disruption. It's also like half the price of Starlink, with no upfront cost at all, IIRC. I've also seen people online get speeds upwards of 700Mbps, which is higher than I've seen anyone report on Starlink, but it is apparently highly variable from location to location based on your local cell network infrastructure.

I think Verizon and AT&T also offer 5G Home Internet options, but T-Mobile's offering seems to be the best from what I've seen online.

(Keep in mind that all of these services provide a specialized box that acts as a cell modem and router, and it should offer much stronger and better connectivity to the carrier's network than a mobile phone.)

comment 4y ago · link · parent

I definitely hadn't made it all the way to page 7 on that thread, so that is good to know, and it lends more credibility to the OP's claim. It would be nice if Hetzner would release a statement about this apparent policy change.

comment 4y ago · link · parent

As interesting as this discussion has been, I want to point out that we have no proof of any of this.

- The link says "my friend got this", so even the person who authored that post isn't claiming to have received this notice. This is a second hand report, at best. For all we know, their friend received this notice years ago, and mentioned it to the OP, who didn't realize it was old news.

- We don't even have a screenshot of an email like this (which could also be easily faked, but it would be more credible than that zero-effort text post), nor do we have any public statement from Hetzner.

- It's not like a flood of people are reporting this happening to them... I haven't seen a single person in this HN discussion mention receiving a similar notice from Hetzner. I didn't read the entire thread that was linked, but I also didn't see anyone there claiming to have personally received this notice either.

- The phrase "we’re writing to you today because of your traffic use" does not appear on any google results other than the linked thread, so this could be the first and only time that Hetzner has reached out to anyone about this, if it is even real, and even then... they might be motivated to cancel their contract with the customer for real reasons that they don't want to discuss with the customer, in hopes of lessening the drama. Companies do that sometimes, as crappy as it may be, so this whole thing could be a red herring if it only happens to one account.

If anyone does have additional evidence or anecdotes to contribute related to Hetzner getting upset at "unlimited" traffic usage, that would be nice to see. If this is a pattern that can be confirmed, then all of this discussion is absolutely warranted.

Hetzner might have sent this notice, but I've seen people get similarly flustered about other things on the internet that turned out to be fake. Can we gather some more evidence before raising our pitchforks? Literally anyone could have made up a story like this about any company, and people do make stories like this up.

Those are just my thoughts, but now that everyone has their pitchforks out, I doubt they are willing to provide benefit of the doubt to the accused party and wait for more evidence to show up.

comment 4y ago · link · parent

I feel like you’re overly dismissive of the other things I mentioned. Database failover comes with inconveniences, but it does allow you to use a single key and get great performance. For massive databases, it might be impossible to do that way, but most companies don’t have massive databases. I also opened a question about how ”erased” deleted data needs to be to be compliant, since I would imagine a lot of companies consider deletion on an encrypted drive to be good enough, even if the data may theoretically be recoverable under extreme circumstances until that hard drive is completely overwritten multiple times or destroyed.

Per user keys are also very useful for use cases like a personal file storage service, even if traditional RDBMS don’t work well with them. Techniques are situationally dependent.

I was not being dismissive of the existence of technical challenges, but rather dismissive of comments like:

> To be honest, in the age of modern overprovisioned storage drives that remap blocks frequently, I'm not really sure you can implement genuine "hard" deletes without choosing significantly unorthodox hardware (or destroying a drive every time you need a single bit erased), no matter how much you want to in software.

Which seem to completely deride the possibility of compliance.

Compliance is feasible, even if it has challenges.

comment 4y ago · link · parent

You made several comments in a row that were extremely dismissive of how GDPR compliance could be achieved, and your comments repeatedly questioned whether other people considered basic concepts of data erasure. I apologize if I misattributed malice, but I do feel those comments could have been worded differently.

Also, this quote:

> To be honest, in the age of modern overprovisioned storage drives that remap blocks frequently, I'm not really sure you can implement genuine "hard" deletes without choosing significantly unorthodox hardware (or destroying a drive every time you need a single bit erased), no matter how much you want to in software.

That quote feels incompatible with your statement that…

> Quite the contrary in fact—I believe its current requirements can and should be complied with quite cheaply and efficiently

How can it be complied with cheaply and easily if it can’t be complied with without hardware support no matter how much software wants to? Surely you can see my confusion. Your last comment is far more in line with what I would expect to see in a discussion like this.

Regardless, I think I understand the argument in your last comment better now, but I still think destroying keys is the most effective way to achieve compliance. Even if a storage device manufacturer guaranteed that they would attempt to erase the specific block you want erased, there are problems with whether that data is still recoverable by reading the block repeatedly.

comment 4y ago · link · parent

Remapping of blocks isn't the problem here. IANAL, but you should be encrypting all the data for GDPR compliance to begin with. With it encrypted, how the storage device chooses to map its blocks is completely irrelevant. When the key goes away, all the data is erased by definition. Throwing away the key is one of the easiest ways to comply with Right to be Forgotten, from what I've seen.

"Oh, but the key is still on the hard drive!" you would likely complain. No... the key could be stored any number of places that won't leave a copy. If you store the key on a TPM/HSM, then tell the TPM to delete the key, short of finding out that the TPM manufacturer failed to perform their duty in erasing the key, and simultaneously discovering a 0-day exploit to go in and retrieve that deleted key, it is gone. Full stop. It is unreasonable to ask everyone to do something impossible like prove that their TPMs are working properly, when even the TPM manufacturers cannot definitively prove this, so that is clearly not what the law is asking. You might as well ask companies to prove that they've never been hacked. How can anyone prove that?

Conceptually, one of the simplest ways to comply with this would be to perform database failover once a month, since you have a month to comply with these requests. Before the failover, you would ensure that all data is deleted that has been requested to be deleted. Then you bring up a new database replica, stream the remaining data to it, failover, and then destroy the key stored in the TPM on the primary and any other replicas. All that deleted data is now gone forever.

There are more complicated architectures where you could have per-user keys which are stored on an encrypted volume, and then you would be managing a handful of keys in the TPM to handle rotation of the encrypted volumes. Once a month, you copy the per-user keys that haven't been deleted onto a new encrypted volume, then tell the TPM to delete the key for the old encrypted volume: garbage collecting the deleted keys in an unrecoverable fashion. This avoids the hassles with having to failover a database so frequently, although having that level of automation around database failover has advantages too.

I'm sure some companies are content with treating the deleted data as erased, as long as their drives are properly encrypted. A rogue employee could potentially recover the data while the hard drives and the keys are still together, but the hard drives will be worthless once they're separated from the keys after they fail and are thrown away. A rogue employee could have stolen the data before it was deleted anyways, so how do you prove that rogue employees don't exist? Is this level of erasure good enough? This one I'm a little iffy on, but it still completely resolves your issues with the block remapping.

GDPR makes reference to "taking account of available technology and the cost of implementation", so I think it is fair to say to that GDPR is not asking you to erase any butterfly-effect waves that have propagated out from the read/write head of your hard drive. If the data is not recoverable by any known means, that is the purpose of the law, isn't it?

I will repeat that I'm not a lawyer, but your argument feels like a strawman designed to paint the Right to be Forgotten as something that no one can comply with. Your comments come off as snarky and acting like you think you're so clever. As if no one has ever thought about these problems before.

comment 4y ago · link · parent

> To be clear, this is "forever"

I guess I didn't finish my thought in that comment, because it isn't forever... it's only until either the C++ is gone, or the Rust language has developed an equally acceptable alternative (which could be upstreamed by Google, or come from somewhere else).

And realistically, the C++ would never have to go away entirely for this UB handling fork to become unnecessary, depending on the driving factors. Some code paths are more performance sensitive than others, and these tend to represent a small portion of the overall code. Once the performance sensitive code paths are rewritten, it matters less whether there is a small performance penalty for the remaining C++ code that is less sensitive to performance. But, at Google Scale, the cost of the developer-hours to maintain that fork would probably be less than the cost of the small increase in CPU hours that removing the fork would result in, so... yeah, maybe forever or until there is an upstream solution. Maintaining a patchset like this would still cost way less than maintaining an entire compiler and all the language tooling needed to support that language... does anyone really disagree? A new language is far more than just a compiler, let alone a patch for a compiler.

> Would that be a good idea for anyone?

IMHO, it definitely seems better than Carbon.

comment 4y ago · link · parent

> other than by invoking possible UB

I addressed this when I talked about a compiler fork. Google could maintain a patchset against the Rust compiler that makes this behavior well-defined in a way that suits them during the transition period as C++ code is rewritten. Or they could work with the Rust Core Team to address this issue in a way that is favorable to them over the next year or two. Either of these options are much less work than developing an entirely new language and ecosystem.

As far as I can tell, Google tried neither option.

Still, Mozilla and others have gotten along just fine as it is.

comment 4y ago · link · parent

I think a number of companies have proven that it isn't a "big problem" by successfully interoping Rust and C++. What you describe might be an inconvenience, but this goes back to what I was saying about how Google could achieve their outcome with less effort by customizing their own version of bindgen. Google could give up some safety in exchange for the desired, incremental outcomes.

If they needed to fork the Rust compiler to pessimize a few optimizations that the Rust compiler would normally do (that would invalidate such unsafe C++ code with additional UB), even that would be far less effort than inventing their own entire new language and ecosystem from scratch. That is without considering how Google could work with the Rust Core Team to contribute solutions for ergonomic issues they're encountering in the interop process.

When the alternative is "building an entire, general purpose programming language", there are a lot of other things you can do that would be much easier.

And, as previously mentioned, Carbon is only addressing the low hanging fruit... it isn't stated anywhere I've seen that they even intend to achieve parity with Rust. All of this effort, just for a lesser outcome.

I'm sorry that I'm frustrated at big companies choosing to take half measures that seem even more expensive than the full measure. I have used Rust professionally for years; I'm clearly biased, but it's not that hard. The level of safety that Rust provides should be table stakes in discussions of unmanaged languages... not the ceiling for what we can possibly imagine, but Carbon is a statement that Rust's bar is too high for Google to reach, and that's pretty depressing.

comment 4y ago · link · parent

> Seamless interop where existing, unmodified C++ APIs are made callable from safe Rust requires the C++ code to follow borrow checking rules at the API boundary.

> Seamless interop where safe Rust APIs are made callable from C++ requires C++ users to follow Rust borrow checking rules.

Their complaints about borrow checking rules at the interop layer ring hollow to me. Whether the new code is being written in Rust, Carbon, or C++... the lifetime of shared memory must be well-understood by the developer writing the code. Rust just makes this problem explicit and enforceable. Sweeping the problem under the rug isn't a better option.

> However Rust imposes stricter rules than C++, disallowing some design choices that were valid in C++.

The word "valid" is doing a lot of heavy lifting here, and I'm generally skeptical of these "valid" architectures. If it is so easy to know that these architectures are valid, why do we still see so many memory safety issues in Google's C++ code? Incrementally restructuring C++ code to be more provably correct doesn't sound like a terrible thing... in fact, it sounds like exactly what they should be doing.

> However, we are not certain that [C++ can be migrated to Rust incrementally]

Firefox is a large, historically C++ codebase that has undergone incremental rewrite into Rust for years now. It seems quite certain that this is both possible and practical! Where is the uncertainty? Of course, Mozilla's budget pales in comparison to Google's.

Rust is an extremely extensible language, and it is absolutely possible for Google to build their own version of `rust-bindgen` that suits their particular C++ codebase's idioms. That would be a much simpler undertaking that achieves their goal of incrementally adopting memory safety.

I hate to disparage new languages, but this feels like Swift all over again... it's just NIH. At this point, the die has been cast, and I'm sure it would be career suicide in Google for anyone behind the Carbon project to admit at this stage that "actually, the project turned out to be unnecessary after a discussion on HN!", so I don't expect to change anyone's mind. I'm just wasting my breath making obvious counterarguments that I'm sure have already been considered and ignored.

To be extra clear, I would love to see a company like Google take on the challenge of building an ergonomic language that exceeds Rust in terms of safety, but Carbon is a half-measure that doesn't pretend otherwise. If all of Google's C++ code is magically rewritten in Carbon, they will still apparently have memory safety problems based on what Carbon's README says... and then it'll be time once again to consider "maybe we should have ported to Rust after all". It just feels like such a waste.

comment 4y ago · link · parent

The alternative is trusting all shared links, which is currently what Google does. Third party cookies have nothing to do with it. Having some form of revokable authorization to be able to click on links from a person is superior to "all sketchy links working instantly."

If you get a Google Drive link by someone claiming to be a friend you know, you could download malware right now, because Google trusts all of these links equally. With this mitigation in place, you would be stopped: “hey, this isn’t someone you’ve ever received files from before.” Because they aren’t actually your friend using your friend’s account which you’ve received files from before. It would add a serious obstacle to a lot of these impersonation attacks, and I see impersonation attacks all the time.

My comment awhile ago said that this mitigation would be nice regardless of whether Google kept using their separate domain or not.

It absolutely doesn’t provide a new attack vector. It strictly serves to reduce the attack surface, not to increase it.

comment 4y ago · link · parent

Maybe my phrasing was awkward, but I said you would only have to do this once for a given account. So, if I've never accepted a share from you before, your links won't work. When you share something with me for the first time, I would have to accept it via a Google-sent email containing a link that only Google knows (not something that can be sent via slack), and then all your future share links would work for me on slack. The error page denying access could even indicate that the user should check their email for additional verification.

You can think of it as the equivalent of a friend request. "This person tried to share a file with you. Do you know this person? Are you sure you want to receive files from them?"

This is not some outlandish solution. This should not be "pretty annoying". Based on my own experience, most people would go months or years between seeing these emails, since people tend to share files with (and receive files from) the same people over and over.

Moreover, in a work context, you would probably be sharing links to files that are on a shared google drive that I have equal access to already, so that would not require additional verification. It's not an unsolicited link to someone else's Google Drive... it's a link to a drive that I already have read/write access to.

comment 4y ago · link · parent

> I believe Google's use of this practice also predates widespread support of Content Security Policy, which isn't to say that this is a useless practice, but perhaps it isn't as important as it used to be.

I agree completely.

comment 4y ago · link · parent

It would still say “drive.google.com”, not “google.com”, and if that isn’t enough of a hint for the target, googleusercontent.com won’t be either. In fact, people have heard of Google Drive. They know that means it isn't from Google. "googleusercontent" could be "Google content intended for users" for all someone knows.

So, I disagree here. The well-known name of Google Drive as a user file sharing service is much more meaningful as a warning at a glance.

There are also mitigations that could be put in place for file sharing, like requiring the user to have accepted a file sharing request from that account before (via Google sent notification email) for a direct link to actually work. This would be a great thing to have in place regardless of domain, for defense in depth. Unsolicited links to private files arguably should not work.

Obviously people may have different opinions on this stuff.

comment 4y ago · link · parent

I guess that’s all fair, but to be clear, I’m not proposing to host public-facing content. Only private content that can be viewed by authorized users who have the right first party cookie to allow it.

Public facing content could easily be hosted on the other domain for all of the reasons you listed, and third party cookies won’t matter then.

I appreciate you outlining the arguments. I know some other sites like Dropbox do the exact same thing with a user content domain.

comment 4y ago · link · parent

I don't fully understand why they need to use a separate domain for this at all. There is infinite URL space available on drive.google.com, even if Google just used a proxy behind the scenes to route those requests to whatever load balancer normally services googleusercontent.com, and that would solve the issue with third party cookies entirely... as well as several other issues, like potentially confusing users with their own files coming from a domain that isn't drive.google.com.

comment 4y ago · link · parent

There are quite a few iPads that meet this exact set of requirements.

comment 4y ago · link · parent

I agree with everything you said there.

I will also point out that there is some fairly low hanging fruit in this PyScript project, if they will attempt to be more "web native". Take this example: https://pyscript.net/examples/panel_kmeans.html

It loads a bunch of large `.whl` files, and they're served up without any apparent compression, which raised my eyebrows immediately. Upon closer inspection, this is a zip file under the hood, so they probably figured that compressing a zip file over the wire was a waste of resources, and they're not really wrong... but, does it need to be a zip file? That means they're shipping a library to handle decompressing and manipulating zip files.

If we unpack the zip file and make an uncompressed tarball out of it, we can feed that through brotli and get a much smaller file:

    18M bokeh.whl
     9M bokeh.tar.br
The network transfer is now twice as fast, and the browser will do a phenomenal job at decompressing this resource before handing it to the application. The browser will (presumably?) decompress these resources in parallel instead of the (likely) sequential process currently being used, the browser should be faster at decompression anyways, and not handling decompression means less code that PyScript has to ship. Even better, subsequent page loads wouldn't have to keep decompressing the same bundle over and over... it'll just be a cached resource. You'd still need to handle the tar format, but that shouldn't be too terrible.

Basically all browsers support Brotli[0], and you could always have a slow fallback for the... checks notes... IE 11 users out there.

This kind of low hanging fruit won't magically fix all the problems with PyScript, but it could go some distance towards making it more palatable for the purpose of bundling up a lightly modified Python application for use over the web.

[0]: https://caniuse.com/brotli

comment 4y ago · link · parent

> Base spec for the MacBook Pro is 1TB disk.

I believe you mean 256GB.[0] Unless you meant to say 14" or 16" MacBook Pro, in which case the base spec is still only 512GB for either of them, not 1TB.[1][2]

For the prices Apple is charging, I wish they would make 1TB the base spec... but Apple Silicon is so good that the machines sell like hotcakes anyways.

[0]: https://www.apple.com/shop/buy-mac/macbook-pro/13-inch

[1]: https://www.apple.com/shop/buy-mac/macbook-pro/14-inch

[2]: https://www.apple.com/shop/buy-mac/macbook-pro/16-inch

1
383940
66