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

10gig copper ethernet is hotter and more power hungry than the equivalent SFP+. Maybe you’re comparing a faster SFP port to a slower ethernet port?

2 to 5 watts for ethernet, less than 1 watt for SFP+.[0]

[0]: https://community.fs.com/blog/10gbase-t-vs-sfp-which-one-is-...

I really wish SFP+ and SFP28 would be more common in high end desktop motherboards. They’re more efficient and just better, and they can be adapted to plain old ethernet if needed (at a power penalty imposed by switching away from fiber).

comment 4y ago · link · parent

I mean, you can take raw photos on iPhone too, if you disagree with their heif/jpeg engine. The default camera app will generate raws with some interesting multi-frame fusion, and 3rd party apps can take direct, single frame raw photos. Plenty of choice to go around.

But, most people are happy with the default output from iPhone in most circumstances.

comment 4y ago · link · parent

Would the iPhone 14's built-in Satellite SOS (and satellite location sharing with friends) feature replace your need for an InReach device? It depends on how you use the InReach, I guess.

comment 4y ago · link · parent

> Support for Galileo and Glonass was touted maybe a decade ago, but there was never any massive improvement in accuracy. Same story?

Why don't you supply a source to go along with your bold claim? Instead, here is the first set of test results I found on google: https://rxnetworks.com/press-releases/test-confirms-that-gal...

It shows that using more than just GPS substantially improved accuracy in challenging environments. Dual frequency GPS should show strong improvements too.

comment 4y ago · link · parent

I did specify “this ASAN implementation” with emphasis on the “this”, since it was presented higher in the thread as having marginal performance impact and excellent, rust-like safety. Google’s ASAN is not used on all production instances, last I heard, due to the large performance penalty. All sorts of memory safety issues slip past ASAN right now, especially when it is only used outside of production.

If ASAN were a silver bullet, C memory safety vulnerabilities would be a distant memory. They’re not. ASAN helps, but it isn’t enough.

comment 4y ago · link · parent

ASAN by itself cannot make those guarantees, from what I understand. Cosmopolitan would also have to make sure never to reuse virtual memory addresses for a start, and there’s actually even more to it than that. So, no, I’m not impressed by arbitrary claims like that. It’s such a bold claim. If it were true, Apple and Google would be adopting this ASAN implementation ASAP since they have tons of C and C++ code that would benefit from better safety at marginal performance cost.

In the mean time, if Redbean and Cosmopolitan want Rust-like promises of memory safety… they need to write it in Rust.

comment 4y ago · link · parent

Redbean is a webserver. Go is not a webserver. Redbean cannot be "faster than Go". That's like saying that a car is faster than aluminum. Do you have benchmarks of Redbean versus Caddy that you can point to? I certainly haven't been able to find any.

I also haven't been able to find any in-depth independent benchmarks of Redbean. About the only thing I could find was someone struggling to reproduce the benchmark results.[0]

Personally, I've dealt with more than enough memory safety vulnerabilities caused by no programmer being good enough to write safe and correct C (or C++). Those vulnerabilities are easily prevented by choosing just about any other language people are likely to know about... so, I have no desire to deploy anything like Redbean when alternatives exist. It's cool to see the hacks they've been able to do with Cosmopolitan to make cross platform binaries, but hacks like that are not what I want for anything other than educational purposes, at least not until they've been more battle tested.

[0]: https://github.com/jart/cosmopolitan/issues/72

comment 4y ago · link · parent

I used to do something similar, but DigitalOcean App Platform's $0/month "starter" plan[0] hosts a static site for even less effort.

When I was self-hosting on a DigitalOcean droplet, I was using Caddy instead of nginx, which handled letsencrypt for me, so that was nice.

[0]: https://www.digitalocean.com/pricing/app-platform

comment 4y ago · link · parent

Doesn't M2 add support for SVE2 as well?

comment 4y ago · link · parent

Source? I've been looking for the price just out of curiosity.

comment 4y ago · link · parent

In this example, I'm passing an object with a single value into the header template, but it could have as many values in it as needed: https://go.dev/play/p/kC8pm4Z4WrH

Go doesn't really do template inheritance in the way I think you're meaning. Go prefers composition over inheritance, and that carries over to the templating system. Go templates let you pass a parameter to the template you're calling, which I believe addresses the need you linked to. Calling another template is not just simple string concatenation; the other template can act on input provided by the calling template.

There are a lot of different ways to approach templating pages in a web app. I think Go's templating system is one of the least objectionable ones I've used.

I have no experience with Quarkus, so I can't say how good or bad that one is, but my experience with Ruby templating systems is that people often start mixing complex logic into the templates, including database calls, and that causes things to get messy. Go's template environment is very minimal by default, and you can extend it with custom functions if you want to give more power to the templates, but Go encourages you to compute your data ahead of time, then pass it into the template... and just have your template be a template for formatting the data.

