Urgent.News

What's breaking now, across thousands of outlets.

Tech

Was bash the wrong language for my agent?

I have a small agent that handles one piece of routine work at a time. It looks at what needs doing, picks the thing most worth doing, shows me the plan, and does it if I say yes. Underneath, it is glue: it drives a few command-line tools, calls a model, reshapes a lot of JSON, and prints a readable summary. It was 2150 lines of bash across seven files. It is now Python. So the answer looks like…

The author decided to rewrite their agent from bash to Python, despite initial concerns. The reasoning behind this change was primarily due to a requirement that no build step should be complicated. However, upon further examination, the author realized that the main issue was not performance but expressiveness. They found that 162 calls to jq were used to handle data that should have been easily managed in memory, resulting in 89ms execution time for Python compared to 3ms for bash.

The author also noticed that a significant amount of the code was dedicated to subprocess orchestration, which is where bash excels. The rewrite resulted in a 108-line increase in total line count, but most of these were comments and docstrings, which the author considered valuable. The author also highlighted the benefits of using prompts as separate Markdown files, allowing for easier editing and reading as prose.

In conclusion, the rewrite accomplished nothing in terms of code reduction, but provided better expressiveness and separation of concerns through prompts. The key risk associated with Python is the potential introduction of dependencies, which may undermine the benefits of its simplicity.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Bend

  • Bend is a fast language preventing AI errors through proof-checking
  • Compiles to native code, running near C speed on one core
  • Laws.bend governs AI behavior, ensuring error-free execution

Iran Strikes On Amazon Data Centers Caused Permanent Loss of Customer Data

Ars Technica reports: Half a year after Iranian drone strikes knocked out multiple Amazon data centers, the US tech company has acknowledged the permanent loss of some customer data that was hosted in…

  • Amazon confirms permanent loss of customer data after Iranian strikes
  • mec1-az2 in UAE region had entirely lost customer data
  • AWS suspended billing in Bahrain-based data center regions

Why I Built an Alternative to the Play Store for APK Distribution

Every Android developer I know has run into the same wall: slow app store review cycles, an opaque ranking algorithm deciding who sees your app, and policy changes that can bury a listing overnight…

  • Aeroapk is an alternative app store for APK distribution.
  • Independent listings, no bundled extras, no login barrier.
  • Safety review before live release, developer controls updates.

More from Thursday 17 September →