HNHacker News
TopNewBestAskShowJobs

mleonhard

4,067 karma · joined February 26, 2008

Michael Leonhard. San Francisco. Software engineer and entrepreneur. Interested in many things.

michael206@gmail.com

http://www.tamale.net/

submissionscomments
mleonhard··on Sol-Ark manufacturer reportedly disables all Deye inverters in the US
USA is a free market. Everyone is authorized all the time to sell every safe product. The terms "gray market" and "authorized reseller" are linguistic manipulations which benefit manufacturers at the expense of everyone else in society.

I think Daye broke US law when they destroyed law-fully purchased products inside USA. I hope the inverter owners bring a class-action lawsuit against Daye in the US. The court could block the sale of the company's products in USA until they restore the inverters and pay restitution.

mleonhard··on Mind-Bending Soviet Era Oil Rig City on the Caspian Sea
Here's another article about Neft Daşları with more photos: https://web.archive.org/web/20240225112359/https://guerrilla...

Bing Maps shows the bridges and some platforms with good resolution: https://www.bing.com/maps?cp=40.061519%7E49.607735&lvl=12.0&...

Yandex Maps shows the constellation of isolated platforms to the south-east: https://yandex.com/maps/?l=sat%2Cskl&ll=49.630795%2C40.03939...

mleonhard··on We're Leaving Kubernetes
Why don't they describe their new system? I feel disappointed. :(
mleonhard··on Ask HN: What breakthrough helped you build and maintain better relationships?
Friendships can form when people have repeated un-planned meetings. Put yourself into such situations regularly: work at a co-working space, keep a consistent gym schedule, regularly attend several meetups, regularly attend a volunteering group, visit a coffee shop on a schedule, take public transit at the same time each day, etc. Don't let your headphones prevent random conversations with strangers.

The biggest cause of loneliness today is loss of the third-place [0] in modern communities. Suburbia is soulless and isolating because there are few third places where people can socialize and meet others.

[0] https://en.wikipedia.org/wiki/Third_place

mleonhard··on Charging lithium-ion batteries at high currents first increases lifespan by 50%
Since a good SEI layer on the electrode is important, couldn't they put the layer on the electrode before assembling the battery? Then they could make the layer's shape more even.
mleonhard··on Google creates self-replicating life from digital 'primordial soup'
This has some similarities to the "Bluedogs" artificial life simulation that I made during university: https://www.tamale.net/bluedogs/ . In Bluedogs, each entity has bytecode which determines its behavior. The simulation churns out random entities which don't know how to move. Finally, it generates one that can turn and its progeny quickly fill the virtual world. Bluedogs also uses color to show geneology.
mleonhard··on Jiff: Datetime library for Rust
Thanks for making this library, BurntSushi.

    impl Decimal {
      ...
      /// Returns the ASCII representation of this decimal as a string slice.
      pub(crate) fn as_str(&self) -> &str {
        // SAFETY: This is safe because all bytes written to `self.buf` are
        // guaranteed to be ASCII (including in its initial state), and thus,
        // any subsequence is guaranteed to be valid UTF-8.
        unsafe { core::str::from_utf8_unchecked(self.as_bytes()) }
      }
    }
https://github.com/BurntSushi/jiff/blob/08dfdde204c739e38147...

How much performance does `from_utf8_unchecked` buy us over `from_utf8`? It's saving iterating over a 20-byte array. Because the array fits in a single cache line, the iteration will run at the CPU's internal clock rate. I expect that a benchmark would not be able to detect the CPU time saved. Even a program that was only serializing these Decimal types at GB/s, the difference would be barely measurable.

As software engineers, about 80% of our time is spent coding. And about 80% of coding time is spent learning how the thing works. If we prioritize code clarity, we speed up 64% of our future work.

Performance optimizations always make code less clear. Using `from_utf8_unchecked` is a performance optimization. It makes the code less clear so it needs a three-line comment.

Engineering is all about trade-offs. Performance optimizations can be worth their clarity cost when they bring tangible benefits. Therefore, we need to measure. The comment doesn't say "Using `from_utf8_unchecked` because it takes 1ns while `from_utf8` takes 5ns." To make sure we're making a good tradeoff between clarity and performance, we need to measure the impact of the optimization and document it in the code.

