Another possibility is to use proximities - or equivalently (totally bounded) uniformities: in the metric case one defines $A$ and $B$ to be 'close' close' (usually denoted $A\mathrel\delta B$) if $d(A,B)=0$. The relation $\delta$ satisfies the proximity axioms and it determines a compactification $\tilde X$ of the space $X$ with the property that for subsets $A$ and $B$ of $X$ one has $A\mathrel\delta B$ iff the closures of $A$ and $B$ in $\tilde X$ intersect. The Freudenthal compactification comes from the proximity defined by declaring $A$ and $B$ to be
far(usually denoted $A\mathrel\delta B$) if $d(A,B)=0$. The relation $\delta$ satisfies the proximity axioms and it determines a compactification $\tilde X$ of the space $X$ with the property that for subsets $A$ and $B$ of $X$ one has $A\mathrel\delta B$ iff the closures of $A$ and $B$ in $\tilde X$ intersect.
The Freudenthal compactification comes from the proximity defined by declaring $A$ and $B$ to be 'far apart' iff they have disjoint open neighbourhoods $U$ and $V$ respectively such that $X\setminus (U\cup V)$ is compact, that is, they are separated by a compact set.