Remix.run Logo
▲ slowin 2 hours ago

I don't understand why this is written in Typescript. This is a great example of how agents can write code (I'm sure they wrote `cf`), yet having fundamental computer science knowledge is still critical. Do not force your users to manage the dependencies of your cli. Do write your cli in a compiled language. Understand the reason for those decisions and tell your agents to use the correct architecture.

▲geodel 17 minutes ago | parent | next [-]

No it is exactly right mode for modern tech companies:

1) If it runs on my dime and my infrastructure I will optimize the hell out using most cleverly written Rust and what not and gloat about engineering prowess.

2) If it runs on users computers well then, we have carefully evaluated our strategic direction and come to conclusion that JS/TS/Electron option is the best way to go.

▲cschmatzler 7 minutes ago | parent [-]

This is also not correct in this case since they recently rewrote the Artifacts backend from Zig to TypeScript.

▲tcdent an hour ago | parent | prev | next [-]

My read is that it's generally the teams that have been assigned to build a certain product that end up choosing the architecture that it runs on. So when we see TypeScript involved in TUI and CLI applications, most of it is just a repurposing of skill sets from that domain into the terminal. In an organization like Cloudflare, I expect that the developers who don't specialize in TypeScript are working on far more important problems.

▲kelchm 2 hours ago | parent | prev | next [-]

Are you really suggesting that the choice to use Typescript wasn't a deliberate one?

IMO -- it makes total sense within the existing Cloudflare tooling ecosystem.

▲slowin an hour ago | parent | next [-]

Whether it was deliberate or not, I do not think it's a good choice. When agents can write in any language, there's no reason to pick the wrong tool for the job. At this point Javascript/Typescript belongs only in the browser. It's the suboptimal choice for every other environment. Especially for a command line tool. Even if the back-end is written in Typescript (also not the best choice imho), the clients need not be in the same language.

▲chatmasta an hour ago | parent [-]

Typescript and the npm/JS ecosystem may be complex, but you don’t need AGI to figure out how to install a CLI built with TS. My agent can figure out how to install this.

▲slowin an hour ago | parent [-]

It's not just the complexity. You're also vulnerable to supply chain attacks via NPM. It's also performance as you don't need the entire javascript runtime just for a CLI.

▲xtajv 32 minutes ago | parent | prev [-]

Code should be written for the user.

▲squiffsquiff an hour ago | parent | prev | next [-]

AWS and GCP CLIs have been in Python for a decade or more. Last I checked Python was not a compiled language

▲xtajv 31 minutes ago | parent | next [-]

Raise your hand if you have been personally traumatized by the miniature standalone py3 distribution bundled within the aws cli.

▲slowin 16 minutes ago | parent | prev | next [-]

I think these are both examples that help prove my point. Neither of these tools benefit the user by being in Python and distributing a runtime just for a CLI tool.

▲mjr00 12 minutes ago | parent | prev [-]

Yeah, and they're terrible. If anything they're a prime example of what 100% should be written in a compiled language.

▲perching_aix an hour ago | parent | prev [-]

"Claude, rewrite this in amd64 and arm64 assembly. Optimize it to the max, and make no mistakes. Oh yeah, formally verify it while there, may as well."