HNHacker News
TopNewBestAskShowJobs

alexhutcheson

3,780 karma · joined February 17, 2013

Nothing I post reflects the views or policies of my employers, past or present.
submissionscomments
alexhutcheson··on The economics of all-you-can-eat buffets (2020)
The Park Database has a great 3-park blog series on the business of theme parks. This is part I, the others are linked from there: http://www.theparkdb.com/blog/the-business-of-theme-parks-pa...

They have a really interesting blog overall.

alexhutcheson··on Being fair about memory safety and performance
cxx is a huge improvement over manually writing bindings in C (with the inherent limitations imposed by C’s lack of expressiveness). At the same time, you still have to write a cxx::bridge to specify every boundary between Rust and C++ code, and the clients of on either side need to code against some generated code, not a simple .rs or .h file. It’s a huge improvement, but it’s still a lot more developer effort and boilerplate to use a C++ class from a Rust file than it would be to use that same C++ class from another C++ file.

cxx also can only handle a subset of the interfaces expressive in C++. If you haven’t written the interface with the specific goal of making it usable via cxx, it’s pretty likely you’ll have issues wrapping it with cxx.

alexhutcheson··on Being fair about memory safety and performance
> Rust is technically better than C++ in most possible ways — in some, significantly better — and worse in almost no way.

It's much worse in one way: Interoperation with existing C++ code. Sure, that's not a fair criteria - C++ is designed in a way that makes it almost impossible for other languages to use C++ libraries without a heavyweight wrapper like SWIG. However, even though it's not fair, it's still really important. If you have a project like LLVM with millions of lines of existing C++ code, adding expensive or complicated interop boundaries between different components within your system is not an acceptable price to pay.

alexhutcheson··on Show HN: Time travel debugger for web development
Not a book, but Andreas Zeller’s free “Software Debugging” course on Udacity is excellent: https://www.udacity.com/course/software-debugging--cs259
alexhutcheson··on Go proposal: new package to provide generic slice functions
> If you've ever implemented C++ iterators, you'll be pleasantly surprised at how elegant it is in Rust by comparison

You probably already know this, but if you're willing to take a dependency on Boost.Iterator, then boost::iterator_facade[1] makes it much easier and less error-prone to implement a standards-conforming iterator, and the pre-built iterator adapters[2] cover lots of common cases, so you don't need to directly implement an iterator at all.

Not arguing the relative merits of C++ vs. Rust, just leaving a pointer here for anyone who didn't know about it.

[1] https://www.boost.org/doc/libs/1_66_0/libs/iterator/doc/iter...

[2] https://www.boost.org/doc/libs/1_66_0/libs/iterator/doc/inde...

alexhutcheson··on Scaling monorepo maintenance
My example was a library, so both the library and it’s caller are in the same release artifact (binary/JAR/whatever).

If you’re changing the interface of an RPC service, then you can’t do that in a single commit, and need to fall back to something like the second approach, but with even more caution to make sure you properly account for releases and the possibility of rollbacks.

alexhutcheson··on Scaling monorepo maintenance
1. You determine that a library used by a sizable fraction of the code in your entire org has a problem that’s critical to fix (maybe a security issue, or maybe the change could just save millions of dollars in compute resources, etc.), but the fix requires updating the use of that library in ~30 call sites spread across the codebases of ~10 different teams.

2. You create a PR that fixes the code and the problematic call sites in a single commit. It gets merged and you’re done.

In the multi-repo world, you need to instead:

1. Add conditional branching in your library so that it supports both the old behavior and new behavior. This could be an experiment flag, a new method DoSomethingV2, a new constructor arg, etc. Depending on how you do this, you might dramatically increase the number of call sites that need to be modified.

2. Either wait for all the problematic clients to update to the new version of your library, or create PRs to manually bump their version. Whoops - turns out a couple of them were on a very old version, and the upgrade is non-trivial. Now that’s your problem to resolve before you proceed.

3. Create PRs to modify the calling code in every repo that includes problematic calls, and follow up with 10 different reviewers to get them merged.

4. If you still have the stamina, go through steps 1-3 again to clean up the conditional logic you added to your library in step 1.

Basically, if code calls libraries that exist in different repos, then making backwards-incompatible changes to those libraries becomes extremely expensive. This is bad, because sometimes backwards-incompatible changes would have very high value.

If the numbers from my example were higher (e.g. 1000 call sites across 100 teams), then the library maintainer in a monorepo would probably still want to use a feature flag or similar to avoid trying to merge a commit that affects 1000 files in one go. However, the library maintainer’s job is still dramatically easier, because they don’t have to deal with 100 individual repos, and they don’t need to do anything to ensure that everyone is using the latest version of their library.

alexhutcheson··on How to Write an Equality Method in Java (2009)
Thanks, I edited with your correction.
alexhutcheson··on How to Write an Equality Method in Java (2009)
For immutable value types, AutoValue[1] is a nice library for automating this. Lombok[2] is also popular, but a lot of orgs avoid it because it has some pretty deep dependencies on implementation details of the JDK that aren't guaranteed to be stable across releases. It seems well-maintained in practice, though. Once Java 16 is widely adopted, Java records[3] will probably be the preferred approach, but it will be a while before most teams are on a version of the JDK that supports them.

