Why do we need 3 Vector3 types?
#14
I'm going to write up a little bit about how UPE works so that you can have a general idea of how it works.
Templates have been something that I have been struggling with implementing without header files, due to the fact that they only exist within the compiler itself; when you output the code, there is no template function, just copies of it for the specific types used.
Haskell doesn't need to know about templates, only the compiler has to know that it is. So, when it is compiling, it locates the function and determines that it is a template. It duplicates the code, specializes it for the type coming in, and pops that code into the file that was calling it. That, of course is in an ideal setting where the type coming in fulfills the requirements for the template.
As for C# not having return type inference, the compiler handles that all, making sure that the right function/method is used, and C# doesn't have to worry about it.

One thing that I haven't even considered yet is cross-language inheritance. I'm going to have to give that some thought.
Reply
Thanks given by:


Messages In This Thread
Why do we need 3 Vector3 types? - by Shadowraix - 06-10-2015, 09:06 PM
RE: Why do we need 3 Vector3 types? - by xoft - 06-10-2015, 09:36 PM
RE: Why do we need 3 Vector3 types? - by xoft - 06-10-2015, 10:11 PM
RE: Why do we need 3 Vector3 types? - by xoft - 06-11-2015, 12:13 AM
RE: Why do we need 3 Vector3 types? - by SamJBarney - 06-16-2015, 04:27 AM



Users browsing this thread: 9 Guest(s)