Comment by guessmyname

2 months ago

Pi is good in concept, but why couldn’t they choose a compiled language instead of TypeScript?

I imagine because they want to support plugins, and plugins in compiled language are a lot less natural than plugins in languages like TypeScript or Python.

since pi is built to modify itself, isn't it better to use a language like typescript where LLMs have a LOT of training data?

a harness doesn't do any computations by itself so what benefit is using a compiled language?

  • i find LLMs generally play better with compiled languages actually, they do great with rust. you can think of it almost as analogous to a harness.

    • The more structure the better. Provides strong guardrails.

      I’ve had great experience with Elixir and the new compiler combined with Ash.

    • They play better with statically typed languages, not compiled ones in particular. Rust's typing is stricter than Typescript though so that probably helps.

For TUIs, Rust/Go vs Typescript doesn't really makes a huge performance difference and you lose the 50x bigger community advantage of Typescript.

  • It makes a huge memory difference.

    • Not really because you're not building a database or GUI app where using native elements & data structures help a lot with memory pressure.

      TUI renderer is the one using the memory heavily so your terminal takes the heavy lifing. If you're managing the buffers and out-of-screen context good enough, Typescript can be pretty efficient.

      3 replies →

I would imagine the extension system they built would be much more difficult to manage. They could have opted for Lua, though, I suppose.

I agree, but there are a lot of great reasons for TypeScript:

It's hot reloadable, so any modifications an agents makes can be surfaced in the active session.

Nearly everything is already written in TS which makes integrating Pi into other software, or other software into Pi much easier.

Why does it matter? Agent harnesses aren't doing anything that would make a compiled language more suitable than a scripting language.