Cherri compiles simple code into Apple Shortcuts, turning text-based scripts into iOS and macOS automations. Developers write in a Python-like syntax, then transpile it to a .shortcut file—the native format for Apple’s Shortcuts app. This lands on Hacker News with dozens of upvotes and comments debating its niche utility.
Apple Shortcuts powers 500 million iPhones and Macs, handling tasks like fetching weather data, processing texts, or controlling HomeKit devices. It chains over 200 actions visually, but lacks true loops or functions until recent updates. Cherri sidesteps the drag-and-drop editor by generating Shortcut JSON directly from code. You install it via pip install cherri-lang, write a script, and run cherri compile script.cherri to output the file. Import that into Shortcuts, and it runs on-device, Siri-triggered, or scheduled.
How Cherri Works
The language mirrors Python basics: variables, if-statements, for-loops over lists, functions, and async for APIs. It maps to Shortcuts primitives—let x = 42 becomes a “Set Variable” action; for i in range(5) uses “Repeat with Each.” HTTP calls hit fetch("https://api.example.com"), outputting JSON-ready dicts. Errors? It raises exceptions that Shortcuts shows as alerts.
Example from the repo:
async def main():
data = await fetch("https://api.coindesk.com/v1/bpi/currentprice.json")
price = data["bpi"]["USD"]["rate"].replace(",", "")
speak(f"Bitcoin is ${price}")
run(main())
This compiles to ~20 Shortcut actions. Run it via Siri (“Hey Siri, Bitcoin price”), and it speaks the value. No jailbreak needed; Shortcuts handles permissions for network, speech, and more.
Limitations and Realities
Cherri inherits Shortcuts’ cage. Executions cap at five minutes before timeout. No direct file I/O beyond iCloud or photos library. Loops max 1000 iterations to avoid hangs. State persists poorly—variables reset per run. Async shines for APIs but chokes on heavy compute; Shortcuts isn’t a VM.
The compiler, fresh on GitHub with under 100 stars, shows rough edges. Testers on HN report incomplete error handling and missing features like regex or math libs. Shortcuts’ action ecosystem evolves—iOS 18 adds JavaScript—but Cherri lags. Debugging means recompiling and reimporting, tedious versus live REPLs.
Security holds: Shortcuts sandboxes runs, requesting granular perms (e.g., “Allow Contacts?”). Shared shortcuts scan for malice via notarization. No remote code exec; compilation stays local.
Why This Matters
iOS locks down scripting. No bash, no Python interpreter without apps like Pythonista ($10, limited). Cherri delivers free, native code for automations touching 80% of smartphones. Power users script crypto prices, RSS feeds, or NFC triggers—tasks Shortcuts mangles visually.
Implications cut deeper. Distribute logic as codebases, not opaque blocks. Git-track changes, collaborate via PRs. For devs, prototype iOS workflows before SwiftUI apps. Businesses automate employee iPhones without MDM fleets. In crypto, chain price alerts or wallet checks on-device, sidestepping cloud spies.
Skeptical lens: It’s a toy for hobbyists. Shortcuts already Turing-complete-ish; visual beats code for 99% of users. Adoption stalls without IDE or app store integration. Yet, it scratches an itch—code where Apple forbids it. Watch for forks adding Shortcuts 5.0 JS interop or WatchOS support. If it matures, it chips at Apple’s no-script wall, one transpile at a time.
Bottom line: Cherri won’t dethrone Swift, but it arms non-jailbreakers with programmable iOS. Test it; compile time beats block-stacking frustration.

