2 ms·
I think the difference is that in Prolog you have imperative state management while Mercury only has pure functions, and manages state through linear types. ED
by riffraff 6y ago
I think the difference is that in Prolog you have imperative state management while Mercury only has pure functions, and manages state through linear types.
EDIT: the "about" page may explain this a tad better https://mercurylang.org/about.html https://mercurylang.org/about.html
- jfmc 6y agoAnother difference between Prolog and Mercury is that Mercury lacks 'real' unification. Predicates must be moded (they must be compiled for some particular variable instantiation states). The compiler reorders literals in a way that free variables do not need to be represented in memory. Almost all the 'logical' side of the language is discarded statically at compile-time. The first time that I tried it (+ 20 years ago!) executables were blazingly fast! The bad side (at the time) was poor flexibility and very slow compilation time (compared with Prolog).
- lars512 6y agoOf course, for any prolog program of significant size, you want nearly all of it to be moded and deterministic anyway, and not leave choice points all over the shop.
- toolslive 6y agoIndeed. Mercury has a really powerful static type system, while prolog hasn't.