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 5y ago · link · parent

This specifically calls out IP addresses:

"Log data: Information that your browser automatically sends whenever you visit the Site (“log data”). Log data includes your Internet Protocol address, browser type and settings, the date and time of your request, and how you interacted with the Site."

Then there's also this section:

"Online Tracking and Do Not Track Signals: We and our third party service providers may use cookies or other tracking technologies to collect information about your browsing activities over time and across different websites following your use of the Site."

I would assume that "other tracking technologies" includes IP addresses.

comment 5y ago · link · parent

At the bottom of (almost) every HN page is a link titled "Legal" which contains the privacy policy: https://www.ycombinator.com/legal/

(I don't have any relationship to HN)

comment 5y ago · link · parent

It makes perfect sense if you're an enterprise customer and your software dependencies charge you extremely different priced tiers for different maximum numbers of cores. AMD is selling a license-optimized part at a higher price because there will be plenty of demand for it.

People who don't save a boatload by getting the license-optimized CPU will invariably choose to buy the 24-core one, which helps AMD by making it easier for them to keep up with the demand for the 16-core variant, and the 16-core variant gets an unusually nice profit margin. Win win.

This is not the first time AMD or Intel have offered a weird inverse-pricing jump like this... I highly doubt it is a typo.

My other comment reiterates some of these points a different way: https://news.ycombinator.com/item?id=26469182

comment 5y ago · link · parent

I really don't think the article's speculation there is helpful... it's really reaching.

As I said below the article in the comments:

> If I were to speculate, I would strongly guess that the actual reason is licensing. AMD knows that more people are going to want the 16 core CPUs in order to fit into certain brackets of software licensing, so AMD charges more for those to maximize profit and availability of the 16 core parts. For those customers, moving to a 24 core processor would probably mean paying significantly more for whatever software they're licensing.

This is the more compelling reason to me, and it matches with server processors that Intel and AMD have charged more for in the past.

"Even vs odd" affecting the difficulty of the binning process just sounds extremely arbitrary... definitely not likely to affect customer prices, given how many other products are in AMD's stack that don't show this same inverse pricing discrepancy.

comment 5y ago · link · parent

Do you have the same exact hardware that the article is using? Otherwise, we can't say one way or another on that with the data you've provided.

I'm also pretty certain the article is benchmarking against the 10x copy file for the actual benchmarks.

See this example command in the article:

    time $PROGRAM <kjvbible_x10.txt >/dev/null
So, even if you had the exact same hardware, I'm pretty sure your program would only be a bit faster than the unoptimized C# version. However, it's possible that your machine is a lot slower than what's used in the article, and your program is actually pretty fast -- but without more points of comparison, we just don't know. You haven't run the other benchmark programs on your hardware and posted the results.

comment 5y ago · link · parent

Yeah. I want to check that locally... I don't feel like that's doing anything useful here.

For starters, ints aren't normally "allocated" (in the heap sense). Go is value oriented, not reference oriented.

I feel like the bigger change in the code was avoiding the allocation of the string for each word in the source text, and instead passing the byte slice directly to the point where it was used as the map key. Since strings are immutable, when you convert a byte slice to a string, it must be copied into a new immutable backing slice so that no one else can touch it. The exception is that the compiler optimizes map accesses where the key is a string type, but the code is converting a byte slice into a string at the point of using it as a map key. The compiler elides that conversion, making it a no-op, and instead just passes the byte slice in, since the hash map can make a copy of the string if it needs to, but it will otherwise avoid the unnecessary allocation and copying that converting this would otherwise require.

I feel like that's where the big difference is. Heap allocating the integers and storing references in the map doesn't feel like it's actually doing anything here, although storing pointer values in maps can be useful in certain scenarios.

comment 5y ago · link · parent

Beyond the comments other people left here, for the results to be comparable, you need to provide the result for at least one (but ideally more than one) of the solutions in the article running on your hardware... otherwise you could just have a really fast (or slow) machine.

comment 5y ago · link · parent

If they're both "pretty bad for something so simple"... then it seems like a classic example of a problem that you could just release a solution for; then there would be a non-sucky solution available!

Unless it's actually not that simple?

You could at least make constructive criticism instead of just dismissively saying that all solutions suck. ("Tons of dependencies", "complexity", and "perplexing" are not actionable criticisms... they're highly subjective opinions.)

comment 5y ago · link · parent

Not exactly. It depends on the syscall. Syscalls that are known to be slow are treated the way you're describing, but syscalls that are often fast are treated optimistically in a way that allows the work queue to be stolen and spawned onto a new thread only if the syscall doesn't return quickly.

I don't know which category epoll fits into, but it seems like it should be treated optimistically, since epoll is used for non-blocking I/O.

https://utcc.utoronto.ca/~cks/space/blog/programming/GoSched...

comment 5y ago · link · parent

Not only that, but the author takes a single data point and attempts to draw a line.

Without measuring 10k, 20k, 30k of each and seeing how the memory usage changes, we are seriously comparing apples to oranges here.

Go's allocator will hold onto a decent chunk of memory just to amortize the cost of reaching out to the operating system. Just asking the operating system how much memory the Go application is using doesn't tell the whole story in this benchmark.

Is it 3x or 30x? The author certainly doesn't know based on taking a single data point from each application.

Goroutines are more memory efficient than full OS threads, but they're also cheaper to spawn and the Go runtime can optimize for certain common use cases very effectively.

I've also personally had serious difficulty in the past with getting Linux distros to let me launch tens of thousands of OS threads. Long before I run out of memory, I hit various limits that block the program from spawning additional threads. Some of them can be adjusted, but I never managed to spawn threads arbitrarily up to the amount of memory that was available... probably just my own failing, but that alone is reason enough not to spawn an unbounded number of OS threads.

comment 5y ago · link · parent

> you'll be limited to about 3.2 (only through PCIe) to 4.2 Gbps (if also using the Pi's internal 1G ethernet) of internal bandwidth.

Is that the total full duplex bandwidth available or just the "one way" bandwidth?

comment 5y ago · link · parent

> Yes, someone could jump in and do something bad, but the greater danger is the encryption/lock system causing an accident by getting in the way of legitimate commands.

That's just not how encryption works...

Also, a malicious actor being able to point a multi-ton rocket filled with explosive fuel the wrong direction would be far worse than the system continuing the mission autonomously.

Now imagine human spaceflight missions where the command stream can be hijacked by anyone with an SDR. Yeah, not happening.

The command stream better be authenticated, and if you're doing cryptographic message authentication, you might as well encrypt the payload so no one else can read it anyways.

> The rocket might be designed to ignore commands coming from the wrong direction and/or signal strength.

You want to talk about something error prone "getting in the way of legitimate commands"? That would be an unbelievably error prone approach. Oh, the rocket accidentally rolled on its axis a few degrees? Ignore all commands to correct it!

Encryption and authentication are extremely reliable.

comment 5y ago · link · parent

The control center toggles specifically tell you what’s happening (“disconnecting from X until tomorrow”).

If that isn’t what you want to happen, you go to the Settings app and turn off those toggles. (But I wish they would have a matching statement on screen that clarifies their changes are permanent until you change them again.)

Temporary toggles being in the control center is great. Most of the time that I quickly disconnect from WiFi or Bluetooth, it’s to solve some immediate, temporary issue.

The settings aren’t “changing themselves” — they’re doing what you asked them to do. The written message tells you what you asked them to do in order to teach new users what these buttons do.

comment 5y ago · link · parent

Ah. I think I see what you were saying now. The word “elide” has different connotations to me than the word “omit”. Zig’s omission of error context is something I agree is problematic.

(This could just be a quirk of my own vocabulary)

comment 5y ago · link · parent

Eliding would be done by the compiler where the values aren’t used. That’s whole meaning of the word “elide” in a language context.

From the developer’s point of view, the values would always be there, just unused. The compiler would just make them disappear at compile time if unused.

comment 5y ago · link · parent

> You can emit an error/ok union and have the error return the structured information.

I already addressed how you’re apparently giving up all of the benefits of Zig’s error handling system to do this. That level of convention breaking isn’t a good sign for anything. The current convention really is that bad, from my point of view.

The obvious solution’s extremely tiny overhead could “easily” be avoided in the almost non-existent cases where it matters.

I want robust software by default, not software where I have to use side channel hacks to get the information I need by default... but maybe that’s just me. (And everyone else who upvoted that GitHub issue)

Of course Zig programmers would be unlikely to see the issue here — naturally the people left are the ones who don’t see the problem. People like myself who know from past experience how problematic not having error context is are likely to just avoid Zig until it meets our minimum requirements.

That’s not a problem for existing Zig users — it works for them — but it is annoying to people like me who think Zig otherwise has a number of interesting aspects.

comment 5y ago · link · parent

If the standard library doesn’t do follow that convention, then it doesn’t matter what I do in my code. I won’t get the information I need from the standard library, and third party libraries are unlikely to follow this ad hoc convention. I’m certainly not willing to rewrite the entire world to follow this ad hoc convention.

comment 5y ago · link · parent

“wasted memory”... this stuff exists on the stack, right? And we’re talking on the order of like 64 bytes or less in common, practical scenarios?

I believe the solution has been clearly presented to those who are listening, and the downsides are so much smaller than the status quo.

If people on the language team are unwilling to provide developers with the tools to make more robust software because of something like 64 bytes of stack memory... I find that pretty shocking. And yes, I mean that it is extremely difficult to diagnose and fix issues in production software when you only get back a static error value that lacks the dynamic error context that a payload would provide. I’ve been there, done that. Do not want that again.

Such a strong viewpoint (avoiding such error payloads) could at least focus more on the technical aspects of how best to implement the elision of unused error payloads instead of just broadly opposing the concept, since it should be obvious how beneficial those payloads are, and the only question is how to remove them for developers who literally cannot spare dozens of bytes of stack memory. (Which I find hard to believe outside of AVR or PIC microcontrollers, which is probably not the best use case to be optimizing for in a new language.)

Elision is an optimization that can be added later. It’s not obvious that it can’t be done, and there’s no clear reason that it has to be solved first... I just don’t think anyone would actually care enough to implement it once they see how nonexistent the negative impacts are, but it would be a cool optimization.

But, maybe everyone who upvoted the apparently most upvoted GitHub issue on the Zig repo (including myself) is just completely wrong and this obvious solution is actually secretly terrible. It’s entirely possible.

Your comment has not really done anything to help me believe that I’m wrong, though, unfortunately.

But, as I’m basically “no one” in this context, my opinion probably doesn’t really matter.

comment 5y ago · link · parent

TinyGo is a Go toolchain for microcontrollers that uses LLVM, and it produces binaries that are extremely small. A few kB is not uncommon from what I've heard, although I don't have much personal experience with it. For WASM, the smallest binary TinyGo can produce is on the order of 500 bytes, and I would expect bare metal MCU targets to be similarly sized for the smallest hello world binaries.

The standard Go toolchain cannot compile for microcontrollers, so the size of binaries that it produces is irrelevant.

Just like there are many compilers for C, there are multiple compilers for Go with different priorities.

https://tinygo.org

comment 5y ago · link · parent

Lots of "serious" microcontroller projects are written in MicroPython, Lua (such as eLua), and Espruino (JavaScript).

I think it's simply an outdated oversimplification in 2021 to say that microcontroller projects "normally" don't want heap allocations at all.

TinyGo also makes it relatively easy to avoid heap allocations because you can change a compiler flag to make heap allocations a compiler error^1, if that's required for a particular project.

^1: https://tinygo.org/usage/important-options/ (look at -gc=none)

Another interesting link: https://tinygo.org/compiler-internals/heap-allocation/

comment 5y ago · link · parent

> It's still under debate and I'm personally in the camp that errors should not have a payload, so I would avoid assuming that it's definitely the preferable choice.

How can you argue that not having access to string index where the JSON was unparseable is better than having access to it? I read through issues/2647, and I read through the "existing pattern", and it just seems obvious to me that containing the error information in the error is better than trying to hack it through side channels.

If A -> B, and B returns an error through a side channel, then A can use it and "what's so bad about that?"

But this doesn't seem to scale very well.

If A is refactored to use an intermediate function X, then it just doesn't work. A -> X -> C would mean that...

X cannot use Zig's normal error handling syntax to automatically propagate this error that A is better equipped to handle, unless we're going to further stipulate that A must pass this Diagnostics struct into X which then must pass it into B.

If we now assume that X calls into two fallible functions, B and C, and each of them provide their own diagnostics structs, then X will have to take in two "out" arguments that provide the diagnostics, and every single caller of X will have to provide those two values.

You see how this goes. It just doesn't seem scalable.

Why not take the current design to its logical conclusion of simply having every function return a Boolean indicating whether it succeeded or not, and then require the caller to look into some "out" argument to determine what the error was? Obviously, that would be extremely annoying.

A tagged error union containing the diagnostic error values is just a minor evolution of the current design that brings huge wins for language ergonomics.

For errors that don't need to carry a value, there is no additional cost: they compile and work exactly as they do today.

For errors that carry a value, the size of the error struct is only the size of the largest error value (plus the tag, of course), not the product of all possible error values, so the global error set will never grow to be enormous unless you have some very weird error type. In which case, you can solve this problem by fixing that error type.

So, I'm not deeply versed in Zig, but I have personally argued in favor of Zig's async design, which seems exceptionally interesting. I had not realized until now how limiting the error system implementation was, but I had superficially appreciated how much less verbose it was than Rust's where you tend to hand write these error enums, or use a bunch of code gen. However, errors benefit tremendously from having the ability to supply payloads.

No one is required to act on the payloads within the errors, but no one is able to if they don't exist.

comment 5y ago · link · parent

"not very suitable" is a relative term. TinyGo is a cool project: https://tinygo.org

There are various conference presentations about it that show it in action.

comment 5y ago · link · parent

VS Code is not as open source as you might think. A lot of critical functionality is in plugins that aren't FOSS, such as the Python plugin and the Remote plugins (Container, SSH, etc.). I think you're also not able to (or not supposed to? unsure) access the official plugin directory with an open source build.

I definitely appreciate that the core is open source, but using the open source version is less fun than it sounds. You really want to use the freeware proprietary VS Code to get a good experience.

If we're going to be using a proprietary text editor anyways, then I wish Sublime Text and its community were still as active as they used to be.

comment 5y ago · link · parent

There would also (by necessity) be a change in the centralized `go.mod` file (and `go.sum`) that corresponds to the addition of the new, almost-duplicate package being imported. Definitely spottable. Unless someone is using the deprecated GOPATH functionality, in which case things might be harder to spot. However, the author specifically pointed out how rare this attack seems to be in the Go ecosystem.

If the author identified malicious repos on user accounts that were created solely to make those malicious repos... it seems like something the author should have reported to GitHub. I wonder if GitHub would actually do anything, though.

comment 5y ago · link · parent

> My old bluetooth headset was over 400ms!

Which headset did you switch to?

I bought the HyperX CloudX Flight (what a name) wireless gaming headset about three months ago, and I was shocked at how much latency I could feel in something that was supposed to be a dedicated gaming headset.

There's no inherent reason that a wireless headset has to have more latency than a wired headset, analog wireless being the extreme example of no added latency, but a purpose-built wireless headset seems like it would use some digital wireless protocol that is optimized for low latency, instead of buffering something like 100ms of audio in the channel. That ~100ms to ~150ms of latency really impacts reaction times.

So, I could switch to a wired headset... I just wish I could find a wireless headset that didn't suck. Microsoft just recently introduced their new "Xbox Wireless Headset", which looks awesome, but... the absence of any latency specification is not encouraging.

comment 5y ago · link · parent

I'm also confused by the present tense being used there by the OP. "It's also the first." So it already exists? It has been tested to orbit and back? Doubtful. Do they really think they will beat Starship to orbit? Starship will certainly be added to the list of launch vehicles to offer "down-mass".

The OP's whole comment fails to mention Starship a single time, which is probably not a competitor you want to bring up with investors since it is designed to do just about everything, but acting like SpaceX hasn't been publicly developing Starship for years now is weird to me. Starship development is moving fast.

Regardless of the above, I am really excited to see more activity in the New Space scene. The market will be so big that it shouldn't be a winner-takes-all market... there seems to be plenty of room for more companies to grow the space market faster. The more the merrier.

I just want people to be transparent about current realities... and using present tense for something that seemingly doesn't actually exist, ignoring the existence of Starship, claiming to be the first launch vehicle to offer "down-mass"? hmm.

comment 5y ago · link · parent

I haven't really touched Lightsail in years, but this page shows a really nice graph that helps you understand your instance's CPU usage: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amaz...

From what I've seen of benchmarks online, DO's droplets have better sustained (and often overall) performance than Lightsail, and this looks to be the reason why.

(Which isn't to say people should avoid Lightsail, but I don't think Lightsail is the obvious 1:1 replacement for DO that a couple of people in this thread want it to be. Lightsail intentionally restricts various things to avoid cannibalizing their normal AWS sales.)

comment 5y ago · link · parent

When would rDNS actually be useful?

It's probably a failure of imagination on my part that I can't think of a use case where I would want that.

Why not just use normal, forward DNS?

comment 5y ago · link · parent

FWIW, if you’re using 75+ connections, it’s probably a good idea to add some kind of Postgres proxy in the middle like pgbouncer. Postgres doesn’t handle lots of connections well because each connection forks off its own full OS process, and the performance can degrade noticeably when you have too many connections to Postgres as a result.

That’s been my experience, at least.

comment 5y ago · link · parent

> means cost wise it's cheaper just to spin up a 'real' database droplet.

This is the case for literally every managed database service that I'm aware of.

You pay a premium for the managed aspect.

1
495051
66