Bayes net: algorithm to calculate joint distribution?
You already have the result of the chain rule - this is your networks topology basically. Now you need to compute the joint. I would start from "root nodes", i.e. nodes with no parents, and proceed forward (I'm sure you can go the other way too, just more pain):


Each of the "root nodes" has its "own" joint already. I.e. if your network was just one root node, you're done - just output the CDF.
Now suppose your network is two "root nodes". What's the joint? Suppose you have two boolean variables A,B with values a,~a,b,~b. The joint is:

(a,b, P = a*b)

(a,~b, P = a*~b)

(~a, b, P = ~a*b)

(~a,~b, P = ~a*~b)
This looks like a cartesian product. I.e. you have a cartesian product in the variables, and the value is the product of terms. This is the simple version of a "factor product" - where factor is some unnormalized discrete distribution. 
In general the product of two factors will encounter variables that are common to the factors. Do the cartesian product and throw out all tuples that match on the common variables - this is the join in databases. Compute the probability as before.
Now you have the factor product. Just use on your graph to compute the joint. Be careful with paths that separate and then join back in the graph.