I’ve seen examples when output (out param) was in the middle of the signature (they postfixed as Ref).
It was like SomeClass.SomeMethod__Param1_Param2_Param3Ref_Param4__Param5 with corresponding c# like signature like that:
static Param5 SomeClass.SomeMethod(Param1 param1, Param2 param2, out Param3 param3, Param4 param4).
And input output slots for method’s node were like this in: [ Param1 “param1”, Param2 “param2”, Param4 “param4” ], outs: [ Param3Ref (corresponding .net type = Param3) “param3”, Param5 null ].
What for same-ish signatures: they belong to different Types (GameObject/Transform) - so there is no ambiguity (full method signatures are always unique, they are like Id’s). What for deciding if method is static or not - i consider method being instance if 1st parameter (node’s input slot) is of method’s owner type and it’s called “instance”. Looks like this instance parameter is not listed in method signatures, so it’s important to know if method is static to push parameters properly before external call.
I also found some strange stuff though. There were types from different methods and from one of events which doesn’t correspond to any Type_ / Variable_ / Const_ graphs - so i only can find it’s “assembly” names by parsing signatures. For example List<UnityEngine.Object>.
For now i think of this kind of decision to get method parameter’s typenames: for example signature like this ParamA_ParamA_ParamB_ParamBRef_ParamA_ParamARef_ParamARef__ParamA would lead to inputs: [ ParamA, ParamA, ParamB, ParamA ] and outputs: [ ParamBRef, ParamARef, ParamARef, ParamA ] (last is always return value, if it’s not void).
I still not sure which order is right to pass params to method - based on signature or based on method’s nodes inputs/outputs definition. Gonna investigate graph’s code for that later…
About request for ability to push integers as literals to stack - it looks like it could be done by just making new variables for that (with null value as initial and actual initial value as runtime .net type instance value passed along with assembly code as part of IUdonProgram (look at graph’s program source code how they do that). It’s look like dirty hack not being able to initialize literals in assebly code, but it works this way for now at least.
PS: I get all graph data from GetRegistries (or something like that) methods from some .dll which is used by graph editor to get all data for drawing nodes.
I’m also trying to make some custom compiler. I would love to use c# but i’m not sure it could be implemented with full support, and also some reflection related stuff looks like will take huge amount of “heap” memory to work, because it’s runtime thing. And there is also this custom stuff like synced variables. It could be done by custom c# attributes maby.
For now i’m thinking about small c#/c-like (not oop, only functions/variables) language compiler based on antlr (language parser generation library). I think i know how to do majority of stuff to do simple programs on it, it must be much easier than graph for coders at least. Not sure i have time for this though