16 ms·
Ugh, I really wish this had been written in Go or Rust. Just something that produces a single binary executable and doesn't require you to install a runtime lik
by ZeroCool2u 1y ago
Ugh, I really wish this had been written in Go or Rust. Just something that produces a single binary executable and doesn't require you to install a runtime like Node.
- geodel 1y agoMy thoughts exactly. Neither Rust not Go, not even C/C++ which I could accept if there were some native OS dependencies. Maybe this is a hint on who could be its main audience.
- iainmerrick 1y agoLooks like you could make a standalone executable with Bun and/or Deno: https://bun.sh/docs/bundler/executables https://bun.sh/docs/bundler/executables https://docs.deno.com/runtime/reference/cli/compile/ https://docs.deno.com/runtime/reference/cli/compile/ Note, I haven't checked that this actually works, although if it's straightforward Node code without any weird extensions it should work in Bun at least. I'd be curious to see how the exe size compares to Go and Rust!
- ZeroCool2u 1y agoYeah, this just seems like a pain in the ass that could've been easily avoided.
- iainmerrick 1y agoFrom my perspective, I'm totally happy to use pnpm to install and manage this. Even if it were a native tool, NPM might be a decent distribution mechanism (see e.g. esbuild). Obviously everybody's requirements differ, but Node seems like a pretty reasonable platform for this.
- danielbln 1y agoAlso throwing Volta (written in Rust, because of course it is) into the ring. It's the uv of the Node world.
- jstummbillig 1y agoIt feels like you are creating a considerable fraction of the pain by taking offense with simply using npm.
- evilduck 1y agoAs a longtime user of NPM but overall fan of JS and TS and even its runtimes, NPM is a dumpster fire and forcing end users to use it is brittle, lazy, and hostile. A small set of dependencies will easily result in thousands (if not tens of thousands) of transitive dependency files being installed. If you have to run end point protection that will blast your CPU with load and it makes moving or even deleting that folder needlessly slow. It also makes the hosting burden of NPM (nusers) who must all install dependencies instead of (nCI instances), which isn't very nice to our hosts. Dealing with that once during your build phase and then packaging that mess up is the nicer way to go about distributing things depending on NPM to end users.
- frollogaston 1y agoI ran the npm install command in their readme, it took a few seconds, then it worked. Subsequent runs don't have to redownload stuff. It's 127MB, which is big for an executable but not a real problem. Where is the painful part?
- JimDabell 1y agoI was going to say the same thing, but they couldn’t resist turning the project into a mess of build scripts that hop around all over the place manually executing node.
- iainmerrick 1y agoOh, man! I guess it needs to start various processes for the MCP servers and whatnot? Just spawning another Node is the easy way to do that, but a bit annoying, yeah.
- buildfocus 1y agoYou can also do this natively with Node, since v18: https://nodejs.org/api/single-executable-applications.html#single-executable-applications https://nodejs.org/api/single-executable-applications.html#s...
- tln 1y agoA Bun "hello world" is 58Mb Claude also requires npm, FWIW.
- sitkack 1y agoThat is point not a line. An extra 2MB of source is probably a 60MB executable, as you are measuring the runtime size. Two "hello worlds" are 116MB? Who measures executables in Megabits?
- iainmerrick 1y agoWhat's a typical Go static binary size these days? Googling around, I'm seeing wildly different answers -- I think a lot of them are outdated.
- MobiusHorizons 1y agoIt depends a lot on what the executable does. I don’t know the hello world size, but anecdotally I remember seeing several go binaries in the single digit megabyte range. I know the code size is somewhat larger than one might expect because go keeps some type info around for reflection whether you use it or not.
- iainmerrick 1y agoAh, good point. I was just wondering about the fixed overhead of the runtime system -- mainly the garbage collector, I assume.
- frollogaston 1y agoThe Golang runtime is big enough by itself that it makes a real difference from some WASM applications, and people are using Rust instead purely because of that.
- quotemstr 1y ago> A Bun "hello world" is 58Mb I've forgotten how to count that low.
- fhinkel 1y agoAsk Gemini CLI to re-write itself in your preferred language
- ZeroCool2u 1y agoUnironically, not a bad idea.
- shitpostbot 1y agoLet's not pretend this stuff actually works
- leoh 1y agoNot sure why this was flagged, because I think the point is that one-shot works terribly, which it does
- AJ007 1y agoContest between Claude Code and Gemini CLI, who rewrites it faster/cheaper/better?
- frollogaston 1y agoI have already been asking the Gemini CLI questions about itself.
- qsort 1y agoProjects like this have to update frequently, having a mechanism like npm or pip or whatever to automatically handle that is probably easier. It's not like the program is doing heavy lifting anyway, unless you're committing outright programming felonies there shouldn't be any issues on modern hardware. It's the only argument I can think of, something like Go would be goated for this use case in principle.
- ZeroCool2u 1y agoI feel like Cargo or Go Modules can absolutely do the same thing as the mess of build scripts they have in this repo perfectly well and arguably better.
- koakuma-chan 1y agoIf you use Node.js your program is automatically too slow for a CLI, no matter what it actually does.
- frollogaston 1y agoSo are you saying the Gemini CLI is too slow, and Rust would remedy that?
- koakuma-chan 1y agoYes
- wiseowise 1y agoIf you even sneeze into performance discussion without providing benchmarks first – you’re a tool.
- koakuma-chan 1y agoYou don't have to believe me if you don't want to. But I strongly advise everyone who still uses prettier to try a formatter written in Rust, for example dprint. It's a world of difference.
- i_love_retros 1y agoThis isn't about quality products, it's about being able to say you have a CLI tool because the other ai companies have one
- clbrmbr 1y agoFast following is a reasonable strategy. Anthropic provided the existence proof. It’s an immensely useful form factor for AI.
- closewith 1y agoYeah, it would be absurd to avoid a course of action proven productive by a competitor.
- mike_hearn 1y agoThe question is whether what makes it useful is actually being in the terminal (limited, glitchy, awkward interaction) or whether it's being able to run next to files on a remote system. I suspect the latter.
- behnamoh 1y ago> This isn't about quality products, it's about being able to say you have a CLI tool because the other ai companies have one Anthropic's Claude Code is also installed using npm/npx.
- rs186 1y agoEh, I can't see how your comment is relevant ti the parent thread. Creating a CLI in Go is barely more complicated than JS. Rust, probably, but people aren't asking for that.
- frollogaston 1y agoThey wrote the CLI "GUI" in React using ink, which is all JS-only. I don't know what the Golang way of doing this would be, but maybe it's harder if you want the same result.
- buildfocus 1y agoNode can also produce a single binary executable: https://nodejs.org/api/single-executable-applications.html https://nodejs.org/api/single-executable-applications.html
- ur-whale 1y ago> and doesn't require you to install a runtime like Node. My exact same reaction when I read the install notes. Even python would have been better. Having to install that Javascript cancer on my laptop just to be able to try this, is a huge no.
- jart 1y agoSee gemmafile which gives you an airgapped version of gemini (which google calls gemma) that runs locally in a single file without any dependencies. https://huggingface.co/jartine/gemma-2-27b-it-llamafile https://huggingface.co/jartine/gemma-2-27b-it-llamafile
- quotemstr 1y agoLanguage choice is orthogonal to distribution strategy. You can make single-file builds of JavaScript (or Python or anything) programs! It's just a matter of packaging, and there are packaging solutions for both Bun and Node. Don't blame the technology for people choosing not to use it.
- frollogaston 1y agoWhy would you want a single-file build anyway, to make it easier to move around on disk? There are reasons for the dep filetree. Btw, the largest deps in this are React and Open Telemetry.
- corysama 1y agoMeanwhile, https://analyticsindiamag.com/global-tech/openai-is-ditching-typescript-to-rebuild-codex-cli-with-rust/ https://analyticsindiamag.com/global-tech/openai-is-ditching... I really don't mind either way. My extremely limited experience with Node indicates they have installation, packaging and isolation polished very well.
- frollogaston 1y agoNode and Rust both did packaging well, I think Golang too. It's a disaster in Python.
- 8n4vidtmkvmk 1y agoBun can compile to a single executable. Not sure if node has the same feature. Point is it's very doable with JS.
- truth_seeker 1y agoYou mean something like this: https://www.npmjs.com/package/pkg https://www.npmjs.com/package/pkg or perhaps this one: https://www.npmjs.com/package/nexe https://www.npmjs.com/package/nexe