Skip to content

Agency vs TypeScript

Because Agency compiles to TypeScript, it has many similarities, but some things are different.

There are some syntactical differences. For example, Agency does not have (an incomplete list):

  • A ternary operator (it has the single-line if expression)
  • for (let i = 0; i < n; i++) loops (it has a while loop and an iterative for loop)
  • Classes
  • Lambdas (it has blocks)
  • Conditional types

On the other hand, Agency has a lot of things built into the language that TypeScript doesn't. Most of them exist to make writing agents safe and easy: