Is Learning Prolog Beneficial for a Career in Programming?

  • Thread starter dmatador
  • Start date
In summary: He was the one who introduced me to prolog and I was pretty amazed how he could just code a reasonable AI to play a very good game of cards we always played in a couple of hours in prolog.
  • #1
dmatador
120
1
Is being able to work effectively with Prolog a worthwhile skill to have? Is Prolog widely used as far as logic programming languages go? Are there any others you might recommend? I am just interested in learning a new, different language after learning some C++ and learning Prolog (or a similar language) seems like a fun task.
 
Technology news on Phys.org
  • #2
Others might disagree, but I don't see skills in Prolog programming as being especially useful. If it seems interesting to you, go for it, though, but if by "worthwhile" you mean something that would enhance your resume, I would advise learning more C++ or start with Java of C#.
 
  • #3
I used Prolog for a class in college, and that was it. Since then, I've only used Prolog in sentences where I talk about having used it once. As near as I can tell, it's pretty much never used in the general programming industry-- there are some niche jobs out there, but not much comparatively. If you find it interesting, go for it, but I wouldn't expect anything to come out of it from a professional standpoint.

Depending on what you want to do, I'd maybe recommend Java, C#, PHP, Python, or Perl.

DaveE
 
  • #4
Pretty much unused in industry.
But if you have a background in Prolog you might want to look at Haskell or F#, these are becoming more widely used but are tricky for people coming from a procedural or OO language to really get.
 
  • #5
I've had no experience in the industry yet but I can say I've only seen one internship out of a ton where prolog experience was wanted, was at lockheed.
 
  • #6
If you end up designing robots, chatbots, facial recognition software, artificial intelligences playing go, then absolutely.

If you end up doing anything that will reward with money rather than with publications in journals, probably not. Prolog is pretty much unlike most other languages though, yes, it's different than C, it's also just as different from Haskell or OCaml. The only way to learn prolog ... is to learn prolog.

Learning prolog will greatly change the way you look at a problem though, that's for sure, if this is a good thing or a bad thing is in the eye of the beholder.
 
  • #7
Prolog is a terrible choice for most of those applications. If you end up designing robots, (building toy robots in a university lab environment excluded), the robots most likely will have very little AI in them. Real robots, the ones used in factories, in the military, and in space, are dumb, dumb, dumb. Facial recognition is highly numerical. Whether you are using fast Fourier transforms, eigen decomposition, wavelets, or something new, Prolog is not the language for doing that. Computer go? That's done in procedural languages (C, C++), Lisp, and functional languages such as OCaml and Haskell.

To the OP: Learning a computer language that teaches you to think differently is a good thing. However, that learning should also have some side effects such as gaining a marketable skill. Prolog has no side effects.
 
  • #8
D H said:
Prolog is a terrible choice for most of those applications. If you end up designing robots, (building toy robots in a university lab environment excluded), the robots most likely will have very little AI in them. Real robots, the ones used in factories, in the military, and in space, are incredibly stupid. Facial recognition is highly numerical. Whether you are using fast Fourier transforms, eigen decomposition, wavelets, or something new, Prolog is not the language for doing that. Computer go? That's done in procedural languages (C, C++), Lisp, and functional languages such as OCaml and Haskell.
I would beg to differ here, a mate of mine studied AI and had to do all those things and prolog at his studies was basically the holy grail, they did about all things in prolog.

As for myself, for a lot of these problems I would immediately grab to prolog or nondeterministic Scheme which is very prolog like. He was the one who introduced me to prolog and I was pretty amazed how he could just code a reasonable AI to play a very good game of cards we always played in a couple of hours in prolog.

The use of a functional language for go would be ... strange to me as there really is very little use for functions that have an co/domain of anything other than booleans for Go, either you move it there or you don't, either it's there or it is not.

Essentially logical programming is functional programming where all your functions have a co/domain of booleans.

