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

No one (that I've seen) is suggesting to include those SDKs, which you probably don't even have the rights to redistribute anyways.

I provided both Zig and Go as examples of what people are looking for, and their downloads are neither obscenely large nor do they include those massive SDKs.

So yes, you have a weird definition of "target" that no one else here is using, and it is disingenuous for the conversation. rustup can already add additional targets after installation, are you suggesting this downloads 10GB SDKs? Definitely not, and that sounds irrelevant. (Even once you do this, the toolchain experience is not as good as what Zig or Go offer.)

Compare what Zig and Go do to what Rust does, not some strawman argument that would require users to download 10GB of SDK with the Rust toolchain. Alternatively, find me someone who is saying they think these multi-gigabyte SDKs should be included, because I don't see that anywhere in this conversation.

People here are complimenting what Zig currently does, which takes less than 40MB compressed. Zig can cross compile to Windows just fine. There are limitations to everything, but what Zig and Go offer is strictly better than what Rust offers in terms of the out-of-box cross compilation experience, and it isn't unduly burdensome on the developers like your proposed 10GB download.

comment 5y ago · link · parent

The thing I dislike about Zig error handling is that there's no way to associate informational context with an error. Bubbling the errors up, you'll eventually print out a string to the console that says "error: AccessDenied". The sysadmin/user running your software will be left baffled. Access denied... to what?!

Zig is 90% of the way there with error handling, but it is extremely obvious to me that you need to be able to have error context carried with the error... it is apparently not obvious to the core Zig team[0], and this is a major impediment to my interest.

Sure, if you're compiling to a microcontroller, maybe you're willing to sacrifice usability to avoid error values ever allocating... but most developers can spare an allocation for errors, especially given that error handling is generally not the hot path.

[0]: https://github.com/ziglang/zig/issues/2647 (among other issues)

comment 5y ago · link · parent

The whole toolchain for Zig, which appears to include complete cross compilation, is less than 40MB compressed[0]. I would hardly call that a "monster download".

I think developers can spare that much space. Besides, storage space is scaling much faster than the number of available targets, so I don't see how this could be "not particularly scalable" unless you either have a weird definition of "target" or predict there's going to be a sudden explosion in the number of targets.

Go also makes cross compilation to any supported target a breeze in the default toolchain download, and it is an incredible convenience for the developer.

[0]: https://ziglang.org/download/

comment 5y ago · link · parent

> But if the producer retries and the consumer does not respond with 200 until it has processed the message, no consumer side message queue is needed, the consumer can rely on the producer to reach at-least-once delivery.

Part of the point of the article was that you may deploy bad code which returns 200, but doesn't actually take the correct action with the events, and then you have lost all that data and have no way to get it back, which is why you have a consumer-side message bus to hold the webhook history, so that you can replay the webhooks if you made a mistake. Your comment does not address this at all.

If the service exposes a /events page, and especially one that supports long polling (or SSE), then you no longer need a consumer-side message bus, and you might not even need webhooks at all.

I definitely think webhooks should be offered, but I agree with the article that webhooks shouldn't be the only thing.

comment 5y ago · link · parent

> But chrome uses the GPU a lot more

[citation needed]

Firefox page rendering is GPU accelerated. It's called WebRender. Your information seems to be out of date.

Article from 2017 when WebRender was still being prepared for release: https://hacks.mozilla.org/2017/10/the-whole-web-at-maximum-f...

Current platform support list, which seems to be "almost everyone": https://wiki.mozilla.org/Platform/GFX/WebRender_Where

comment 5y ago · link · parent

What?

The UDM Pro[0] has a quad-core Cortex A57 CPU running at 1.7GHz, according to the spec sheet I'm looking at right now. It has 4GB of RAM.

The ODROID-N2+[1] has a quad-core Cortex A73 CPU running at 2.4GHz. It also has 4GB of RAM.

The UDM Pro is like half the performance of the ODROID-N2+, accounting for architecture and frequency differences, so... I'm not sure what you're getting at?

The ODROID should be more than enough to handle a gigabit connection if the UDM Pro is even halfway capable of it, from a power perspective. Connecting more ethernet ports to it without an exposed PCIe connector is going to be clunky, but that's not the issue you pointed out.

[0]: https://dl.ubnt.com/ds/udm-pro

[1]: https://www.hardkernel.com/shop/odroid-n2-with-4gbyte-ram-2/

comment 5y ago · link · parent

Calling any benchmark "abysmal" requires a point of comparison, and you have provided none... so it doesn't really encourage good discussion. What's the point of your comment? It seems to just be a way of insulting someone else's product.

Which comparably priced router are you thinking of that has a "non-abysmal" performance curve for small packet bandwidth?

comment 5y ago · link · parent

That's a bit of an odd example to choose.

This[0] has a $600 MSRP, with twelve 10Gbps ports and two 25Gbps ports. It's ~32W before you add the SFP+ modules, and upwards of 50W if you have all modules populated.

In the benchmarks they list, this can provide somewhere on the order of 13Gbps to 40Gbps of routing, depending on exactly what you're doing. (Smaller packets will lower these numbers, but if you care about bandwidth you're unlikely to be worried about smaller packets... at that point, you probably care more about kpps.)

