Which language we should for Warp 3? Typescript or Rust

Benefits of Typescript :

  • Current team is very mature in writing code in Typescript, as previous versions of warp is written in TS.
  • Typescript has solc-typed-ast lib which is very rich in handling the generated AST after the parsing of solc contracts (eg, nodes operation, metadata about nodes…)

Disadvantages of Typescript:

  • The compiled source code of the compiler is in JS which doesn’t enforce the strict types of objects which leads to difficulty in tracing the errors.
  • we can’t directly use the functions/APIs implemented in cairo compiler written by StarkWare, which is in Rust.

Benefits of Rust over Tyepscript:

  • strict type checking of objects during the runtime
  • Direct use of functions/APIs from the cairo compiler

Disadvantages :

  • Some of us in the warp team is not very familiar with Rust, It’ll take some time to learn it
  • Requires a deep inspection of solang (solidity parser in rust) library to see if it is as rich as solc-typed-ast
  • language is little more cryptic than typescript (not a deal breaker though!)

This is not true. Rust has no concept of types at runtime. Rust is very powerful, and not having type information at runtime is a feature, not a bug. The rust compiler and type system are so powerful that you don’t need to check type consistency at runtime . This means there is no way of introspection(reflection) for rust programs at runtime, however, like I said before, the type system is so powerful that you won’t need this.

2 Likes