http://homepage.mac.com/adammcnicol/A2podcast/COMP3_28_prolog.pdf

If you go to the last page, that little intro to prolog essentially gives a lot of these examples.
 
Last edited by a moderator:
  • #9
ZQrn said:
I would beg to differ here, a mate of mine studied AI and had to do all those things and prolog at his studies was basically the holy grail, they did about all things in prolog.

I used Prolog in college, too (I can't recall for what class). But when I went to the real world, poof! Gone. Did your friend wind up finding jobs (or landing any), that used Prolog? Or was his use limited to school? Just curious, since sometimes academia has a different skillset than the industry.

I guess I kind of figure that SOMEONE out there is using Prolog, but I didn't think it was actually used in things like game AI for commercial products or anything. I can't imagine (for example) StarCraft 2's logic engine being programmed in Prolog. But I COULD imagine things like research projects for chess programs being written in it. Or maybe applications for neural networks? Again, I don't really see neural networks applied anywhere in business (maybe I'm just not looking in the right places), but I DO see them mentioned in research projects and such.

For the record, I used Scheme for our AI class (not Prolog), and I have to say it was quite a different way of wrapping my head around problems than any language I had used prior (BASIC, C, C++, and Pascal at the time). I guess I don't remember much about what specifically makes it so much better for AI than other languages (or, so I've been told). Does it actually perform better? Or is it merely the way the language is constructed? At the time, I was rather unimpressed, and I recall always wishing I could write the assignments in C.

DaveE
 
  • #10
davee123 said:
I used Prolog in college, too (I can't recall for what class). But when I went to the real world, poof! Gone. Did your friend wind up finding jobs (or landing any), that used Prolog? Or was his use limited to school? Just curious, since sometimes academia has a different skillset than the industry.
Well, as I said before:

If you end up doing anything that will reward with money rather than with publications in journals, probably not.

I sincerely doubt it, there are maybe some jobs out there. But in the end, prolog was designed as a research language, not a commercial language. But then again, so was Fortran and C was originally designed as a portable assembly in mind and we saw what came from those.

Edit: By the way, though he mostly programs in Java for his job, he does occasionally work in prolog, he works at a security firm and has actually convinced them to start using prolog for some things, apparently it went like 'This took several people a week do to in Java? I can do this in five hours in prolog.' - 'What is this "prolog" you speak of?' - 'Some language specifically designed for AI.' - 'You're on, I want to see this.'

I guess I kind of figure that SOMEONE out there is using Prolog, but I didn't think it was actually used in things like game AI for commercial products or anything. I can't imagine (for example) StarCraft 2's logic engine being programmed in Prolog.
Unlikely that prolog would be used for game bots in shoot'em ups or RTS, but a chess bot or a go bot would have its applications.

Prolog is ultimately best suited to code AI's that learn along the way.

But I COULD imagine things like research projects for chess programs being written in it. Or maybe applications for neural networks? Again, I don't really see neural networks applied anywhere in business (maybe I'm just not looking in the right places), but I DO see them mentioned in research projects and such.
Well, prolog could indeed have an application in market analysis I reckon, predicting the next step the market will take and all those things with a self-learning AI, prolog is suitable I guess.

Though, one thing I have to add is that I'm with Dijkstra on the fact that corporations make bad decisions regarding programming languages and technology in general, CEO's, usually don't know anything about programming and I am particularly unimpressed with the grave errors some CEO's can just make and still get a gigantic bonus. Dijkstra was ultimately right that what we're doing was and still is to some extend a time bomb. The code on which large corporations run is hacked together and isn't scalable at all. Declarative languages such as prolog or functional languages provide scalability.

But that's all tangent to how easy you're going to find a job with prolog, that they should do it doesn't mean they do it. In the end we have to accept that large corporations started wrongly decades ago and have now become dependent on badly coded software in the wrong language which a rewrite in a good language would be an investment, but an expensive one.

So my final verdict is simply to be summarized with:

A: prolog will not land you a job in commercial ventures
B: prolog has its uses in academics
C: prolog will teach you a way to think that could be useful

For the record, I used Scheme for our AI class (not Prolog), and I have to say it was quite a different way of wrapping my head around problems than any language I had used prior (BASIC, C, C++, and Pascal at the time). I guess I don't remember much about what specifically makes it so much better for AI than other languages (or, so I've been told). Does it actually perform better?
Prolog's performance used to be extremely bad, but JIT compilation and some tricks have since made prolog reasonably on par performance wise with other similar dynamic and reflective language, it's not a number cruncher though.

