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

> pricing tools that always seem to miss the mark in a major way that's only obvious in hindsight and seems to be consistently worse than other clouds.

Can you provide an example of a service that the AWS calculator doesn't compute the correct price for?

I honestly can't remember ever being surprised by what things on AWS cost, and I don't think I'm that shockingly good at detecting hidden costs.

comment 5y ago · link · parent

I don't really agree with that comment. I think all of the megaclouds have undesirably complex pricing structures, but they also all provide pricing calculators. AWS has one here: https://calculator.aws/

If I punch in the services I want to use, I can quickly see how much they will cost, and it's easy. I recommend clicking "Advanced" inside services on the calculator if you want to be sure you're not going to run into an edge case that costs lots of money unexpectedly.

If you use any of the megaclouds without first understanding the price structure, good luck.

Personally, I think a lot of companies would be better off using DigitalOcean or some other medium-size cloud. The pricing is much simpler, and pretty much all medium-size clouds charge $0.02/GB for egress bandwidth, either globally or in the US, depending on the provider.

In contrast, the megaclouds make shocking amounts of money off of their extremely pricey egress bandwidth, among other highly profitable aspects of their business.

Even still, AWS is a solid cloud platform, and they really do seem customer obsessed compared to what I've seen happen on GCP.

comment 5y ago · link · parent

As I said:

> Apple has reasons for soldering down components, reasons which I don't really agree with, but I don't think they're all that worried about a small percentage of people avoiding their upgrade prices.

comment 5y ago · link · parent

I haven't even installed Chrome on this laptop. I switch between Safari and Firefox.

I wonder if Chrome's memory usage pattern is a contributing factor.

comment 5y ago · link · parent

Apple still charges that kind of premium on RAM even on the Intel Mac mini where you can replace the RAM.

People still pay it, because most people probably don't know the RAM is replaceable, don't want to be bothered with doing it themselves, don't want to accidentally damage their new computer, don't realize the upgrade prices are high, or other reasons.

Apple has always charged high premiums for upgrades... premium upgrades aren't a strategy they suddenly invented when they started soldering components down.

Apple has reasons for soldering down components, reasons which I don't really agree with, but I don't think they're all that worried about a small percentage of people avoiding their upgrade prices.

comment 5y ago · link · parent

I've had my 256GB SSD + 16GB RAM M1 MBA for a little over 2 months now. There was one time that I noticed a strangely large amount of swap usage for no discernible reason, and rebooted immediately. Otherwise, swap doesn't seem to be used that often.

I really don't understand why Apple is apparently incapable of making these laptops use standard, replaceable m.2 NVMe SSDs.

Seeing this thread made me concerned, but it looks like my SSD isn't something to be worried about yet:

    SMART/Health Information (NVMe Log 0x02)
    Critical Warning:           0x00
    Temperature:                34 Celsius
    Available Spare:            100%
    Available Spare Threshold:  99%
    Percentage Used:            0%
    Data Units Read:            6,963,442 [3.56 TB]
    Data Units Written:         3,626,988 [1.85 TB]
    Host Read Commands:         110,283,456
    Host Write Commands:        59,878,323

comment 5y ago · link · parent

Playing advocate for the idea:

There are a lot more people far away from you than there are close to you. If breaking your security requires physical proximity (such as to steal a yubikey), then you are much safer just based on this. It's also easier for people to blindly steal credentials for millions of people online than it is for them to steal millions of physical security keys.

Alternatively, passwords are commonly reused across websites, so a failure of any of those websites can lead to a compromise of all of them, which is not the case with a YubiKey. Along that same line of thought, passwords are phishable, where YubiKeys are not.

It's also possible that people in your physical proximity could shoulder surf your password, install a keylogger (which could be a physical keylogger, if you normally use a USB keyboard, not just software), or use a strategically positioned camera to do some digital shoulder surfing. Passwords aren't immune to trust issues when it comes to physical proximity. Ideally, you trust those you are near to some extent.

YubiKey also has a fingerprint-protected device coming out soon[0]... which would raise the bar for the threat model in this discussion some. Using a fingerprint and/or PIN to unlock a YubiKey preserves most of the benefits, while eliminating most of the concerns that people are mentioning. HSMs can choose to self-erase after a certain number of failed PIN attempts, so even a short PIN is not something that can easily be brute forced without an unpatched vulnerability.

If websites would allow you to only use any one of your YubiKeys to authenticate (obviously meaning you can have multiple, with backup YubiKeys stored somewhere safe in case you lose your main one), I think that would be a significant improvement in security over password authentication for most people. This is basically what the WebAuthn standard is attempting to do. I don't expect most people to be interested in buying 3 security keys and carrying one around all the time, though.