[0]: https://mikrotik.com/product/ccr2004_1g_12s_2xs

comment 5y ago · link · parent

The "system working as intended" would mean that blatantly obvious ideas could not be patented in the first place.

There are only so many ways to do basic things. I'm sure most engineering students could come up with an algorithm to go from a point cloud to a set of polygons, and their algorithms would likely violate a bunch of Matterport's patents, because those patents are so overbroad.[0] That's not okay, in my opinion.

It's like the infamous Mobileye patent that patented the idea of using a camera and a computer to read a speed limit sign while a vehicle was in motion, and then to react to that speed limit in real time. It is written so generically that there is literally no obvious way to avoid violating that patent if you want to have a self-driving vehicle (or vehicle with a strong ADAS) react automatically to posted speed limit signs. As human drivers, we are essentially violating that patent every time we read a speed limit sign, but somehow it's different when a human does it with their eyes (cameras) and brain (computer)?

[0]: Keeping in mind that I am, of course, not a lawyer. Maybe a lawyer would find those patents to be far more specific and complex than I did when I was doing some research, and therefore anyone can implement scene reconstruction without fear of judgment. If that were true, that would be nice.

comment 5y ago · link · parent

Absolutely. The design of the patent system needs to be significantly updated. Every single new thing seems to be violating an assortment of patents, most of them for extremely obvious or common things.

When Apple introduced the LiDAR sensor on iPhone, lots of people started building apps to map out the interior of homes to break the monopoly that Matterport seems to hold on that part of real estate technology.

I started researching that stuff for a tangentially related idea that I have, and if you want to go from a LiDAR point cloud to a set of polygons representing a room, it seemed like you would have to violate a dozen of Matterport's patents. Truly ridiculous stuff. As I dug into the documentation around it, I realized that Apple will actually do the spatial reconstruction for you if you want, which is nice because that presumably means that Apple is the one violating the patents instead of you, right? It's hard to say. I wonder if even a lawyer could give you a straight answer to that question.

Similarly, maybe I want to make a better kind of 2D barcode. QR Code patents supposedly won't be enforced against anyone implementing or using them for QR-compatible codes, if I remember correctly, but... a few years ago when I looked into this, I saw that the company that owned the QR Code patents had continued publishing new patents seemingly in order to extend their hold over QR Codes (and similar 2D barcodes) in perpetuity.

So, if you make any kind of 2D barcode that is even remotely similar to a QR Code, talk to some lawyers or... good luck?

And those are just two examples of things that I have run up against as an individual with ideas who would love to innovate, but feels restricted by the infinite number of patents that exist.

I think some serious reform of intellectual property rights could spur significant new innovations and societal benefit, while still protecting people who are actually innovating and applying those innovations.

(Keep in mind that I am not a lawyer.)

comment 5y ago · link · parent

I've read your other replies to this thread and your argument does not seem to be made in good faith. This whole thread is about surveillance based advertising being bad. In no way is using an IP address in a firewall a form of surveillance. It isn't. The IP address isn't being associated with any other data, it's just some numbers floating in space, disconnected from any human being. There is no association with that IP address of what you like and don't like, what you have purchased, what links you have clicked, or anything else. It's just in a firewall, and that firewall rule could be blocking an entire CIDR block, especially in the case of IPv6. But even if it were surveillance, that's irrelevant to this discussion about the ethics of surveillance-based advertising.