Prolog isn't better for AI per se, prolog in the end is mainly for self-learning systems, for instance, the physics and facial expressions behind Final Fantasy, The Spirits Within were done in Scheme I believe, and Scheme is an excellent language for that. As soon as you start dealing with numbers instead of true/false, prolog isn't that good.

Or is it merely the way the language is constructed? At the time, I was rather unimpressed, and I recall always wishing I could write the assignments in C.
Well, most Scheme / prolog / Haskell whatever programmers will tell you 'if wish to use assignments, you're doing something wrong' and I second this. So to the OP, you've only mastered prolog once you never think 'Hmm, it would be nice to change the value of this variable here'. Don't try to replicate an imperative style in a declarative language, rather realize that a declarative paradigm is simply different.

And this is also one of the valuable skills that prolog will teach you, in prolog, you don't code while you think of the problem, in prolog and most declarative languages, you work in a top-down way. You first analyse exactly what your problem is, and then the code writes itself. This is why declarative programs are often very terse, but tend to require extensive planning before you can even begin. You have to ask yourself what the problem is precisely before you can solve it. Prolog thus teaches you to disassemble a problem into its essential components, which is a skill that could be useful outside of programming.

So if you have the time, give it a try, see if you like it, and if not, then by all means stop. Because it probably won't land you a job, though it might look good on your resume that you also know prolog, it shows you can adapt.

I mean, try to write a program that when given an arbitrary version of the liar paradox gives its solution space to you. You know, those riddles like 'Frank says that john always lies, Michelle never lies and says that at least one of frank and john lie ...', you do not want to do that in Java or C. You want to do that in prolog or maybe nondeterministic Scheme
 
Last edited by a moderator:

Related to Is Learning Prolog Beneficial for a Career in Programming?

1. What is Prolog?

Prolog is a programming language that is based on logic and is commonly used in artificial intelligence and natural language processing applications. It allows users to define rules and facts, and then use a built-in inference engine to make logical deductions based on those rules and facts.

2. Is Prolog difficult to learn?

Prolog can be challenging to learn for those who are not familiar with logic-based programming. However, with dedication and practice, it can be a powerful tool for solving complex problems and developing intelligent systems.

3. What are the main benefits of learning Prolog?

Learning Prolog can enhance your problem-solving skills and help you understand and apply logic in programming. It is also useful for building intelligent systems and has applications in various fields such as natural language processing, machine learning, and database querying.

4. Is Prolog still relevant in today's technology landscape?

Yes, Prolog is still used in various industries and has a strong presence in AI and natural language processing. It is also continuously evolving and has a growing community of developers and researchers working on its advancements.

5. How can I get started with learning Prolog?

There are various resources available online for learning Prolog, including tutorials, courses, and books. It is recommended to start with a basic understanding of logic and then move on to learning the syntax and features of Prolog. Practicing and solving problems is also crucial for gaining proficiency in the language.

Similar threads

  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
8
Views
1K
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
13
Views
828
  • Programming and Computer Science
12
Replies
397
Views
14K
  • Programming and Computer Science
2
Replies
58
Views
3K
  • Programming and Computer Science
Replies
14
Views
2K
  • Programming and Computer Science
Replies
32
Views
3K
  • STEM Academic Advising
Replies
12
Views
1K
Back
Top