On Mon, 25 Sep 2006, Christoph Herrmann wrote:

> I'm looking for an honest classification. The aim of the GLs is,
> as I think, the degree of abstraction. The question is, how much
> *intelligence* provided by preprocessing, libraries etc. is permitted.
> Personally, I think Haskell should be a 5GL because Prolog is a 5GL.
> What Prolog really provides concerning automatic problem solving
> is little: equation solving in term algebra; you can simulate that
> in Haskell without much effort. On the other hand, I saw Haskell
> classified as a 3GL. The problem is that Haskell often exposes
> the algorithmic structure. What people often forget is that Prolog
> programs in non-trivial situations are likely to fail if you do
> not prescribe the evaluation order, by features like the cut which
> destroy the declarative semantics. People also forget that arithmetic
> constraints in Prolog have to be directed (input/output variables),
> no difference to Haskell.

Compare Haskell with Computer algebra systems, where you can write root
equations, and the system tells you the set of solutions. CAS let you
write some infinite sum or integral, things that cannot be solved by brute
force, and the system simplifies that to a fraction of pi or so. This is
non-trivial and you would have to program a lot in Haskell to achieve
this.

> My argumentation is:
> Prolog is a 5GL & Haskell is more abstract than Prolog => Haskell is a 5GL

Or Prolog is better classified as 3GL. :-)

> Some of the language features in Haskell that contribute to this abstraction
> are:
> laziness, pattern matching with guards, list comprehensions, type classes

Pattern matching with guards is not more than a 'switch', list
comprehension is syntactic sugar, some type relations are available in all
OO languages. What remains special is laziness, higher order functions.
(Did I forget something?) Indeed, these features allow for more
abstraction. Maybe we could classify Haskell as 3.5 GL or so. :-)

> Please note that this is not a philosophic discussion. If Haskell is a
> 3GL, than it is at the same level with Java and since Java is more
> common, people think they should always use Java. Haskell as a 5GL will
> tell people: this is a language in which you can solve problems simpler
> and safer and it will encourage people to try to solve problems instead
> of resigning due to the complexity of the problem.

So classification is a marketing issue? A higher level of abstraction can
also scare people, if they expect efficiency. I also know Java freaks who
stay away from Haskell, because they find it too abstract.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to