Using `unsafe` also has a cost. Safety depends on invariants. Future changes to the code can break these invariants. The compiler is the most reliable method for detecting invariant-breakage. Let's take advantage of it. This means using `unsafe` only when its use brings tangible benefits that outweigh the risks.

I started my professional life as a Windows sysadmin. Dealing with worms and viruses was a large and unpleasant part of my job. During university, I learned about formal verification of software. It has great potential for making our software secure. Unfortunately, the tools are very hard to use. To verify a program, one must translate it into the language of the verification tool. This is a lot of effort so few projects do it. Now with Rust, we get verification FOR FREE! It's amazing!!!! So let's use it and move our industry forward. Let's make worms, viruses, ransomware, and data theft, into things from the barbaric early days.

mleonhard··on I don't want to spend my one precious life dealing with Google's AI search
Thanks for making Kagi. I'm a satisfied paying customer and daily user.
mleonhard··on Pyinfra: Automate Infrastructure Using Python
Very cool. One question: Can Pyinfra create container-like objects and objects inside them? Example: create an RDS database, create a user inside that database, and assign the user a role.

Terraform cannot deploy such a configuration in a single config, since its planning stage requires that all containers already exist. Terraform crashes when planning the user and role changes, saying that the database doesn't exist. This is a large pain-point when using Terraform. How does Pyinfra handle such deployments?

mleonhard··on Data breach at Kaiser Permanente affects 13.4M people
I reported this to Kaiser on 2021-11-22, in support case number 53710772. Below is the content of the ticket I filed. I didn't follow-through on disclosure. Now I wish I had, since they could have fixed this problem faster instead of taking 2.5 years.

I am still a satisfied Kaiser customer.

----

Hi KP.org Team,

Just now, I logged into KP.org. Something was loading slowly, so I viewed the network requests the website was making. I was surprised to see requests to Google, Adobe, Bing, Qualtrics, BTTag.com, and Unpkg.com. A request to Google includes info intended to de-anonymize my computer: time, IP addr, device type, display size, browser window size, timezone, and others. These requests occur even while reading messages with my doctor!

The page loads JavaScript from Adobe, Bing, Google, and Qualtrics. People who control those companies' servers can read my confidential messages. Adobe has a track record of incompetence in IT security.

Please review your decision to make KP.org load external code and trackers. If you do not respond by 2022-01-14 (90 days), I will disclose this information to privacy-oriented media organizations and HHS.gov. I saved screenshots for this purpose.

Sincerely, Michael

mleonhard··on Major data center power failure (again): Cloudflare Code Orange tested
The blog post contain no details at all about how they achieved high availability. I'm disappointed.
mleonhard··on Google Public DNS's approach to fight against cache poisoning attacks
I updated https://crates.io/crates/dns-server to support case randomization.
mleonhard··on 'Lavender': The AI machine directing Israel's bombing in Gaza
In 2018, Google CEO Sundar Pichai, SVP Diane Greene, SVP Urs Hölzle, and top engineer Jeff Dean built a system like Lavender for the US military (Project Maven). The US military planned to use it to analyze mass-surveillance drone footage to pick suspects in Pakistan for assassination. They had already dropped bombs on hundreds of houses and vehicles, murdering thousands of suspects and their families and friends [0].

I was working in Urs's Google Technical Infrastructure division. I read about the project in the news. Urs had a meeting about it where he lied to us, saying the contract was only $9M. It had already been expanded to $18M and was on track for $270M. He and Jeff Dean tried to downplay the impact of their work. Jeff Dean blinked constantly (lying?) while downplaying the impact. He suddenly stopped blinking when he began to talk about the technical aspects. I instantly lost all respect for him and the company's leadership.

Strong abilities in engineering and business often do not come with well-developed morals. Sadly, our society is not structured to ensure that leaders have necessary moral education, or remove them when they fail so completely at moral decisions.

[0] https://en.wikipedia.org/wiki/Drone_strikes_in_Pakistan

mleonhard··on Digital forgeries are hard
I worked on a public timestamping service: https://github.com/mleonhard/tokimark/
mleonhard··on Features lost across versions of macOS
Which version of macOS are you using?

I'm using macOS Ventura 13.6.3 on a 2018 Macbook Pro and there is no "Text" section under "Settings > Accessibility > Display".

mleonhard··on A formula for responsive font-size
No! If you mess with the font size, you make your page hard to read for people who adjust their font size in their browser. They set their font size very carefully, to the smallest size they can comfortably read. Your site had better not change that.

Medium.com is the worst offender. Their font size is small and they disable zooming on mobile!

mleonhard··on Features lost across versions of macOS
Apple's PMs removed a feature that was very useful on my MBP: system font size adjustment. Now I must wear my glasses all the time I use the computer. This is not comfortable or fun. I could increase the display pixel size, but then everything looks like garbage when I do wear my glasses.

Apple has lost its user-focus. Its products will only get worse and worse. Fortunately, this creates opportunity for new companies.

mleonhard··on Training LLMs from ground zero as a startup
> I think this could be more about the competency of the hardware team that manages your accelerators rather than the underlying chip.

Google's systems are reliable because of the tens of billions of dollars that Google has invested into developing datacenter hardware, software, and processes over 25 years. Highly-competent teams at smaller and less-mature organizations will always deliver a much worse product.

Another thing to consider is priorities. Google prioritizes reliability. They retire parts that fail repeatedly, even if the failures are relatively infrequent. Smaller and less-sophisticated datacenters keep parts in service even with frequent failures, or don't even monitor failure rates of certain parts. Smaller datacenters buy and use Google's old parts and unreliable parts.

Therefore unreliable machines does not imply anything about the competency of the hardware team.

If the low reliability of the hardware is making your work slow, then how about improving the software so it can tolerate the unreliable hardware, or switching to a more reliable (more expensive) hardware provider?

mleonhard··on Launch HN: Circleback (YC W24) – Tooling to make meetings more efficient
> which took me a day to slap together and is close to free

An engineer who can slap together a good meeting transcriber in a day is probably paid $2,000 a day or more. The opportunity cost of having them work on a random project is far more than the cost of their salary. The ongoing maintenance cost of the custom meeting transcriber is probably 5-10 engineer days over its lifetime. The added utility from slightly-better meeting transcripts does not compensate for the staggering engineering cost of the custom solution.

Circleback and other meeting transcribers will surely get better and surpass the quality of the custom transcriber. Then the team must spend more time switching to Circleback and deleting the custom transcriber.

mleonhard··on Show HN: TinyWasm – A tiny WebAssembly Runtime written in Rust
Thanks for sharing your project! How does performance change when the `unsafe` feature is disabled?

It looks like there is only one usage of `unsafe` outside of the no_std build: https://github.com/explodingcamera/tinywasm/blob/c50bae752f3...

mleonhard··on Old vs. new growth trees and the wood products they make
I live in a building in San Francisco that was built 10 years ago. It has metal windows and frames.
mleonhard··on FastUI: Build Better UIs Faster
> When you run flet build <target_platform> command it ... Packages Python app using package command of serious_python package. -- https://flet.dev/docs/guides/python/packaging-app-for-distri...

It looks like Flet is for client-side code. It lets you write Flutter apps with Python instead of Dart.

> Simple Architecture - No more complex architecture with JavaScript frontend, REST API backend, database, cache, etc. With Flet you just write a monolith stateful app in Python only and get multi-user, realtime Single-Page Application (SPA). -- https://flet.dev

If I'm writing Python that runs on the mobile device, it must talk to a server to read & write data. Doesn't this still require an API backend, database, cache, etc?

mleonhard··on FastUI: Build Better UIs Faster
Most of the cost of a software project is from ongoing maintenance. When we make it easy to write the first version and make maintenance harder, the total cost of the project goes up.

Projects like FastUI allow maintenance of a project with fewer skills, directly reducing the cost of maintenance: owning teams spend less time learning and maintaining their skills and there are fewer bugs due to engineers making mistakes because of low skill-level in a technology.

Also, projects like FastUI make the project's tech stack much simpler. Simplicity helps reliability, incident resolution, security, testing, adding features, removing dead code, refactoring, etc. Highly-productive teams apply these ideas and keep their systems as simple as possible. As tools like FastUI mature, they will become standard in healthy engineering orgs.

