A Java Geek weekly 158

Making illegal state unrepresentable. Zero-code trace-log correlation with OBI. Gleam doesn’t compile to Erlang source anymore. PhotoCraft. Ahnentafel. Python 3.15.0. Anti-Patterns in Software Blogging. Github Migrates Copilot Runtime to Rust with AI-Assisted Rewrite. Java garbage collection in its own log: eight checks you can run. Harness engineering for coding agent users. Eye of Sauron: Long-Range Hidden Spy Camera Detection and Positioning with Inbuilt Memory EM Radiation.

Making illegal state unrepresentable

A couple of years ago, I wrote that The Builder pattern is a finite state machine!. A state machine consists of states and transitions between them. As a developer, I want to make illegal states unrepresentable, i.e., users of my API can’t create non-existent transitions. My hypothesis is that only a static typing system allows this at compile-time. Dynamic typing systems rely on runtime validation.

In this blog post, I will show that it holds true, with a caveat. If your model has many combinations, you also need generics and other niceties to avoid too much boilerplate code. My exploration will use Python, Java, Kotlin, Rust, and Gleam. With that background in mind, let’s move on to the model itself.

Zero-code trace-log correlation with OBI

It works with zero code!

Here it is end to end, on a small demo: an uninstrumented Go frontend that calls an uninstrumented Go backend, each logging one JSON line per request, plus OBI and Jaeger — four containers total. No OpenTelemetry SDK anywhere in the application code.

A single request to the frontend produces one distributed trace in Jaeger — OBI also propagates the trace context between the two services, so the frontend and backend spans join under one trace:

jaeger trace
Gleam doesn’t compile to Erlang source anymore
  1. I didn’t know Gleam compiled to Erlang
  2. Gleam doesn’t compile to BEAM bytecode, and probably never will
  3. Gleam compiles now to Erlang abstract forms
PhotoCraft

The image editor you already know how to use.

Layers, masks, adjustment layers, layer styles, type, vectors and brushes in a native app written entirely in Rust. Open source, offline, and yours.

Someone vibe-coded a feature-complete, free, and Open Source exact clone of Photoshop. We are living in amazing times.

Ahnentafel

An ahnentafel (German for "ancestor table") is a genealogical numbering system for listing a person’s direct ancestors in a fixed sequence of ascent.

I came upon this while checking the Sosa numbering system.

Python 3.15.0
  • Interpreter improvements
    • PEP 661: Add sentinel built-in type
    • PEP 686: Python now uses UTF-8 as the default encoding
    • PEP 798: Unpacking in comprehensions
    • PEP 810: Explicit lazy imports for faster startup times
    • PEP 814: Add frozendict built-in type
    • PEP 829: Package startup configuration files
    • The experimental JIT compiler has been significantly upgraded, with 7-8% geometric mean performance improvement on x86-64 Linux over the standard interpreter, and 11-12% speedup on AArch64 macOS over the tail-calling interpreter
    • Improved error messages
  • Significant improvements in the standard library
    • PEP 799: A dedicated profiling package for organizing Python profiling tools
    • PEP 799: Tachyon: High frequency statistical sampling profiler
    • More color
  • New typing features
    • PEP 728: TypedDict with typed extra items
    • PEP 747: Annotating type forms with TypeForm
    • PEP 800: Disjoint bases in the type system
  • C API improvements
    • PEP 782: A new PyBytesWriter C API to create a Python bytes object
    • PEP 788: Protection against finalization in the C API
    • PEP 803, 820, 793: Stable ABI for free-threaded builds and related C API
  • Build changes
    • PEP 831: Frame pointers are enabled by default for improved system-level observability
Anti-Patterns in Software Blogging
  • Give the reader a compelling reason to continue reading. Get to it within the title and the first three sentences of your blog post.
    • Common reasons: they want to hear an entertaining story, learn a useful technique, or understand a concept that’s relevant to them.
  • Question your assumptions about what the reader knows and does not know.
    • Think about what concepts and terms you expect the reader to recognize and re-read your article to make sure it matches those expectations.
  • The reader should be able to read your article from start to finish without clicking links or hovering for tooltips.
    • Links should allow the reader to explore topics more deeply, but they should be a bonus rather than a pre-requisite.
  • Avoid presenting your article as a follow-up to a previous article.
    • Assume most readers haven’t read your previous articles. Summarize what’s relevant for them to know rather than expecting the reader to go read all your prior posts.
  • Drop the formality. Write the way you speak in real life.
  • Test your articles in your browser’s mobile view.
    • Make sure that your text doesn’t overflow the screen and force the reader to scroll horizontally as they read.
  • Use browser testing tools to find low-contrast text that makes your article difficult to read.
Github Migrates Copilot Runtime to Rust with AI-Assisted Rewrite

GitHub has migrated the runtime behind GitHub Copilot CLI, the Copilot app, and Copilot SDK from TypeScript and Node.js to Rust, replacing more than 800,000 lines of production code through an AI-assisted rewrite. The migration took approximately 14.5 weeks and was delivered through 128 pull requests while GitHub continued releasing the runtime. GitHub reports that a measured client startup, session creation, and single-turn scenario fell from 5.25 seconds with the previous runtime to 292 milliseconds when the Rust runtime was embedded in process.

Java garbage collection in its own log: eight checks you can run
Harness engineering for coding agent users
harness change lifecycle examples
Eye of Sauron: Long-Range Hidden Spy Camera Detection and Positioning with Inbuilt Memory EM Radiation
Could this be the end of software subscriptions?

When I was growing up, you bought Microsoft Word or Microsoft Excel once. Then in 2011 they started to make it so that you had to pay monthly for the product.

It has annoyed me ever since that you have to pay ongoing for a product and the premium that you have had to pay to do that. I have spent thousands of dollars on these tools and they haven’t really evolved at all.

Likewise, I feel we customers were cheated by the subscription model. I welcome this new era.