For mutable objects, the notion of equality is hairy in general, because what you want often depends on why you'd be comparing the two objects. You might have two mutable objects that can be meaningfully compared in your business logic, but absolutely should not be used as keys in a map. Often you can satisfy your goals by implementing a separate method that does not attempt to conform to the 'equals' contract, which ensures it will not unintentionally be used for e.g. data structure ordering.

[1] https://github.com/google/auto/blob/master/value/userguide/i...

[2] https://projectlombok.org/features/EqualsAndHashCode

[3] https://blogs.oracle.com/javamagazine/records-come-to-java

alexhutcheson··on Proposed futex2 allows Linux to mimic the NT kernel for better Wine performance
Bummer that this doesn’t seem to support or explicitly plan for the proposed FUTEX_SWAP operation[1] (unless I’m missing it).

[1] https://lwn.net/Articles/824409/

alexhutcheson··on The Blue Hole in the Red Sea is the deadliest dive site in the world
You might also like this one about a dive in Norway: The cave divers who went back for their friends[0]

[0] https://www.bbc.com/news/magazine-36097300

alexhutcheson··on [dead]
This seems to be a proposal in the early stages of winding through the bureaucracy, and hasn’t been approved by any real policymakers yet. I wouldn’t put too much stock in it at this point.
alexhutcheson··on Beej’s Guide to C Programming [pdf]
It’s not standardized, but if you’re using gcc, you can use the cleanup attribute for this: https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attribute...

IIRC clang implements it as well, but I wasn’t able to find a reference to it in their docs.

alexhutcheson··on How to find a job as Software Developer in Germany
> The same salary in US could be viewed as 'you are rich' or 'you can't pay rent' depending on with city you live in. Now, you are talking about different continents.

"You can't make rent"/"You can't buy a house with a reasonable commute" an a software dev salary is almost entirely a California and NYC-area phenomenon.

A "typical" software developer (even a junior) could afford a decent house within a reasonable commute in ~7 of the top 10 metro areas in the US (Chicago, Dallas, Houston, Miami, Philadelphia, Atlanta). In the remaining 3 (NYC, LA, DC), you'd probably end up with an unpleasantly long commute, although plenty of people make that choice. If you go further down the list of metros, the ratio is similar.

> How long does it take to buy a house/apartment?

In any of the metro areas mentioned above, you should be able to buy a house on a software dev salary as soon as you've save a 5-10% down payment (so $25-50k for a $500k house, more if you want something bigger/in a nicer area). The difference in salaries vs. Europe would typically allow you to save that within a couple years.

> Can you afford to travel on vacation?

Unambiguous yes - you can afford the monetary cost of a vacation on a software dev salary. Families in much less lucrative fields than software still take vacations.

Paid time off is trickier - European norms are for employers to provide much higher amounts of PTO for all employees, while most American firms are much stingier with it. This is something to explicitly shop around for and use as a decision criteria in a job hunt. There are definitely large American firms that provide 20-25 PTO days standard for new employees.

> Can you save money for your kids' college (or do you even need to do that)?

Annual tuition & mandatory fees at the flagship state university in the median state is ~$12k, so ~$48k for a 4-year degree. This excludes living costs, but you have to pay living costs at European universities as well. If returns on your college investments keep pace with tuition increases (many states have programs that can explicitly guarantee this), then you can pay tuition after 18 years by saving $2700/year per child.

You didn't mention healthcare, which often comes up, but software devs working as full-time employees will typically have good health insurance available through work, so that's not a problem in practice either.

There are tons of reasons to prefer Europe vs. the US (culture, a preference for dense living, lower-pressure work environments, more paid time off, etc.) but overall buying power isn't really one of them. Your salary will buy you more "stuff" (housing, cars, vacations, savings, etc.) in the US, unless you choose to live in one of the highest-cost regions of the country without a correspondingly high salary.

alexhutcheson··on Include-what-you-use: A tool to analyze includes in C and C++ source files
clang-include-fixer is the better tool for that: https://clang.llvm.org/extra/clang-include-fixer.html
alexhutcheson··on J2 open processor: an open source processor using the SuperH ISA
I think https://github.com/j-core/j-core-ice40 is the better repo to check out.
alexhutcheson··on Proposed acquisition of ARM Limited by NVIDIA: public interest intervention
Didn’t realize that - awesome to know. Looking forward to seeing their future announcements.
alexhutcheson··on Proposed acquisition of ARM Limited by NVIDIA: public interest intervention
It seems surprising to assert that Nvidia would slash R&D after the acquisition, considering Nvidia’s demonstrated willingness to spend enormous amounts of money on R&D, even for speculative and risky products. For example, they funded the Project Denver/Carmel team for almost a decade, even though the resulting microarchitectures didn’t seem to have gained significant commercial traction.

If this was a sale to a PE firm I think your predictions would be more likely, but Nvidia seems really unlikely to be a “slash costs and sell it for parts” type of buyer.

