Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Writing tar in PROLOG sounds "cool", a neat hack, but it is as practical as writing the Linux kernel in COBOL. Possible, perhaps, but not the best idea.

It's hard enough to write things in PROLOG that _are_ ideally suited for the language - like natural language parsers (they used to be LISP or PROLOG, but these days they are all in C++ or FORTRAN wrapped in Python so no-one gets hurt; why? Because of efficiency and numeric libraries required - modern parsers for human languages implement probabilistic or neural models, no longer symbol manipulation and pattern matching).

EDIT: I'm not a PROLOG hater - in fact, enjoyed reading the article (and I will read sequels on implementing "mount" in RPG3, "htop" in COMAL etc.) and my friends include some PROLOG lovers. I also find it important and stimulating to learn about another paradigm, and logical programming is an important one for many reasons. This rant is more about using it on the specific task of implementing "tar", for which it is a poor fit, as the article's PS shows.



Rubbish. It’s attitude like that which keeps less common languages from taking off. Hidden mindset-language bias stemming from using the hammer you’re familiar with for every nail.

Moreover, Prolog in particular requires a complete mindset change in order to naturally write in it. Once you reach that level - anything is possible and even not that hard to write in Prolog.


Binary file formats, like text formats, are simply languages, and declarative logic languages like Prolog, are excellent for parsing, as you said. Thus, it stands to reason that Prolog would be a very good fit for parsing data. That doesn't change just because the data is not ASCII-encoded.


This version is also insecure, as it does not prevent file path traversal attacks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: