News for hackers. Stuff that matters.
Re:Koto Programming Language by zozbot234 on Saturday March 29, 2025 @11:45AM (#43516401)
Rust itself has dynamic types via the Any trait and &dyn Any variables. They are not the default of course, but they're available should you really want them. IIRC C# works similarly, only its feature is called Dynamic instead, or something like that.
Re:Koto Programming Language by skitter on Saturday March 29, 2025 @12:59PM (#43516876)
They're rather different: In Rust types only exist at compile time; dyn Any is a normal trait object, so you can only call the trait's methods. With C#'s dynamic, you can call arbitrary methods and access any fields with type checking of those accesses being delayed until runtime, which works because types exist at runtime too.

Rust's dyn Any corresponds better to C#'s Object; dynamic exists to interface with dynamic languages and is rarely used.