The fact that template data layout is non-parametric in the argument types makes that a very hard problem, unfortunately.
-
-
Replying to @pervognsen @TimSweeneyEpic
Were they parametric you could represent a template instance type as template descriptor + argument type descriptors.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
But a non-forgetful/non-flattening encoding of C++ templates requires you to replicate arbitrary compile-time computations.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
And even something like Blueprint shows that you can't get away with a flattening encoding of template types.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
You have that FScriptArray hack. Although both TArray and TMap are (morally) parametric so amenable to proper treatment.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
Proper treatment for TArray being that a FScriptArray would actually carry the UClass pointer as an element type descriptor.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
Which immediately brings back the issue with the UClass approach versus type descriptors that are plain old data.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
E.g. I shouldn't have to intern a UClass to describe an instantiated TArray with an element type to the rest of the system.
1 reply 0 retweets 0 likes -
Replying to @pervognsen @TimSweeneyEpic
Parametric templates with dictionary passing as the default and monomorphic instantiation as an optimization: easy interop.
1 reply 0 retweets 4 likes -
Replying to @pervognsen @TimSweeneyEpic
Unfortunately, that doesn't describe C++ templates, which is why I'm skeptical a good solution to your problem is possible.
1 reply 0 retweets 1 like
For each specialized template, the compiler could generate a function from type arguments running arbitrary code, right?
-
-
Replying to @TimSweeneyEpic
Hah, I suppose, although that feels like a classic C++ joke ("and then we had to do X") in the making. :)
1 reply 0 retweets 1 like -
Replying to @pervognsen @TimSweeneyEpic
"To avoid bloating the binary with the reified template resolvers, we included LLVM in every exe for JIT compilation."
1 reply 0 retweets 0 likes - 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.