Women in Technology

Hear us Roar



Article:
  What I Hate About Your Programming Language
Subject:   Screw this! Why I love Prolog
Date:   2003-05-13 21:52:00
From:   anonymous2
In Prolog you describe the problem instead of attempting to describe a (usually, accidentally, inevitably partial) solution.


This solves two problems at once: once the problem is understood, it is also (Zen-like) solved.

Main Topics Oldest First

Showing messages 1 through 2 of 2.

  • Screw this! Why I love Prolog
    2003-05-14 04:51:18  anonymous2 [View]

    At best true for toy problems and if you're satisfied with O(n!) performance. There's quite a difference between:

    randomsort(L1, L2) :-
    permutation(L1, L2), ordered(L2).

    and

    quicksort([], []).
    quicksort([X], [X]) :- !.
    quicksort([H|T], S) :-
    partition(H, T, L1, H2),
    quicksort(L1, S1),
    quicksort(L2, S2),
    append(S1, [H | S2], S).

    I like Prolog a lot, but the "describe the problem instead of the solution" claim is only partially true. Using it as the only reason to say you love Prolog mostly indicates that you should look for better arguments.

    BTW: "Zen-like"? I think SLD-resolution is more responsible...
  • Screw this! Why I love Prolog
    2003-05-14 01:12:31  anonymous2 [View]

    It doesn't scale, but - you've got to understand all of the problem all at once, or use various hacks to divide and conquer. Prolog is good if you're Marvin the Paranoid Android.