I'm not going to waste my time further on this thread after making this one last point.

> This just slows down bot spam instead of testing if someone is a bot. Someone posting spam to your site once a minute is still annoying.

Google CAPTCHA is trivially bypassed all the time. Do you really think it isn't? Sometimes using services like Amazon Mechanical Turk, sometimes using simple computer vision. It doesn't test whether someone/something is a bot either... it just tests whether they can pass the CAPTCHA. It certainly doesn't test whether they're part of a DDoS, nor does it test their intentions to find whether they are good or malicious. It's just a CAPTCHA, but it also uses a lot of surveillance... and as I said, I have mixed feelings about that. I didn't mean for this to become the point of the thread, it is definitely off topic.

The idea of Proof of Work CAPTCHAs is that you can actually make it more expensive for an attacker to solve those than it would be for the attacker to solve Google CAPTCHAs. Obviously, this is still an area of debate and research.

comment 5y ago · link · parent

An IP address being used in the course of providing the service is not surveillance. That's like saying "Amazon knowing where to ship my package is surveillance." It's a bad argument, in my opinion.

Regardless, consider a DDoS attack. If every new request is coming from a different IP address, how do you continue providing service to your legitimate customers while blocking that malicious attack? Knowing the attacker's IP addresses doesn't do you any good... because they can just keep using new IP addresses, and blocking the old ones doesn't do any good.

This is where heavily surveillance-based systems like Google CAPTCHA often come into play, and I have very mixed feelings about those.

There are some non-surveillance-based captchas like this one[0] that I saw on HN awhile back, and I hope those become successful.

[0]: https://friendlycaptcha.com/

comment 5y ago · link · parent

> this holiday

Which holiday? Christmas, Thanksgiving, New Year, Labor Day... Fourth of July?

Maybe Halloween would be appropriate, given how scary any major Windows upgrade is to enterprise orgs.

If they said "this holiday season", that would probably mean December timeframe, but they don't say that.

They repeat this confusing reference later on:

> The free upgrade will begin to roll out to eligible Windows 10 PCs this holiday and [...]

comment 5y ago · link · parent

Oh, trust me… that Go issue is top of mind for me. I have the fifth comment on that issue, along with several other comments in there, and I’d love to implement it… I’m just not familiar enough with working on Go runtime internals, and motivation for volunteer work is sometimes hard to come by for the past couple of years.

Maybe someday I’ll get it done :)

comment 5y ago · link · parent

BPF, you say? https://lwn.net/Articles/847951/

> The obvious place where BPF can add value is making decisions based on the outcome of previous operations in the ring. Currently, these decisions must be made in user space, which involves potential delays as the relevant process is scheduled and run. Instead, when an operation completes, a BPF program might be able to decide what to do next without ever leaving the kernel. "What to do next" could include submitting more I/O operations, moving on to the next in a series of files to process, or aborting a series of commands if something unexpected happens.

comment 5y ago · link · parent

According to a relevant manpage[0]:

> Only members inside the chain are serialized. A chain of SQEs will be broken, if any request in that chain ends in error. io_uring considers any unexpected result an error. This means that, eg, a short read will also terminate the remainder of the chain. If a chain of SQE links is broken, the remaining unstarted part of the chain will be terminated and completed with -ECANCELED as the error code.

So it sounds like you would need to decide what your strategy is. It sounds like you can inspect the step in the sequence that had the error, learn what the error was, and decide whether you want to re-issue the command that failed along with the remainder of the sequence. For a short read, you should still have access to the bytes that were read, so you're not losing information due to the error.

There is an alternative "hardlink" concept that will continue the command sequence even in the presence of an error in the previous step, like a short read, as long as the previous step was correctly submitted.

Error handling gets in the way of some of the fun, as usual, but it is important to think about.

[0]: https://manpages.debian.org/unstable/liburing-dev/io_uring_e...

comment 5y ago · link · parent

> AFAIK kqueue also supports completion based IO using aio_read/aio_write together with sigevent.

