Comment

Comment by vict00r99

You don't map the types, you map the behavior.

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?

parent vict00r99 8 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton