Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Prolog > SQL

Name: Anonymous 2018-10-09 22:09

This is a fact of life.

Name: Anonymous 2018-10-09 22:14

relational databases are for boomers

MongoDB is awesome, it's like a database in javascript form

Name: Anonymous 2018-10-09 23:45

>>2
awesome ... javascript
/polecat kebabs/

Name: Anonymous 2018-10-10 4:19

>>3
more specifically javascript object notation, which isn't javascript per se, but it also isn't boomer sql

Name: Anonymous 2018-10-10 5:22

SQL is the most beautiful programming language. You never have to tell the machine how to do the complex algorithms to filter and transform your data. When have you ever had to write an integer index into something in SQL? Never (unless you were using nonstandard shit like array types which goes against the whole idea of using a relational database). You just describe what you want to happen, and you get it. That's how programming should be.

You can do in 1 line of SQL what it would take a Haskaller a bunch of lenses and monad transformers to do and what it would take Javascript/JSON 100 MB of memory to do.

NoSQL = NoSecurity
NoSQL = NoPerformance

Name: Anonymous 2018-10-10 6:37

>>3
JavaScript is good because people say it's almost lisp and it makes me feel good having wasted 7 months of my life reading abstract bullshite in SICP.

Name: Anonymous 2018-10-10 9:00

>>5
You can do the same thing in Prolog, except it takes 1 line of Prolog instead of 100 lines in SQL.

Name: Anonymous 2018-10-10 13:39

>>7
everything can take 1 line when you strip all new lines

Name: Anonymous 2018-10-10 18:37

Where can I learn more about Prolog?

Name: Logic Programming 2018-10-10 19:43

Name: Anonymous 2018-10-10 19:59

>>9
Here, Prolog is a language based on the first order logic unification algorithm.
Lowercase things are atoms while things that start with a capital are like variables.
gay(nikita).
gay(forzenvoid).
gay(mentifex).

Query: -? gay(cudder).
false.
-? gay(nikita).
true.


iq(nikita, 60).
iq(forzenvoid, 5).
iq(mentifex, 196).

Query: -? iq(R, IQ), IQ >= 50.
R = nikita,
IQ = 60 ;
R = mentifex,
IQ = 196.


Since Prolog is Turing complete you can do all kinds of things that you can do in normal languages, for example: http://kti.ms.mff.cuni.cz/~bartak/prolog/sorting.html

Name: Anonymous 2018-10-10 20:08

>>11

This is just pattern matching with some ordinal extensions.

Name: Anonymous 2018-10-10 20:17

>>12
*First order logic unification.

Name: Anonymous 2018-10-10 20:24

>>11
Thanks a lot!

Lowercase things are atoms while things that start with a capital are like variables.
Just like in Erlang (Erlang probably took this and pattern matching from Prolog)

http://kti.ms.mff.cuni.cz/~bartak/prolog/sorting.html
Definitely looks like Erlang or Haskell.

>iq(mentifex, 196).
I never realized he was such a genius.

Name: Anonymous 2018-10-10 20:26

>>12
You might wonder what the difference between unification and pattern matching is, unification goes both ways, unlike pattern matching.
Also, you can do things like -? iq(R, IQ), gay(R), IQ <= 10.
R = frozenvoid
IQ = 5.

Name: Anonymous 2018-10-10 20:31

>>14
It does not really have anything to do with haskell, but it does have a lot to do with Erlang. In fact, both the Erlang syntax as well as the first implementation of Erlang were based on Prolog.
The most important difference between Erlang and Prolog is that Prolog has backtracking.

Name: Anonymous 2018-10-10 20:38

>>15
Also, you can do things like -? iq(R, IQ), gay(R), IQ <= 10.
R = frozenvoid
IQ = 5.

Now that's interesting! I have a use case in mind: would Prolog be suited for forum spam detection?

Name: Anonymous 2018-10-10 20:58

>>17
Sure, prolog used to be used a lot for early AI systems (it is great for expert systems specifically, but it can be used for other modern probabilistic methods too).
There is this paper https://pdfs.semanticscholar.org/2542/a219af23f79cda6dd9270147d0b9c06d0431.pdf if you are into this kind of thing.

Name: Anonymous 2018-10-10 21:47

Name: Anonymous 2018-10-10 22:03

Name: Anonymous 2018-10-11 9:48

How does Prologue work behind the scenes? It sounds like it does a bruteforce search based on the defined patterns.

Name: Here-we Go-again 2018-10-11 11:47

>>14
>iq(mentifex, 196).

I never realized he was such a genius.

He's not. His IQ before senility set in was (oh gee, how do you do the math for a range?) 145-149, somewhere in there. Do you write 145> IQ <149? When Dementifex arrived at the 101st Ordnance Battallion for his two-year duty station in Germany, the clerk signing him in said, "Now we gotta call up so-and-so out in the boonies and tell him he no longer has the highest GT score [General Technical] in the battalion. Up on the wall was a gigantic poster of Vladimir Lenin, and Mentishmoo with his 149 GT score translated for the battalion clerks the Russian slogan about Lenin: САМЫЙ ЧЕЛОВЕЧЕСКИЙ ЧЕЛОВЕК -- "A Most Humane Human".

But Mentislack had made a careful study of how to do well on tests, so as to score higher than warranted. One time in a history test there was a question, "In what year did such-and-such take place?"

Mentif*x did not know the answer, so he just wrote "yes". The history teacher, Mr. Donald Zech, was so upset by the cheeky answer that he announced it to the whole class with an exasperated shaking of his head.

Name: Anonymous 2018-10-11 12:40

Name: Anonymous 2018-10-11 13:52

>>2
Mentischmuck had a crazy life.

Don't change these.
Name: Email:
Entire Thread Thread List