Define a behavioral contract (inputs, outputs, edge cases) with test cases, and let each language handle types idiomatically. `dict[str, Any]` becomes `Record<string, unknown>` in TS, `map[string]interface{}` in Go, `HashMap<String, Box<dyn Any>>` in Rust. You don't force one type system onto another.
For dynamic languages, type hints document intent but tests enforce the contract. If the function accepts the specified inputs and produces the specified outputs, the contract is satisfied, regardless of whether types are checked at compile time or runtime.
Define a behavioral contract (inputs, outputs, edge cases) with test cases, and let each language handle types idiomatically. `dict[str, Any]` becomes `Record<string, unknown>` in TS, `map[string]interface{}` in Go, `HashMap<String, Box<dyn Any>>` in Rust. You don't force one type system onto another.
For dynamic languages, type hints document intent but tests enforce the contract. If the function accepts the specified inputs and produces the specified outputs, the contract is satisfied, regardless of whether types are checked at compile time or runtime.
What do you think?