comment 4y ago · link · parent

Umm... what are you even talking about?

Go has had templating built into the standard library since... forever?

And Go templates can use other templates, as long as they're all loaded into the same context, if that's what you were getting at.

simple examples of Go's built-in templates: https://gowebexamples.com/templates/

templates using other templates: https://levelup.gitconnected.com/using-go-templates-for-effe...

comment 4y ago · link · parent

You linked to an issue from over a year ago to support your case? And the solution in that issue was just "switch to the right extension"? That's hardly a compelling argument. By all appearances, that person’s environment was completely broken since they reported the other extension did nothing at all, and a broken environment isn’t really a reflection on the tool. I can set up a broken environment for any tool and then complain about it. The absence of a bunch of other people encountering the same issue in that thread indicates this was not some big issue with rust-analyzer.

If I search for "Rust" in the VS Code Extension Marketplace, it shows the extension you linked to... but it is clearly marked as deprecated, and VS Code won't even let me install it. So, it’s even more of a non-issue today than it was a year ago.

The actual rust-analyzer extension works fine for me. I think Go's tooling is slightly better in my experience, but both are far better than any experience I've had with C++ tooling.

comment 4y ago · link · parent

The self-service prices for Mac weren't available yesterday, so all that we could discuss was their iPhone program. Apple doesn't publicly list repair prices for laptops, so it is hard to say exactly what you'll pay. I look forward to people doing more in-depth research and figuring out exactly how things balance out with the Mac self-service program, but the iPhone program did not live up to even the most basic expectations.

I'm also not seeing where you got that "$500-600" number "upthread", which presumably refers to the rest of this HN discussion, since I don't see any numbers like that. It could make the prices somewhat more reasonable than they were for iPhone, but I definitely haven't had time to do the research myself, and I don't appreciate how Apple hides the OOW repair cost for laptops, which makes this analysis harder.

comment 4y ago · link · parent

Watch this: https://www.youtube.com/watch?v=mdYzVaC6HSQ&t=9m37s

LTT runs the numbers to demonstrate it. Apple is making you pay more to do it yourself, and you have to wait days for the parts to arrive, when you could just go down to the Apple Store. The pricing completely nullifies any real-world benefit of this program, making the program seem like it is entirely performative.

If an individual can't even save money doing it this way, the program is worse than useless for repair shops since they won't be able to compete with Apple Store repair services. That's also without even addressing the inability for repair shops to buy parts before a customer shows up with a problem. Repair shops want to be able to provide same day service, which this program makes impossible... unless your name is Apple.

comment 4y ago · link · parent

As noted in other comments on this thread, increasing the TTFB is not a way of displaying the page faster.

HTTP/2 Push is such a cool concept, but the idea of it going away also makes perfect sense to me after years of not seeing anyone find benefit.

comment 4y ago · link · parent

Yeah, and unless I’m wrong, this also means the TTFB could be significantly higher, since I think the PUSH_PROMISE frames need to come before the main content. Doing that at least requires gathering up the information on those objects, which takes time.

comment 4y ago · link · parent

Even then, the average case would still be worse because the server would be sending all these unnecessary stream headers and forcing the client to send so many unnecessary RST_STREAM frames back. Each PUSH_PROMISE is supposed to contain the full set of headers for each resource.

I guess I hadn’t realized that clients could RST_STREAM on these pushes, but it doesn’t change the outcome here.

What you describe isn’t a win for anyone except a client with a cold cache, and then they start losing immediately after that. That’s why it isn’t done. That’s why HTTP/2 Push is going away.

comment 4y ago · link · parent

> The webserver could just parse the HTML and send http push for each dependency! What was the problem with doing this?

Well… the client knows which resources are already in its cache. The server does not. You just suggested that the server should always send resources that client almost certainly already had cached, which is wasteful for everyone involved.

> So with HTTP/2 push you just push the whole package and the client tell the server if it already have some of the files.

That doesn’t make sense. Once the files have been pushed, the bandwidth and time has already been wasted. The client doesn’t get to tell the server anything in that scenario.

comment 4y ago · link · parent

> There wasn't a choice when I bought mine.

Ad-supported or not has always been a choice for as long as Amazon has offered ad-supported kindles. I remember making this choice about 10 years ago, and I made this choice about a month ago when I bought my most recent Kindle.

If you bought it used or from a reseller, I don't know what to tell you, but Amazon gave you a choice if you bought it from them.

As a source, here is an Engadget article from the time when this option was introduced: https://www.engadget.com/2011-04-11-amazon-releases-ad-suppo...

You can clearly see that Amazon offered the "with Special Offers" version alongside the versions without "Special Offers". The ad-supported version was discounted by $25 back then. Nowadays, it appears to be a $20 difference on the Paperwhite.

comment 4y ago · link · parent

> one from B&N (until they exited the business)

Did they exit the business? It looks like the Nook Glowlight 4 was released less than a year ago.

