2021-02-22
2646
#rust#typescript
Ukpai Ugochi
34719
Feb 22, 2021 â‹… 9 min read

Switching from Rust to TypeScript (and vice versa)

Ukpai Ugochi I'm a full-stack JavaScript developer on the MEVN stack. I love to share knowledge about my transition from marine engineering to software development to encourage people who love software development and don't know where to begin. I also contribute to OSS in my free time.

Recent posts:

Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 min read
Exploring Zed, A Newly Open Source Code Editor Written In Rust

Exploring Zed, an open source code editor written in Rust

The Zed code editor sets itself apart with its lightning-fast performance and cutting-edge collaborative features.

Nefe Emadamerho-Atori
Apr 22, 2024 â‹… 7 min read
Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
View all posts

3 Replies to "Switching from Rust to TypeScript (and vice versa)"

  1. “You don’t need to install any runtime environment to execute TypeScript code.” That’s not really true… you first need a TypeScript to Javascript, compiler, and then you need a Javacript interpreter runtime (embedded in a browser or in nodejs) to run your program. Granted, for many people they already have a runtime installed on their system, but for some applications this could be a deal-breaker.

  2. Good read for primer. Thanks

    “Rust has the const keyword. However, you can only set the variable value at runtime alone, not at compile time.

    fn another_function(x: i32) -> i32 {
    return x + 1;
    }

    fn main() {
    // RUN-TIME ASSIGNMENT, if you replace const with let, there’s no compile error
    const z = another_function(5);
    println!(“The value of z is: {}”, z); // 6
    }
    Because let can be set at compile time and const can’t, the code throws an error at compile time. Although Rust variables are immutable by default, you can redefine or shadow variables of type let:

    I’m pretty sure you meant run-time and compile-time the other way around for this section (the typo is in the text, not in the code).

Leave a Reply