4 ms·
I agree that the lack of types is a serious deficiency, but surely that can't be the reason Prolog lost steam? I mean... Python? As for modes, I'm not convince
by felixyz 3y ago
I agree that the lack of types is a serious deficiency, but surely that can't be the reason Prolog lost steam? I mean... Python?
As for modes, I'm not convinced they are really needed? I do feel they take away a lot of the beauty of Prolog, and a lot of the incentive to think in relations. (Or at least, I fear they do. I haven't actually programmed in Mercury. Would be happy to be proven wrong.)
- discarded1023 3y agoI learnt as an undergrad that every sufficiently large program contains a type system (in the loose PL sense of operations requiring arguments of certain sorts) ... now that can be provided by the language or in an ad hoc way by the program itself. (Yes, shades of the CLOS truism.) Python has learnt this lesson (at least I get this impression from reading hacker news) since I stopped using it circa 2015. As for modes, well! 1. they were needed for at least one Uni of Melbourne person to receive their PhD degree, and less facetiously 2. they are needed for efficient code generation. They can be inferred for this purpose. One use case you may consider is enforcing the correct dataflow in a DCG. Otherwise they are handy for preventing calls to predicates that would not terminate. I've never programmed in Mercury but it really looks like an ML to me. It was beautifully engineered in the late 1990s and it's a shame it hasn't received more attention. Its FFI influenced the development of Haskell's.
- zelphirkalt 3y agoAh, but Python has always had types. Just not static types. It still does not really have static types. Static type validation is done by external tools like MyPy. Python itself ignores type declarations at runtime. Still objects of Python have types. You just cannot reason about them at compile time using only pure Python.