Typescript: Rust's non-biological brother
Why did I start learning it?
I embarked on my journey with TypeScript on May 28, 2024, to contribute to the Jam Project as part of the Summer of Bitcoin Internship program.
What do I mean by brother?
Strong typing: Both languages emphasize static typing to catch errors at compile-time.
Modern language features: They both incorporate modern programming concepts and syntax.
Tooling and ecosystem: Both have robust tooling support and growing ecosystems.
Safety focus: TypeScript and Rust prioritize writing safer code, albeit in different ways.
Compiled languages: Both compile to a target language/format (TypeScript to JavaScript, Rust to machine code).
Huh, They are pretty similar in some traits and also share pretty much same syntax.
Here's a Basic Function using Generics in both languages!
function identity<T>(arg: T): T {
return arg;
}
let output = identity<string>("myString");
let output2 = identity("myString"); // Type inference
fn identity<T>(arg: T) -> T {
arg
}
let output = identity::<String>(String::from("myString"));
let output2 = identity("myString"); // Type inference
Can you notice the similarities? I mean WOW!
As a person coming from Rust and Typesafe languages, I was able to pickup Typescript very quickly and absolutely love it now.
Thanks for Reading my blog, this is the first one in series and I hope to continue it.
If you have come this far? Here's a gift for you 🎁