[0]: https://www.yubico.com/blog/yubico-reveals-first-biometric-y...

comment 5y ago · link · parent

This is by far the best tool for the job that I've found: https://github.com/cortesi/modd

comment 5y ago · link · parent

Which platforms does Red Hat support Linux containers on that Rust doesn't support? Which platforms is anyone else frequently using Linux containers on that Rust doesn't support? I'm pretty sure the venn diagram here would be a single circle. Rust supports the major architectures.

Portability seems like an unlikely reason here, but I would pick memory safety over portability every single day of the week. Rust is far from the only language that offers memory safety, but it is certainly one of the most compelling ones for projects that would otherwise be written in C.

"runc" is battle tested, written almost entirely in Go, which offers memory safety, and the performance delta under discussion is only about 2x for a part of the system that seemingly only has a measurable performance impact if you're starting containers as quickly as possible.

This just isn't a very compelling use case for C.

comment 5y ago · link · parent

Saying C is easier to secure than Modern C++ is just confusing. The point of a lot of recent C++ features is to make memory safety easier to achieve. I personally don't think it gets anywhere close to safe enough for me to recommend, when Rust is such a competent option that people can choose instead. I would still rather people have the tools of C++ at their disposal instead of having to do everything themselves in C.

Please find me a well-known C code base that doesn't suffer from memory safety CVEs. You're the one making the claim that they exist... I can't prove that such a thing doesn't exist, but I can point to how curl[0][1], sqlite[2][3], the linux kernel[4][5], and any other popular, respected C code base that I can think of suffers from numerous memory safety issues that memory safe languages are built to prevent.

Writing secure software is hard enough without picking a memory unsafe language as the foundation of that software.

"Just find/be a better programmer" isn't the solution. We've tried that for decades with little success. The continued prevalence of memory safety vulnerability in these C code bases shows that existing static analysis tools are insufficient for handling the many ways that things can go wrong in C.

I think you mentioned railcar elsewhere in this thread, and I would find it easier to be interested in a runc alternative that is written in a memory safe language... which railcar is.

[0]: https://curl.se/docs/CVE-2019-5482.html

[1]: https://curl.se/docs/CVE-2019-3823.html

(among numerous others)

[2]: https://www.darkreading.com/attacks-breaches/researchers-sho...

[3]: http://cve.mitre.org/cgi-bin/cvekey.cgi?keyword=SQLite

(the second link has quite a few memory safety issues that are readily apparent, including several from SQLite that affected Chrome)

[4]: https://www.cvedetails.com/cve/CVE-2019-11599/

[5]: https://www.cvedetails.com/cve/CVE-2018-15471/

comment 5y ago · link · parent

Heh, I actually edited gVisor in right before your reply.

I agree completely!

comment 5y ago · link · parent

Yeah. I just don’t think “runc” has ever been a bottleneck in any systems I’ve worked with.

It’s been years since I’ve been able to get excited about rewriting systems from a memory safe language into a memory unsafe language for “performance reasons”. As an industry, we have too much evidence that even the best humans make mistakes. Quality C codebases still consistently run into CVEs that a memory safe language would have prevented.

Rust exists, if performance is so critical here and if Go were somehow at fault... but it sounds like most of the performance difference is due to a different architecture, so rewriting runc in Go probably could have had the same outcome.

I wish I could be excited about crun... I’m sure the author has put a lot of effort into it. Instead, I’m more excited about things like Firecracker or gVisor that enable people to further isolate containers, even though such a thing naturally comes with some performance impact.

comment 5y ago · link · parent

Server side state can take many forms. In general, you already have to track state per customer anyways, and that often goes in a database. You can also keep per client state in the database too, if it won’t fit in memory for some reason.

idk, it all depends on what you’re using the websockets for. If you have to send messages from one websocket client to another, things can get harder because those two websockets might not be connected to the same server.

comment 5y ago · link · parent

You're referring to how some languages have non-nullable references, which is fine. That's probably a better term to be using, since it is more clearly defined and less contentious in this discussion.

I agree that Go should consider adopting non-nullable references.

comment 5y ago · link · parent

> If it is my discipline to add null guards or have runtime explosions I consider the nulls to be implicit.

But they're still explicit nulls.

You seem to be saying that only implicit nulls require null guards, but that's just not what that means (as far as I have learned).

You seem to hate nullability as a concept, which is fine, but that's different from hating implicit nullability.

> That you find as much runtime problems with unwrap/expect in Rust (which have a lot of red tape on them in API docs) as with "missing null guards" in Go, is great for you, but to me that does not make it a good design choice in Go.

It's also a comment on how NPEs are just not a common hazard in Go compared to my past experiences with Java, especially when combined with good editors and linters.

comment 5y ago · link · parent

That's not implicit nullability, in my opinion.

I agree that non-nullable references are wonderful, and Go will probably have to grapple with that eventually. I just don't want people to get the wrong idea. Go has value types -- not everything is a reference that is implicitly nullable.

C isn't implicitly nullable, you are correct.

comment 5y ago · link · parent

You can't check for nil on something that isn't nilable -- it's a compile error to do so in Go.

Your definition of "implicit nullability" is suspect here.

Go doesn't even implicitly de-reference things, which is what I think you're intending to say that it does. (EDIT: field access does cause a dereference, as was pointed out in a response to this comment. I still think of this as an explicit action when you're specifically operating on a pointer variable, but I'll concede this point here.)

Your position on this is really confusing at the moment. Go handles nullability in an extremely different way from Java.

Edit for your edit:

> clarification, to me it does not show in the type signature that something may return a null

The best way to know something won't be null is to use value types where possible. Don't return nilable values unless you have a good reason. When you return nilable values, only return nil when the error value isn't nil. This is a common pattern in Go code. Why would you return nil if there wasn't an error? If there was an error, why would you care what else was returned, outside of some very exceptional circumstances?

> also I do not have to unpack a possible null value (like with Maybe or Option).

I write Rust and Go professionally... I'm familiar with the pros and cons here, and I wish that Go would adopt Sum Types, but this has nothing to do with "implicit nullability", and in practice... it's really not a big deal. I've written huge amounts of Go code, and I just don't remember encountering nil exceptions in production except once in a blue moon -- and it is similarly common in Rust to hit an "expect" or "unwrap" that you thought was statically impossible to reach. Go has good editors (like GoLand) and linters (like golangci-lint) that make it easy to avoid most of the practical pitfalls.

comment 5y ago · link · parent

> Of course I'm joking, but I think implicit nullability is the worst part of Go.

Go doesn't have implicit nullability. You have to declare that something is a pointer for it to be nullable.

There are a few kinds of pointers: "normal" pointers, slices, maps, function pointers, and interfaces. Any of those pointer types are nilable. Regular structs and primitives are not nilable.

    var x someStruct = nil //this will not compile
    var x int = nil //this also won't compile

comment 5y ago · link · parent

Awesome! I had heard of wasmer before, but I didn't realize its performance was that good yet. I'll definitely be paying closer attention to this space now.

Although, on closer inspection it seems like wasmer is using LLVM as a backend to get that good performance, which tempers my enthusiasm a little bit. I see that wasmer also supports the Cranelift backend, but the promised performance blog post[1] doesn't seem to have been published yet, so I don't know how much of a difference that makes in the real world.

A ~13x difference in JIT compile time (LLVM vs Cranelift) is huge, and waiting on LLVM itself to compile can also be... exciting. LLVM does good work for AOT compilation, but I don't know how I feel about the trade-offs of using it as a JIT. If a massive C++ code base is going to be pulled in anyways, I would almost rather them pull in V8 than LLVM... but that's just my opinion, since V8 seems to be very well optimized for the JIT use case.

But, I'm glad there is the choice to use Cranelift (and presumably exclude LLVM from the final binary) if that fits a particular use case, and I'm excited to see that follow-up blog post whenever the wasmer team has time to publish it.

[1]: https://medium.com/wasmer/wasmer-1-0-3f86ca18c043

comment 5y ago · link · parent

That project does look really fun!

I can't tell if that is pulling V8 in as the WASM interpreter or not. Obviously, I would prefer that they leave others in the dust without having to pull in a huge C++ codebase, but it still sounds promising either way!

comment 5y ago · link · parent

I disagree.

Saying that it is "great" is really overselling it at this point, unless the languages you're comparing to are mainly C or C++. I would also toss Ruby in that category for now, but they seem to be working on making async better with Ruby 3+.

When compared to Python, JavaScript, or C#... Rust's language support for async isn't really that impressive to most developers, although the implementation has some technical characteristics that are nice for people who care about the low level details. The ecosystem is pretty lacking, even though it is much better than it was a few years ago.

Compared to the aforementioned languages (including Rust), Go and BEAM-based languages are just on another level.

I'm sure both Rust's language ergonomics and the ecosystem will improve over time, but Rust's goals also make it unlikely to ever be compatible with my definition of a great async system... which is the model Go and Erlang use where the developer can't tell that every single sequential process isn't running in a separate OS thread -- and, by extension, every function is automatically async with no distinction that I have to worry about.

In Go, I can spin up as many goroutines as I need, and I don't have to worry about any single goroutine blocking an executor like I have to worry about in Rust.

Yes, some async runtimes in Rust have worked on clever things like monitoring the executor threads and spawning a new executor to steal a blocked executor's work queue... maybe some day that will be a battle tested solution. Like most of the Rust async story, there are rough edges that could benefit from some more time.

