zlacker

[parent] [thread] 2 comments
1. YeGobl+(OP)[view] [source] 2024-10-13 20:26:57
Then don't use Prolog. It's not mandatory.

For the record I never have problems like that and I'm sure I'm not special. Well, not in that way. This all comes under the heading of "learn what works". You have to do that with any language.

Edit: as a slightly less flippant answer (sorry) Prolog doesn't "do a lot of manual stuff that the language should do for you" because the Prolog community doesn't think the language should do those things for you and I agree. Take for instance inheritance and composition, like in object orientation. There's no reason Prolog should do that for you. If it did, it would shoehorn you into a certain programming paradigm that can feel like a straightjacket when you don't need it, but you absolutely need to use it because that's what the "language does for you". Prolog instead gives you the tools to do all the things you need, when you need them. It's more work, for sure, but it's also more freedom. I spent most of my career in the industry working with very rigidly OOP languages and that's one reason why I escaped into academia, where I can program in Prolog (see what I did there?) all day without having to declare a class property if I don't want to. And if I really wanted to, I could go all the way and write something like Logtalk:

https://logtalk.org/

Another example of something that Prolog doesn't do for you, and that you don't always need, but can always do yourself if you need it, is typing; like I point out in the sibling comment. Why should Prolog do that for you? Are we going to have the whole argument about strongly typed vs. weakly typed languages all over again? I think not. If you want types in Prolog, you can roll your own. Now try to write, say, C# code without types, when you really don't need the bother.

replies(1): >>foobie+bw3
2. foobie+bw3[view] [source] 2024-10-15 03:57:59
>>YeGobl+(OP)
You can never roll your own and have a working ecosystem. This is exactly the problem.
replies(1): >>YeGobl+3I4
◧◩
3. YeGobl+3I4[view] [source] [discussion] 2024-10-15 15:06:32
>>foobie+bw3
Why is that? Ultimately someone has to work on the tooling for any project. If you're working in a group in particular, you can have different people working on different parts of the project. If you need a type system, you can have one programmer write it and maintain it, or be the product owner whatever the terminology is these days, then everyone else can use the type system and not have to worry about it any more.

To be clear, there are only some tools, or let's say abstractions, that you need to implement on your own. The good thing about Prolog is that it has a very mature ecosystem of libraries and packages that you can pick off the shelf and work with immediately. Although that is mostly true for SWI-Prolog, where most of those libraries are found. You normally have to write some translation layer to port them over to a different Prolog- and that is totally a PITA. But there's no reason not to use SWI-Prolog, which is free as in speech and as in beer.

For example, SWI-Prolog has http libraries that have everything you need to set up a web app, using Prolog itself as the database and the back-end language both- it's like a LAMP stack except the stack is LP: Prolog running on Linux:

https://us.swi-prolog.org/FAQ/PrologLAMP.md

I reckon the only reason this is not widely used in the industry is because web devs, like everyone else, don't have the time and energy to learn a whole new language, especially one so scary as Prolog. Quoting from the link above:

Our final problem is the lack of masses of Prolog programmers one can easily hire.

[go to top]