mleonhard··on FastUI: Build Better UIs Faster
> Beyond Python and React ... Implementing frontends for other platforms like mobile ...

I'm building something like this for mobile: https://www.applin.dev

mleonhard··on Ask HN: Who wants to be hired? (March 2024)
Location: San Francisco, CA

Remote: Yes

Willing to relocate: No

Technologies: Rust (my crates have 4M downloads https://crates.io/users/mleonhard ), Go, C++, Python, Swift, Java, Ruby, Dart, iOS, Flutter, HTML, CSS, Rails, Tomcat, Netty, Postgres, DynamoDB, AWS, Terraform, Snowflake, Looker, Redis, Kafka, Docker, Github CI/CD, git, Perforce, DNS, TCP/IP, UDP, HTTP, Linux, OpenBSD, Datadog, InfluxDB, and Algolia.

Experienced generalist software and devops engineer, 10+ years. Reliable-software enthusiast. Tech debt refinancer. Interested in everything. Idea generator. Ex-Google, Ex-Amazon, Ex-Flexport, 2 X failed Entrepreneur. Latest project: https://applin.dev/ .

Hire me and I will diligently build & fix your systems and teach your junior engineers.

Résumé/CV: https://www.tamale.net/michael-leonhard-resume.pdf

Email: michael206@gmail.com

mleonhard··on Show HN: Pgs.sh – A zero-install static site hosting service for hackers
I'm interested in using pgs.sh or prose.sh to host a service status page. What datacenters do you use?
mleonhard··on In Defense of Simple Architectures (2022)
> We’re currently using boring, synchronous, Python, ... We previously tried Eventlet, an async framework ..., but ran into so many bugs ...

I had a similar experience using async Rust to make a boring HTTP server. Debuggers can't trace across `await`, so debugging was a very slow manual process. Also, I wasted a lot of time dealing with borrow-checker errors.

I finally gave up and tried using Rust HTTP servers that let you write threaded request handlers, but there was only one (Rouille) and it had show-stopping problems. So I wrote a good one:

https://crates.io/crates/servlin

You can use Servlin to make a boring HTTP server in Rust, with threaded request handlers (no async). I use Servlin to serve https://www.applin.dev , running on Render. I'm also using Servlin (and Applin) to build a mobile app.

mleonhard··on Jeff Lawson steps down as CEO of Twilio
Here's a good recording of a very smooth Twilio demo at "Yahoo! Hack Europe: London" in 2013 by Michael Wawra:

https://www.youtube.com/watch?v=mPAe0rJApvk

mleonhard··on A concrete example of what goes wrong with Apple's docs
I'm dealing with this daily as I build Applin.

Example from Friday: I spend about an hour figuring out why my iOS app was not showing an error response when the server refused an upload. The iOS standard library URLRequest class was not sending the "Expect:100-Continue" HTTP header. I found nothing about this in the docs. I found the answer on Stack Overflow: add the header to the request and the class will automatically use it and wait for the "100 Continue" response before sending the body.

Last week, I spent multiple hours getting UIPickerView to work. The docs omit critical info like how to update the widget. Also, the API design is confusing: one must implement UIPickerViewDataSource but that isn't actually used as the source of the data, only the count of components. To make the picker work, one has to implement UIPickerViewDelegate which provides the actual data. It's a very confusing widget.

Earlier in this project, I wasted multiple weeks struggling, unsuccessfully, to get UITableView and UIStackView to work for my use-case. This took so long because the docs are missing lots of important info.

Shameless plug: Backend engineers can use Applin to build iOS apps, without writing any frontend code and without struggling to understand Apple's poorly-documented buggy APIs. https://www.applin.dev

mleonhard··on Czech news crew in SF covering APEC robbed at gunpoint while filming
This is correct. San Francisco, and the whole SF Bay Area, has a staggering housing shortage. People earning minimum wage cannot afford housing and must move to cheaper areas and lose their community relationships. So more of them turn to crime.

Here's a video on the topic: https://www.ted.com/talks/richard_wilkinson_how_economic_ine...

← PreviousPage 3 of 34Next →