I don't know a single person in real life with an e-reader other than a Kindle, including myself, so I had to google to see how B&N Nook was doing when you said that, but it still seems to be a thing.

comment 4y ago · link · parent

St Helena changed to 5 digits nearly 7 years ago.

comment 4y ago · link · parent

The typical approach that I've seen is to do "select * from FOO" for simple scalar fields that cost very little to retrieve from the database. If you have any fields that often contain large amounts of data, or any relations, you can provide a separate resolver for that field or relation, and then that resolver will only get invoked if the caller requested it. It's pretty straightforward, at least when using Apollo and TypeScript. (Obviously you would modify the original query to exclude such expensive fields so that you’re not duplicating work with the additional resolver.)

I still don't think I would personally recommend GraphQL to most companies.

comment 4y ago · link · parent

> and I am basically at the end of java’s feature list.

Not even close. There are quite a few keywords that modify behavior, including abstract, final, transient, synchronized, etc. You also have method overloading, including constructors which use a separate syntax from normal method declaration. Java also relies heavily on non-linear control flow thanks to exception handling. Go has panics, but it isn’t normal to see them in my experience, and indicates a serious bug with your code, whereas Java exceptions are extremely normal to see… but that doesn’t mean non-linear control flow is simple.

All Java classes have implicit methods like toString and equals, which you need to be aware of, and then this also lets you override the behavior of the equals method… yet you can’t override any operator, for some reason. And the actual equals operator is not at all what the average person expects when they’re getting started in Java, since it is referential equality, not value equality, except when it isn’t. I guess it is “simple” that the language lets you override the equals method, since that is consistent with other methods, but why is it a method at all? Why doesn’t the equals operator just do the expected thing, which would be equivalent to calling an invisible, non-overridable equals method? If no operator should be overridable, then no operator should be overridable, and the equals method is effectively an operator since the regular equals operator is just a footgun most of the time, except for the cases where it is performing value equality checks. Java has other footguns that stem from the language, not the standard library, like hashCode. I could go on, but really, why bother?

If you only want to talk about the basic features of the language and ignore the many keywords and edge cases you can run into in the syntax, then even C++ is simple. It’s the interaction of all these features that makes the language complex, including the implicit nullability of almost everything.

> there are 3 visibility modifiers (which are also language feature of Go, just implicit in naming convention).

Java actually has four access modifiers, not three, one of them is just implicit.[0] Go only has the notion of public and private, and private in Go is probably closer to the "default" access modifier in Java.

Compare to actually smaller languages like Go, or really small languages like Lua, Lisp, Tcl, or Smalltalk.

Java isn’t the worst language by a long shot, but it is one I’m unlikely to intentionally pick for anything.

You’ve left a bunch of comments all around this thread defending Java against even the smallest slights. I’m not interested in debating pointless aspects of Java forever this morning. I’ve used Java. I’ve used C++. I’ve used many languages in many contexts. You may disagree with my conclusions, and that’s fine. In my experience, Go takes less code and is less error prone than Java, in addition to being nicer to deploy and run. That's enough for me to choose it over Java, even if Go isn't perfect either.

[0]: https://www.geeksforgeeks.org/access-modifiers-java/

comment 4y ago · link · parent

> Also, Java is an exceedingly small language, so the millionth keyword comment is unwarranted.

Small compared to what?

Java and C++ are extremely competitive in feature bloat, and I can hardly think of anything that is comparable to them. Even C# has a smaller surface area, in my opinion, even though it manages to implement a variety of useful features that Java currently lacks (like async/await and value types), but C# is still a large language — no doubt about it. C# just manages the interactions of its features better than Java, in my opinion, which makes it feel simpler.

I have honestly never heard anyone call Java a small language. It is far from that!

> Java’s standard lib has been planned with value types in mind for some time now, plenty of classes will be able to take advantage of them.

Aren’t the majority of the standard container types using some form of inheritance? That’s what I recall, and that rules them out.

comment 4y ago · link · parent

Again, GCs just aren’t that simple. You seem to be taking a very literal interpretation of what was said, but that person was implying that Go is only fast when you’re avoiding the heap. They weren’t talking about the actual, literal speed of allocation. My interpretation of their comment is confirmed in their later reply to me, as far as I can tell.

Java’s GC design requires more barriers which hinder performance throughout the lifetime of a heap allocation, not just at the time the value was allocated.

Either way, Go also uses per-thread caches in its allocator to avoid contention between threads. I don’t believe it is a bump allocator, but this goes back to other tradeoffs being discussed. The number of barriers, the duration of STW, etc.

I don’t understand why so many people in here feel the need to declare the superiority of Java GC. Java’s garbage collectors are better for Java, due to the way that Java allocates practically everything on the heap. That doesn’t mean they have zero performance tradeoffs and that they’re perfect. They do have tradeoffs, and not just in complexity of tuning.

1
373839
66