Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is this sarcasm? We’re talking about a CLI. The fancy JIT system will collect data from one single operation and then promptly forget everything it learned and discard all those shiny optimized instruction sequences before the next operation.

For example are workloads for which Java performs very, very well. CLI tools that do one operation and return are not examples of these workloads. v8 is plausibly less bad because v8 is also optimized for short-running scripts, but that just means less outrageously slow, not that it will be remotely competitive with native code.

 help



I was pointing out a minor consideration for Rust on server vs TS on local in general, not current `cf` specifically.

> Is this sarcasm? We’re talking about a CLI.

This is precisely why this blend of comments is insane.

All the CLI does is take command line arguments, put together requests based on them, send them to an API, get the responses, do mild transformation on the responses,and output it to stdout/stderr.

Pretty much any choice of tech stack will work well. This is not rocket science. It's pointless to talk about optimized solutions. It's a complete waste of time.


> Pretty much any choice of tech stack will work well.

Choice of tech stack is not merely a question of performance, but also portability and packaging. Self-contained, compiled static binaries are much, much more portable than shipping full script runtimes (JS/Python), dealing with the inevitable spread of runtime versions installed on everyone's machines, and dealing with the version spread of the dependencies installed separately.

> All the CLI does is take command line arguments, put together requests based on them, send them to an API, get the responses, do mild transformation on the responses,and output it to stdout/stderr.

This is an argument in favor of a language like Go, arguing that the garbage collector in the runtime is inconsequential, over a language like Rust. It is not an argument for shipping a script runtime.


> Choice of tech stack is not merely a question of performance, but also portability and packaging.

Yes, and clearly typescript is an established tech.

Just look at Cloudflare's wrangler cli.

Everything else is nonsense.

> This is an argument in favor of a language like Go (...)

Not really, in the sense that a myriad of alternatives would also meet the same bar,thus its stupid to frame it as "language X can do this, so language X should do it".

The bar is higher than that.

Typescript works well. Cloudflare already has a lot of experience using typescript to develop cli apps that hit their APIs.

Everyone just call down with the bike shedding. You're wasting everyone's time.


> wrangler

Is actually a really good example of why TS was a bad choice for Cloudflare. It made sense for their initial version, because the only programs that you could run on Cloudflare Workers were themselves JavaScript scripts, so it was a reasonable expectation that developers were already using npm/yarn/pnpm to install tools and manage dependencies.

But now, Cloudflare Workers supports containerized workloads and Python workloads. So even if your project doesn't use TS, you are still expected to set up some kind of JS toolchain for your project, just for wrangler.


> Pretty much any choice of tech stack will work well.

No, it won't.

I just tested gcloud (brand new install, modern "cli" version, not the old "sdk" version, although the "sdk" version was every bit as bad).

With a warm cache:

    $ time gcloud &>/dev/null
    
    real 0m1.215s
    user 0m0.954s
    sys 0m0.243s
It doesn't get faster if I give it a valid action instead of just getting the overview help screen. This is so slow that a remote LLM can get bored!

A CLI should be snappy. A CLI targeted at agents should be even snappier. We're note talking about massive throughput here -- we're talking about the latency added to a tool call for the mere fact that the tool call invokes the CLI. Google should be targeting two orders of magnitude of improvement here


> I just tested gcloud (...)

That's fine if all you want to do is put together a nonsensical apples to oranges comparison.

If you actually want to take a look at what kind of cli app Cloudflare can put together, you'd look at the likes of wrangler.

I mean, I'm sure it takes a couple of minutes to find a notable cli app written in your language of choice with is riddled with problems. Don't you agree? Would that serve as proof your language of choice is bad?

Having said that, you should take a look at what kinds of tests you are doing and what kind of values you're seeing. Any http request is expected to take ~200ms to execute, and any app that does any kind of auth verification will do a pair of those at app start. This is before the app does anything useful. Therefore this means you are trying to nitpick over milliseconds in domains where latency alone will be an order of magnitude or two greater than the values you are holding onto as meaningful.

Why do you think the likes of nodejs dominates backend development? It's surely not because of isomorphic JavaScript, it's something else.


When you have buggy software like Claude Code where they literally had to buy the company that made the software and then machine translate it to Rust just to make it fast enough, it's not "a complete waste of time." Somehow people can turn even CLIs into unoptimized garbage.

I don’t agree with that at all, there is a high startup cost to languages like Java and to a lesser extent, JS. Java won’t do anything at all for about 60ms last I measured. This is noticeable to users. JS does better which is why you still see some JS based CLIs. But languages like Go and Rust really are much better for this, they don’t require a huge VM installed on your system and start up instantly. I can also recommend Common Lisp as it has an insanely low startup latency. Ship a single file binary without dependencies please.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: