Long kodil on java, passionately loving his OOP. Then I saw a prolog and then fell in love with logic programming. Now I wanted to combine.

Question: Is there such a wonderful language that combines both paradigms?

PS In my opinion, such a language would be ideal for writing strategies / mini artificial intelligence.

PPS has just realized that I want Java, into which they pushed the logical. Although it is ideal.

  • 3
    @danpetruk what did such a bad thing to you made functional programming / programmers, that the mere presence of the OP already makes the language non-kosher? And, as I understand it, your blacklist includes not only python, scala, lisp and f #, but also javascript, and perl, and c # like. Heavy to you. Well, as for your question - Google to help. google.com/… - alexlz
  • 2
    @alexlz> haskell is not a logic programming language (i.e., it does not solve equations itself). This is for you to wolframalpha.com - he decides. > that the mere presence of the FP already makes the language non-kosher not everyone can master the FP with a hitch. In my opinion, FP languages ​​and ordinary (C ++ / Java) are both Russian and Arabic. That is, you need a little break the brain. - KoVadim
  • 3
    @KoVadim Imperative programming - the programmer sets the sequence of actions that should be performed to get the desired result. OP - the programmer sets the expression (the elements of the first order of which may be functions), a cat. calculates the result. LP - the programmer sets the system of logical equations that the system must solve in order to get the result. About breaking the brain, remember how you learned to program factorial computing. From formula n! = n * (n-1)! We had to break the brain. The brain was broken. In FP, you need to restore the original state. It's not easy - alexlz
  • 2
    For me, the recursive calculation of factorial was absolutely normal and understandable. And the brain did not break. In the FP like (recursion) is used at each step, so after factorial nothing needs to be restored. As for me, judging from the definition of OP and LP - LP is a special case of OP. - KoVadim
  • 2
    @danpetruk, Prolog and AI (aka AI). Remember the Japanese project of computers of the 5th generation in the late 80s? And where is he now? @VladD, right. All such things even at the modern level of iron are just toys. They cannot “grind” sufficient data sets for practical purposes. - avp

4 answers 4

Why not use Prolog implementations for Java?

  • one
    @avp and after all once the pearl strongly overtook the python in popularity. And the Python team at every convenient and uncomfortable event commemorated the MS Merchant Server, originally written in python. But it was in the last century. And the PLO, as it seems to me, came very well in order to justify the abundant overfeeding of the industry with finances. An example of a process from Khazin is yahoo, the ratio of capitalization to profit is about 1000 in the 90s (that is, if you buy a share, you will receive dividends on the amount of the purchase for 1000 years). But that's another story. - alexlz
  • one
    @alexlz (the limit is over in that branch, I am writing here). Scala - c syntax, support for java libraries + is executed in jvm, community, 95% of the language - oop - kandi
  • one
    @danpetruk about Scala - where does the quote come from? And yet, what about the "mozart language" and alice? - alexlz
  • 2
    @danpetruk, about the fifth generation here . In general, Google on computers of the fifth generation, Japan gives a lot of links (I think, to a similar English request there will be even more). And here is another interesting article in the topic: Programming Languages ​​in a Hundred Years . - avp
  • one
    @avp Who knows what will happen in a hundred years? In 2003, Graham expressed doubts in the spread of parallelism, a little later the electronics rested on the barrier and the situation changed, in the future, perhaps the barrier will be somehow overcome or bypassed ... - alexlz

@danpetruk , and you do not think that mixing all (albeit some) paradigms in one language is not very good.

If you look at the programming history, you may find that the languages ​​into which you tried to shove everything and there were more (for example, PL / I, algol-68, yes the same ada), but in fact died.

Probably the most correct solution is to write different parts of the system (a large program) in different languages. Each part on the one that best fits. Moreover, you can try to build a really distributed system. And the most difficult question here is the connection between them.

  • one
    @avp what, ada died? And when? He seemed to have blown up Arian, but that he himself died - I did not read. By the way, the first internationally standardized language of the PLO. - alexlz
  • 2
    @alexlz, I admire your erudition! (is this it?) - About death. Not sure that this is true, but at least some numbers. Well, right in the camp of the former potential enemy, I am sure the situation is radically different. - By the way, are there many people who wrote at least a couple of lines on Hell? I did not write. Only one of my friends, about 25 years ago, played a little, and then spat. Said, the language is not to write , but to describe the software. - avp
  • one
    @avp well, not so detailed. It's hard for me to remember, and in Google I did not find such a place, but for some reason it seemed to me that the issue was discussed in comp.lang.ada at the beginning of the century (I repeat, Google did not find this). And they called the reason that the program was taken from Ariane4, but some constants were in the code. And the engines on Ariane5 more powerful. But where can I get this from? And about the use - so take a look at this group. More about "25 years ago." There were two standards, the old one (ada83) and the new one (ada95, if it didn’t appear even newer). Certificates for ada83 translators expired in the last century. - alexlz
  • one
    @alexlz, which group to look into? That Pentagon project - I know. I think in Honeywell (and a bunch of other companies) on it and now they write. And here the standards of different years for compilers are not understood. The essence of the language and its environment has not changed. Yes, now OOP was added to hell (to be honest, I did not identify with details). - Regarding a living language or not, I think so. If the language is actively used by all new and new programmers, then it is alive. And if "senior lieutenants" write 3-5 years on it after paid uni, then it is rather dead. - avp
  • one
    @avp newsgroup comp.lang.ada groups.google.com/forum/#!forum/comp.lang.ada Regarding certificates. I do not remember what it is called now, but ada compilers have been certified. Those. should have passed a set of tests for compliance with the standard. Passed - get a certificate. For ada83, the validity period ended in 1998, and in 1999 — I don’t remember. With ada95 it is a little different - there is a kernel and there is a set of add-ons - annexes. How it is certified - as I knew, I forgot. As for the use - I do not know, see for yourself. By traffic group. - alexlz

If you want to mix, there is a trend like DSL. You can write the necessary functionality (clean) specially for yourself, here Parus is great for constraints, for example, but you can do anything for yourself. A short report recently listened to https://www.dropbox.com/s/nwe567bmj8lbqdr/TechTalk%2311%20-%20Demedetskiy%20-%20DSL%20creation.pdf?dl=0

    Question: Is there such a wonderful language that combines both paradigms?

    You would like the object-oriented language Logtalk .

    It is a superset of the Prolog language .

    Currently, it is implemented as a preprocessor using one of the Prolog versions as a backend compiler:

    • SWI Prolog
    • XSB-Prolog

    • YAP Prolog

    • GNU Prolog
    • JIProlog
    • Sictus prolog

    and others, including commercial versions of Prolog.

    It is also worth looking at

    http://plo.sourceforge.net/