(I have worked professionally with both Rust and Go for several years, and I think they're both great languages with different trade offs... I'm not trying to bash Rust here.)

comment 5y ago · link · parent

Not really. A websocket is "just" a TCP connection.

If the API provider is using a language+framework that can't easily handle lots of concurrent TCP connections, then yes, that could cause scaling issues, but... that's a choice.

There are plenty of ways to build scalable socket servers, and it's especially feasible in languages like Go and Elixir.

comment 5y ago · link · parent

Your response is basically the first part of another response that was submitted minutes before yours.

See my comment here: https://news.ycombinator.com/edit?id=25861502

comment 5y ago · link · parent

Your comment is predicated on the assumption that they couldn't have worked with the other RISC-V design teams in this space for the past few years -- that they would have had to wait until products hit the shelves in order to start, which is simply not true. They could have started design collaboration with others whenever they started this project, and they would have almost certainly ended up where they are now today, except with RISC-V.

Most likely, the real issue is that it would have required them to make a really visionary choice, which does come with a significant level of risk. Hindsight is 20-20, and with perfect clarity we can see now that that RISC-V ecosystem has matured extremely quickly and is now a very compelling place to be. There is a ton of stuff in RISC-V -- it's not some void as you seem to be implying.

Instead, when they set out on this project, they chose to lean on their own internal strengths, which is certainly the ARM architecture. Back then, I'm sure things were less obvious than they are now -- but that's why I want them to do visionary things to move industry and education forward.

Espressif (the makers of ESP32) don't seem to be in nearly as comfortable of a position to try innovative things as the Raspberry Pi Foundation is, yet they managed to release a compelling RISC-V option -- because that industry trend was obvious enough to them, I guess, even if it wasn't obvious enough to the Raspberry Pi Foundation.

As I've indicated, I'm sure this product will be successful, and I'm excited to see what people do with this, but I can still wish the Pi Foundation would have done something more here. I'm not wishing them failure or anything like that at all.

comment 5y ago · link · parent

RISC-V is a real option today. In fact, it has been a real option for awhile now.

To provide just two quick examples:

- https://www.sparkfun.com/products/15594

- https://www.cnx-software.com/2020/12/20/esp32-c3-wifi-ble-ri...

Since Raspberry Pi was going so far as to make their own silicon, they definitely could have opted to include a RISC-V design instead of an ARM design. They simply chose not to.

RISC-V would have made this product an instant buy in my books, but there are numerous Cortex-M0+-based microcontrollers and microcontroller boards out there already.

The Pi Pico is appealing because of all the documentation and the ecosystem that is sure to develop around it, so I'm not here to claim that this product won't be wildly succesful, but the M0+ is just not the choice I would have expected them to make. RISC-V seems like it would have aligned much better with the Raspberry Pi Foundation's mission.

In fact, if they had chosen to integrate the ESP32-C3 into this product instead of their custom silicon, people would be receiving RISC-V, WiFi, and Bluetooth -- and you can imagine how beneficial that would be. The ESP32-C3 is supposed to cost around $1, so it's not like it would have been outrageously expensive or something.

comment 5y ago · link · parent

I think the major difference is that a microcontroller can rapidly enter and leave sleep mode, and will likely spend most of its time sleeping. The other Pi products do not support sleeping at all to my knowledge, which makes them an awful fit for battery powered devices.

A microcontroller like this should be able to sleep for microseconds at a time or possibly even less (but you can obviously sleep for long periods of time too), letting you spend the majority of every second asleep, just waking up for brief instants throughout the second (possibly thousands of times) to do work. This enables huge power savings over something like the Pi Zero.

You can also run the microcontroller at a lower clock speed to save more power, if you don't need to run at maximum speed to get things done.

I would be curious what process node this microcontroller is built on, because I completely understand why these numbers would be discouraging when the microcontroller is running at full tilt.

comment 5y ago · link · parent

You're going to have to provide a link to whatever you're talking about. The Pi Pico is the only hardware product that the Raspberry Pi Foundation is releasing to the general public today. They have partners releasing other products based on the RP2040.

I think you're referring to the Pi Pico, but you think it's called something else. There is no product called "Pi Si", as far as I can find. The link that this HN post is pointing to is about the Pi Pico.

If you're just referring to the chip itself ("Raspberry Silicon", "RP2040"), all surface mount chips have to be used on a "motherboard" (PCB) of some kind, so the question seems irrelevant. Based on the datasheet, yes, the chip seems to have no internal flash, so you have to use an external flash chip, but even if it did have internal flash... you would still have to use the chip on a PCB, so it doesn't matter in regards to the original question.

1
505152
66