I'm thinking more about the programmers interface, some concepts are really hard to translate. For example C++ and Haskell.
How do you translate this function:
Haskell has no concept of varadics, and I'm sure that working out the Haskell type constraints for this (which is required to make return type inference work) is at least equivalent to the halting problem, if not impossible.
Or another example, Haskell to C#.
A different implementation for bar is invoked depending on the type of the returned value. I'm pretty sure you cannot express that in C#.
How do you translate this function:
Code:
template<class T...>
std::tuple<Baz<T>::type...> foo (T... x)
{
return std::make_tuple<Baz<T>::type...>(bar(x)...)
}
Haskell has no concept of varadics, and I'm sure that working out the Haskell type constraints for this (which is required to make return type inference work) is at least equivalent to the halting problem, if not impossible.
Or another example, Haskell to C#.
Code:
class Foo a where
bar :: int -> a
instance Foo Baz where
bar = something
instance Foo Blah where
bar = something
A different implementation for bar is invoked depending on the type of the returned value. I'm pretty sure you cannot express that in C#.