If you can point to a practical example of a program doing it this way and seeing a performance benefit, I would be curious to see it. I did some googling and didn't really even find any articles mentioning this as possibility.

kqueue is widely considered to be readiness based, just like epoll, not completion based.

What you wrote sounds like an interesting hack, but I'm not sure it counts for much if it is impractical to use.

comment 5y ago · link · parent

epoll: tell me when any of these descriptors are ready, then I'll issue another syscall to actually read from that descriptor into a buffer.

io_uring: when any of these descriptors are ready, read into any one of these buffers I've preallocated for you, then let me know when it is done.

Instead of waking up a process just so it can do the work of calling back into the kernel to have the kernel fill a buffer, io_uring skips that extra syscall altogether.

Taking things to the next level, io_uring allows you to chain operations together. You can tell it to read from one socket and write the results into a different socket or directly to a file, and it can do that without waking your process pointlessly at any intermediate stage.

A nearby comment also mentioned opening files, and that's cool too. You could issue an entire command sequence to io_uring, then your program can work on other stuff and check on it later, or just go to sleep until everything is done. You could tell the kernel that you want it to open a connection, write a particular buffer that you prepared for it into that connection, then open a specific file on disk, read the response into that file, close the file, then send a prepared buffer as a response to the connection, close the connection, then let you know that it is all done. You just have to prepare two buffers on the frontend, issue the commands (which could require either 1 or 0 syscalls, depending on how you're using io_uring), then do whatever you want.

You can even have numerous command sequences under kernel control in parallel, you don't have to issue them one at a time and wait on them to finish before you can issue the next one.

With epoll, you have to do every individual step along the way yourself, which involves syscalls, context switches, and potentially more code complexity. Then you realize that epoll doesn't even support file I/O, so you have to mix multiple approaches together to even approximate what io_uring is doing.