alexhutcheson··on FTP is 50 years old
https://en.wikipedia.org/wiki/Flag_semaphore would have been good if you needed to send arbitrary text.

Naval flags would be higher bandwidth if you could pre-arrange a modest-sized dictionary of the words and phrases you’d need.

https://www.navalgazing.net/Signalling-Part-1 is a good read.

alexhutcheson··on An RFC that adds support for Rust to the Linux kernel
No, by “can be idiomatic”, I meant “is already idiomatic in many codebases”. To name one prominent example among many, LLVM disables exceptions and requires that errors be returned as a value: https://llvm.org/docs/CodingStandards.html#do-not-use-rtti-o....

Disabling exceptions isn’t “fighting against how everyone else writes the language” - it’s pretty common and well-supported.

alexhutcheson··on An RFC that adds support for Rust to the Linux kernel
Result types can be just as idiomatic in C++. The codebase I work in has exceptions disabled and uses absl::Status and absl::StatusOr[1] everywhere.

[1] https://abseil.io/docs/cpp/guides/status

alexhutcheson··on An RFC that adds support for Rust to the Linux kernel
ARM seems to have pretty thoroughly won the category of “embedded targets that are capable enough to run Linux”, though. Other than ARM and (presumably in the future) RISC-V, what other architectures are still relevant for new embedded designs that would run Linux?

Obviously there is still significantly more diversity at the low end of the embedded world, but you wouldn’t run Linux on e.g. an MSP430, even if you somehow had a compiler that would support that.

alexhutcheson··on What was the point of [ “x$var” = “xval” ]?
For #1, you can just put #!/bin/bash at the top of the file to use Bash. Bash is still available, it’s just not the default for scripts that specify #!/bin/sh.

#2 is still currently tricky, but Rob Landley (former Busybox maintainer) is working on a full bug-for-bug compatible Bash clone called toysh which will be included in an upcoming release of Toybox[1]. Once that’s released, I’m looking forward to (hopefully) never writing a script for BusyBox ash again.

[1] http://landley.net/toybox/about.html

alexhutcheson··on Nvidia Unveils Grace: A High-Performance Arm CPU for Use in Big AI Systems
Yeah will be interesting to see if and when they bring a design to market.
alexhutcheson··on Nvidia Unveils Grace: A High-Performance Arm CPU for Use in Big AI Systems
The fact that they are using a Neoverse core licensed from ARM seems to imply that there won’t be another generation for NVidia’s Denver/Carmel microarchitectures. Somewhat of a shame, because those microarchitectures were unorthodox in some ways, and it would have been interesting to see where that line of evolution would have lead.

I believe this leaves Apple, ARM, Fujitsu, and Marvell as the only companies currently designing and selling cores that implement the ARM instruction set. That may drop to 3 in the next generation, since it’s not obvious that Marvell’s ThunderX3 cores are really seeing enough traction to be be worth the non-recurring engineering costs of a custom core. Are there any others?

alexhutcheson··on Exodus: Easily migrate your JVM code from Maven to Bazel
What are the best-in-class replacements for those?
alexhutcheson··on PostGIS – Spatial and Geographic Objects for PostgreSQL
If you really need to scale beyond what Postgres/PostGIS can handle, then you might want to check out GeoMesa[1], which is (very loosely) "PostGIS for HBase, Cassandra, or Google BigTable".

That being said, you may not need it, because Postgres/PostGIS can scale vertically to handle larger datasets than most people realize. I recommend loading your intended data (or your best simulation of it) into a Postgres instance running on one of the extremely large VMs available on your cloud provider, and running a load test with a distribution of the queries you'd expect. Assuming the deliberately over-provisioned instance is able to handle the queries, you can then run some experiments to "right-size" the instance to find the right balance of compute, memory, SSD, etc. If it can handle the queries but not at the QPS you need, then read replicas may also be a good solution.

[1] https://github.com/locationtech/geomesa

alexhutcheson··on On the Decline of Perl – external factors
Mojolicious wasn’t released until 2008, by which point Rails and Django had both been available for >3 years.

Catalyst was released in 2005 (so still after Rails), and definitely didn’t provide Rails-like productivity.

If Mojolicious had been available in ~2003 or earlier, it’s entirely possible Ruby never takes off, because developers could get similar productivity in a more “known”/“mainstream” language.

alexhutcheson··on On the Decline of Perl – external factors
Agreed mod_perl was a bigger problem in the critical time period than Perl 6. Perl 6 just made it so it was less likely anyone would fix the situation.

Catalyst (released 2005), Mojolicious (2008), and Dancer (2009) were all released too late to matter.

alexhutcheson··on On the Decline of Perl – external factors
Rails didn’t really pick up until 2005 either, by which point Perl had already faded considerably.

The most interesting counterfactual is “What if someone had written something like Rails for Perl before 2005?” It was definitely technically possible, and it might have made Perl take back off (Ruby usage grew from basically nothing due to Rails), but the community’s focus on Perl 6 at the time made it much less likely.

← PreviousPage 2 of 29Next →