weight = ReleaseHold@
With[{cg = Compile`GetElement, rc = RuleCondition},
Hold@Compile[{z, {x, _Real, 1}, {m, _Integer}},
Module[{c, c1, c2, c3, c4, c5, mn, n = Length@x - 1},
c = Table[0., {j, 0, n}, {k, 0, m}];
c1 = 1.;
c4 = x[0] - z;
c[0, 0] = 1.;
Do[
mn = Min[i, m];
c2 = 1.;
c5 = c4;
c4 = x[i] - z;
Do[
c3 = x[i] - x[j];
c2 = c2 c3;
If[j == i - 1,
Do[c[i, k] = c1 (k c[i - 1, k - 1] - c5 c[i - 1, k])/c2, {k, mn, 1, -1}];