(Note: I've been looking for an excuse to use io_uring, so I've read a ton about it, but I don't have any practical experience with it yet. But everything I wrote above should be accurate.)

comment 5y ago · link · parent

> The new M1 macbooks couldn't even run Docker

Docker has worked on M1 Macs since... mid-December of last year. Less than a month after they were released? Why was anyone on your "dev team" using M1 Macs within weeks of launch? At that point, even installing things with Homebrew required compiling everything from scratch. Not a very great use of developer time.

> more often than not it is a crutch used to make up for the fact that many web developers don't really know how to properly manage their machines.

This is like saying that an electric starter is a crutch, and Real Drivers relish the opportunity to spend 20 minutes using a crank starter to "properly" start their car's engine every time they need to go somewhere. No thanks. Like using a crank starter, managing a bespoke local environment is not some incredible skillset, even though you seem to be giving yourself a nice pat on the back for it. It's simply a questionable use of developer time, and doubly so if all of your production environments aren't identical.

comment 5y ago · link · parent

> Sure, but usual practice with containers is to put each thing in its own, unless they are very tightly coupled. Web-app with a SQL database and a memory cache? Three containers. You can do otherwise, but that's typical. Usually each container ends up with one main, important running process, and not much else.

I agree, but... getting all the application dependencies in there is more than just getting a single binary in there. If it's just a single-binary Go program, then a Jail works just fine, but it's not that simple for a Ruby application. I'm definitely not talking about databases running in the same container as the application. That's where Kubernetes and docker-compose come in for multi-container orchestration, which are things that FreeBSD Jails don't have as far as I know.

> These are exactly the kinds of things I was thinking of when I noted that the OS itself has been seriously diminished in importance

Yes, but... these are all the things that FreeBSD doesn't offer. These are the real reasons that people don't talk about FreeBSD Jails in the same breath as Docker. The Docker container itself (or the FreeBSD Jail) as a unit of isolation is the least interesting part of the ecosystem. All of the developer tools, orchestration tools, and prebuilt images are what make the Docker universe so interesting, and make FreeBSD Jails... less interesting.

You said you were confused why Jails don't have more mindshare. It has absolutely nothing to do with people being able to invent useless tools and write blog posts about them, and it has absolutely nothing to do with FreeBSD Jails being too well documented. You kind of implied those were the best explanations you could come up with. Those are not the problems at all, and it seems disingenuous to me to say you think those are the problems unless you really didn't know the things I mentioned in my first reply.

comment 5y ago · link · parent

It seems like you're missing a lot of things.

As a developer, how do I run FreeBSD Jails on my MacBook during development? With Docker for Mac, it is trivial for me to do everything on my Mac, and the fact that there is a virtual machine is completely invisible to me. Everything "Just Works". With FreeBSD Jails, I would have to actually interact with a VM constantly, including the pain of shipping files back and forth.

As a developer, are popular databases and applications pre-packaged as FreeBSD Jails so that I can spin one up on my laptop with a single command? Where is the Docker Hub equivalent?

As a developer, how do I orchestrate a collection of FreeBSD Jails for each project? With Docker, I define a single `docker-compose.yml` file for each project. With a single `docker-compose up`, the entire project is running including dependencies such as databases and other related projects in a completely reproducible fashion. This makes it trivial for coworkers to spin up a project on their machine and immediately be productive without spending an hour trying to get all the right versions of everything installed and up and running.

As someone responsible for deploying an application to production, what is the story around FreeBSD Jails for deploying across a cluster? Is there a Kubernetes-equivalent that can manage the allocation of resources, blue-green deployments, and manage the lifecycle of my FreeBSD Jails?

As someone responsible for deploying an application to production, do any of the major clouds support FreeBSD Jails? With Docker images, I can deploy those straight to ECS Fargate, Google Cloud Run, and half a dozen other services. Then I don't even have to think about my own infrastructure unless I need some really specialized hardware for a specific application.

> the rest barely matters anymore.

Everything else matters so much.

As to your earlier point about ZFS, most Linux distros these days seem to trivially support ZFS. Even TrueNAS is working on switching to Linux with their TrueNAS Scale offering.

It's not that I'm opposed to FreeBSD... FreeBSD is just a hard sell. It's hard to pin down exactly what you're gaining by throwing out all the collective Linux knowledge of an organization and switching to FreeBSD. FreeBSD is an N-th tier platform for pretty much every programming language except C, so good luck when you run into random subtle problems. Also, good luck doing hardware accelerated machine learning inference or training on FreeBSD... it's probably possible?

> the single important binary

This is also such a weird thing to throw out there. I like a good Go program myself, but most companies are not only deploying single-binary statically linked applications. Most companies are also deploying some kind of Ruby, Python, or Java application... none of which are likely to be a single file in practice. Most of them will have a variety of shared libraries, and I don't know if I've ever seen a Ruby application shipped in a `FROM scratch` container before. Technically possible, but that's just not common reality as far as I've seen. It sounds like you're proposing that everyone is already running in `FROM scratch` containers, so a FreeBSD Jail is just a drop-in replacement.

Linux containers are far from perfect, but as a developer... I have played with FreeBSD Jails before, and come away frustrated by all the work you have to do yourself.

comment 5y ago · link · parent

If anyone wants to read more about Reed Solomon, this is the article that helped me understand Reed Solomon earlier this year: https://innovation.vivint.com/introduction-to-reed-solomon-b...

comment 5y ago · link · parent

Seems like it was postponed[0].

For very tiny hooks, you might be able to get away with using request matchers[1] and respond[2].

[0]: https://caddy.community/t/missing-starlark-documentation/958...

[1]: https://caddyserver.com/docs/caddyfile/matchers

[2]: https://caddyserver.com/docs/caddyfile/directives/respond

comment 5y ago · link · parent

This is far from the only arena allocator written in Rust.

From the same author, a zero-unsafe arena allocator: https://github.com/fitzgen/generational-arena

There are many, many arena implementations available with varying characteristics. It's disingenuous to act like Rust requires the author of an arena library to write "unsafe" everywhere.

comment 5y ago · link · parent

> The important thing to note about the moose test is that it doesn't specify that the moose has to survive.

The moose test is about safely dodging around a moose that wanders out onto the road without wrecking the vehicle.

Why did you write this long comment as if you were an expert on the moose test if you don't even know what the moose test is? That's an incredibly disingenuous thing to do.

Example: https://www.youtube.com/watch?v=Sv9Oo5TMiWw

1
464748
66