hello well I hope Im not breaking some spamming rule here with this. I just asked a question about how the erlang compiler implements pattern matching, and I got some great responses, one of which is the compiled bytecode (obtained with a parameter passed to the c() directive):
{function, match, 1, 2}. {label,1}. {func_info,{atom,match},{atom,match},1}. {label,2}. {test,is_tuple,{f,3},[{x,0}]}. {test,test_arity,{f,3},[{x,0},2]}. {get_tuple_element,{x,0},0,{x,1}}. {test,is_eq_exact,{f,3},[{x,1},{atom,a}]}. return. {label,3}. {badmatch,{x,0}}
its all just plain erlang tuples. I was expecting some cryptic binary thingy, guess not. so Im asking this on impulse here (I could look at the compiler source but asking questions always ends up better with extra insight), how is this output translated in the binary level?
say {test,is_tuple,{f,3},[{x,0}]} for example. Im assuming this is one instruction, called 'test'... anyway, so this output would essentially be the AST of the bytecode level language, from which the binary encoding is just a 1-1 translation? This is all so exciting, I had no idea that I can this easily see what the erlang compiler break things into.
thanks so much