Programming Throwdown - Prolog
Episode Date: July 4, 2011This show covers Prolog (Programmable Logic), a rule based language based on deductive inferencing. The episode talks about the Zynga IPO, Google+, and types of coders (Computer Scientist, Pr...ogrammer, and Developer). The tools of the biweek are FreeNX, a remote desktop server and client, and Evernote, a note taking application that stores notes in the cloud. ★ Support this podcast on Patreon ★
Transcript
Discussion (0)
Hosting provided by Host Tornado.
They offer website hosting packages, dedicated servers, and VPS solutions.
HostT.net.
Programming Throwdown, episode number 8, Prologue.
Take it away, Jason.
So I got some good news and I got some bad news.
That's the way they always come in pairs.
Yeah, it's true. It's a dichotomy.
The good news is I got a smartphone.
Finally?
It's the 21st century. Yeah, that's right.
I went through this issue where it's like, oh, I want an iPhone.
And it's like, oh, wait for the next iPhone.
And then, oh, wait for the next iPhone.
And, you know, it's just perpetual paralysis.
But I got to the point where, you know,
with moving and needing a new number and everything,
I felt like it was time to abandon my feature phone
and go smartphone.
And I'm loving it.
I think it's awesome.
I love, I'm totally geeking out with it.
The other day we had to walk to the post office and we go there constantly.
But I used Google Maps and it kind of like gave you walking directions and you could see yourself in your phone.
Yeah.
See like a top-down view like you're playing Pac-Man or something.
This is the honeymoon period.
Yeah, that's right.
You're an expert on the smartphone, right?
No, I'm not an expert.
But, yeah, I remember first getting one and you're like, and you get all these apps for it and all this stuff.
And then eventually it kind of lulls out, and you get bored of it, and then you kind of settle into a good routine where you're not overusing it.
But it sounds like probably maybe too nerdy or overly dramatic, but I feel like it changes how I do things. Like I look up stuff today. I was at the mall with my brother and my wife and my brother,
uh,
asked,
said,
what is this?
Or something?
Some shirt had some phrase on it.
We didn't know.
So I just looked it up.
I'm like,
not going to wait.
I would have only forgotten.
Now I know what it means.
It's useless,
but one cool thing we did,
I was,
we were at sports authority and,
we,
uh,
we're looking at sport watches cause we've been doing a lot of running lately, my wife and I.
And so there was this one sports watch, and I took a picture of it with Google Goggles and found it was cheaper at Kmart.
Yeah.
Be careful of doing that.
So I do this all the time.
Amazon has a barcode scanning app app and it'll tell you the price
on amazon or anywhere else and i got amazon prime so i get free shipping always in two days that's
pretty good right so yeah if you're that's one thing sorry to interject but if you're a high
school or a college student and you have an edu email address you can get amazon prime for free
so definitely yeah you should do that also i think uh caregivers like stay-at-home moms and something i don't know there's a bunch. Also, I think caregivers, like stay-at-home moms and something.
I don't know.
There's a bunch of people.
I don't know how many stay-at-home moms we have listening to our podcast.
I don't know.
Hundreds.
Hundreds.
Okay.
Thousands.
But yeah, so you go to the store and you're looking at something on Amazon.
So that's great because you're saving money, right?
Like I'm just going to order it on Amazon or even right from my phone and get it in two days and that part's not bad that's good okay the bad part is
sometimes you want to buy it or you need to buy it because you need it kind of right then
for something but you see the reviews and if you look at the reviews for like you know half to
three quarters of stuff in the store like going through target or walmart or kmart or whatever
or like that watch right you scan it and you look at the reviews online and you'll find out it's terrible.
And then you won't buy it.
And in the end, it wouldn't have, well, maybe a watch is a bad example, but like a t-shirt
and it's like, oh, this t-shirt, you know, starts to lose threads really fast.
It's like, you wouldn't normally care.
But now because you see the reviews are two stars on Amazon, you don't buy it.
Oh, I see what you're
saying i think that on the the contra is the opposite is also true though i noticed that like
a lot of mom and pop restaurants that yes same thing you know they always say that like the
like the ugliest looking mom and pop restaurants have the best food but it's like at the same time
it's like you know it's like you never know what you're gonna get and you can't really sue them
for millions if it's just a mom pop restaurant so they have less on the line than like a like you know it's like you never know what you're gonna get and you can't really sue them for millions if it's just a mom-pop restaurant so they have less on the line
than like a mcdonald's or something which has to cook your food right you know um so but but yelp
really helps there are other apps you know they if you find a place that's rated really well or
a place that's rated really poorly it could really influence your judgment well but at least the same
analysis paralysis because you'll be somewhere and there'll be no good reviewed restaurants around.
So you won't.
It's like, where do I go?
There's nothing good.
So you'll like drive really far to go somewhere that's good, even though it's really not that.
I don't know.
It's just about being unique because people on Yelp, for instance, will pan a McDonald's or a Quiznos because it's a chain restaurant and they prefer independent restaurants over chain restaurants on average.
That's my opinion.
I have no idea if that's true.
Yeah, definitely.
I think that there is like – there are – what's the word?
Biases.
Yeah, exactly.
There is an inherent bias to the people on Yelp and on these sites,
especially people that review them, not so much patrons.
But I feel like as the barrier of entry to reviewing things goes down like as like for example you have your smartphone and it has a gps so it knows so it could even just be smart enough
to know you went in a restaurant and came out you know and know that you were there for an hour and
just say hey why don't you write a blur about this restaurant and uh as it becomes that easy i think you'll get a more diverse population doing reviews but as it is now
yeah a lot of kind of hipster people who you know are really against the man and and chain anything
a lot of those people are the ones doing the reviews yeah i actually saw so this is really
interesting thing too and we didn't have this in our news but
it is is interesting so i'll talk about it now where uh they did a study saying people are really
well i guess it's kind of like people are really bad at predicting what they're going to want in
the future so uh they were taking for netflix if you ask people like you can build a queue in
netflix and these are the movies i'm going to watch in the future and you'll put like all these highbrow movies on like artistic independent films but then if it actually comes
time to watch a movie you watch like stupid silly movies that you just want to watch to have a laugh
and aren't serious and don't make you think because but in the future you think you're going
to be like a smarter person you're going to read these fancy books and watch these you know really
intelligent movies but you don't end up actually doing that and it's the same thing i
think happens on yelp where people want this idea of eating these nice restaurants all the time
but in reality most people just end up going to mcdonald's and quiznos and subway because
you just want something you know what you're going to get yeah because if you think about it
planning in general like planning ahead and thinking about the future is is kind of hard i mean that's like that requires like a lot of computation that gets
into the like the area of the brain that does like really hard complex stuff and so probably when
you're in that mode you're more apt to like look at something intellectual but then the spur of the
moment like oh i want to watch a comedy kicks in you know like an interrupt or interrupt or something. And so, yeah, you're just not accounting for that.
So welcome to the world of smartphones.
That is good news.
Maybe now you'll be able to send the emails a little quicker and be pestered all the time with interruptions.
Yeah, definitely.
So you said you had some bad news too?
It's been pretty awesome.
Yeah, so the bad news.
Am I going to cry?
I need to get tissues.
They installed a bike rack in our complex, which I thought was great.
That's not bad news.
Yeah, I left my bike there.
And after two days of leaving my bike there, it was stolen.
Someone had cut the...
Yeah, the bike rack was inside of our garage, which requires like a clicker to go in and out of.
So our hypothesis is that somebody just kind of snuck in behind a car.
And then, you know, once you're inside, you can easily get out.
So they just snuck in and took our bike.
You know, I bought one of those cheap chains.
It's just like several steel, you know, threads that are kind of woven together.
And so they just cut through that.
Did you see it?
Did it get picked or did they just cut it?
No, they cut it.
Yeah, they cut through it.
So, because I had like, it was a frayed end, you know, they left the chain there.
Well, that was nice of them.
Yeah. So, you know, it really sucks, but this is actually brings up a really interesting point.
See, I just bought the bike and I paid with my credit card.
And so most, you know, just about any credit card out there will actually
has an automatic purchase protection insurance. It's free. You don't have to pay for it or sign
up or anything. It doesn't cost any money or anything like that. And if something is lost
or stolen or damaged within like, I think it's a hundred days, your credit card company will
actually reimburse you.
So you can actually – you could buy – let's say you bought – let's say we went and bought this watch.
We paid with our credit card.
And we throw the watch off a bridge.
Well, be careful.
I don't know if you actively throwing it away might change things.
Yeah, I guess you can't be that bad.
If it fell off and got crushed.
Yeah, if it fell off your wrist off a
bridge or yeah i get crushed under a car or something even though it's it's uh an accident
and um even though it's like technically it's i guess it's nobody's fault but i mean the fact is
it's not um you know the manufacturer's fault or anything like that um they'll still refund you the
money so i have another friend that this happened to. He bought an Xbox and someone actually broke in his house and stole,
well, they stole his Xbox and his TV.
But because he had bought the Xbox within 100 days,
he got reimbursed for that.
So if ever something like that happens,
definitely take advantage of that.
Well, at least check.
It's worth checking then for sure.
Yeah, yeah.
I mean, we had to file a police report and you know a bunch of other things so um you know it's not just
a uh what's the word i guess it's not a panacea it won't cure all your problems but yeah it's not a
free pass that's right yeah but it's definitely something good to know so that you can check on
it if it ever happens to you which hopefully yeah yeah definitely keep that in mind so i'm kind of
glad that uh whoever had
that intention was quick about it because if they had waited another like month or so then i wouldn't
have been able to use this option so so yeah it kind of sucks but uh you know i can uh i have my
wife's bike that i can use to get to work and it's pink and has a little horn and those little
frill things outside it has one of those baskets because she
uses it to go to like to the supermarket and stuff oh so yeah it has a basket it has this
like really like soft flat cushy seats powerpuff girls on the wheels i guess your wife isn't like
oh i was gonna say a really young age but that would sound really bad so anyways
she she uh it is green.
It's kind of like a green mountain bike.
So she's not a girl to girly girl,
which is nice.
It's not like the pink DS that I have to put up with.
Um,
but,
uh,
so yes,
that's the bad news.
So are you doing anything cool for 4th of July?
Yeah.
So by the time people are listening to this,
we'll already have done it.
So future me in the past is doing has done that's
right uh yeah i already hang out hung out with uh some my in-laws uh yesterday so that was good
and i had a good time there we played some board games uh wits and wagers which is fun and we
played some we uh which my grandmother came over and she beat me at some of the we games uh which
is really embarrassing ones i never played before so i didn't really know what I was doing. And that's just an excuse.
So she's really old and she beat me. So if you're listening, Grandma, congratulations again.
I'm still mourning that loss. And so that was a lot of fun. And then we had some barbecue.
And tomorrow going over to my parents and grandparents and uh probably do some
more barbecue and hanging out maybe we'll play some board games and stuff so uh i don't think
we're doing any fireworks or whatever i used to be really into that when i was younger uh even
though my parents said it was kind of like burning dollars and i might as well just like money on
fire they were pretty harsh about it uh anyways but yeah we used to do crazy stuff like make napalm and we used to buy
the magnesium strips and make fireworks uh yeah nowadays you probably get in trouble with the
patriot act all that stuff but uh oh that's true it's true you know nowadays things have become
very tame like i uh i went to get a chemistry set for my cousin's kid it's his birthday
and uh it actually advertised that you could eat everything
in the chemistry set that was a good thing yeah it's like everything's edible and i'm like what
you know i had a chemistry set when i was a kid and it had wool stuff for example stuff to make
fireworks and i'm pretty sure that stuff's not edible so things have become much more tame so
it's kind of a sad thing i know you can still do, at least in Florida, they still have model rockets, so that's kind of cool.
Yeah, I think they have that here.
But I know that's quickly kind of fading away too, which is kind of sad.
Yeah, it's a shame.
What are you doing for the weekend?
Oh, so we're actually going to go into the city.
We're going to go to San Francisco, and we're going to see, they have a firework show and, uh, we're probably gonna try
and, uh, you know, grab some food and check out the, uh, museum of modern art and stuff like that.
Oh, cool. So I guess we should explain for anybody not, uh, from the U S who's might be listening,
since I like to think that we have listeners who are international. Um, yeah, for sure. But yeah,
so 4th of July is, uh, the independence of the of the U.S. from the rule of Great Britain.
And so on the 4th of July, we celebrate that typically with like fireworks and a day off of work and grilling and barbecuing, that kind of stuff.
Yep, if we have any listeners from Canada, this is the equivalent to 1st of July or Canada Day.
Yep, that's right.
But yeah, it's basically a chance
for everyone to get together they shoot off some fireworks you um get a chance to sort of uh uh be
appreciative for like all things that we have you know this is one of the things that we were talking
about today it's like the um it's true that like you get good things and bad things happen like the
bike getting stolen things like that but overall, I feel like we're really lucky.
And one of the things that makes this place so lucky is that you have open access to technology.
You have geeks like us who will tell you about programming.
And you have Wikipedia and the opportunity to learn just about anything.
And no one's stopping you from learning anything you want and from being as eclectic as
your capacity
so yeah definitely go out there
and have some fun and celebrate
yeah definitely thankful for all of our soldiers overseas
you know protecting our freedom this time
so I know there's some controversy
there sometimes but definitely supporting
the people who are out there you know in harm's way
so yeah I mean you know
different people have their out there you know in harm's way so yeah i mean you know different
people have their opinions on you know what is worth risking life for and things like that and
with all that aside uh anytime somebody puts their life on the line for anything it uh uh you know
it's something that should be taken very seriously and there's a lot of people who are putting a lot
on the line to you know keep a lot of this stuff going.
So news.
Yeah, so on a lighter note.
So I guess the first news article is one I put in there.
And I guess it's not really news.
Maybe I should have shifted that farther because now this is going to sound silly.
Anyways, but this is an article I read.
I guess it actually came out a couple weeks ago.
Or at least I saw it a couple weeks ago um or at least i saw it a couple weeks ago and uh it was talking a guy writing about the difference between a developer a programmer and a computer scientist and hopefully
i'll get this part right but it's the idea that that was kind of interesting and his his thing
was that a computer scientist and he was saying that all of these uh categories these classes
are necessary uh the computer scientist is kind of the the guy who's
out there thinking about things he's really math oriented he proves out whether something's optimal
or not he has elite math skills but in leet speak he has 31 337 math skills yes that's awesome
if nothing else everyone should read this article just for that that's pretty epic uh and then uh a programmer is kind of the step down somebody who's still you know into the
architecture and the you know higher level programming they're very efficient at things
they may not know how to prove it uh emphatically guaranteed that this is the best but they uh they
know about how it is and they've got kind of maybe one or two areas where they're really really experts at and they're good at
everything but you know kind of key then a developer who I guess it might I might
change this and say kind of coder but a developer is actually a little more
higher than what I would consider just a coder but a developer is somebody who
writes code but they're kind of like a generalist they just work and they're
really good at the art of writing code as opposed to, you know, necessarily the algorithms or data structures.
And so they're more used to working with like maybe frameworks and the glue code and integration of stuff and kind of testing.
And so he is saying that, you know, there's always these three different classes that, you know, they're kind of related, they have a lot of overlap.
And it was just kind of an interesting thing.
It made me think about, yeah, you and I have had this conversation before about the different classes of people in the programming world and about how all of them are necessary.
But some are probably considered more highly than others.
Janitors are really important.
We really need janitors,
but people don't always give them
the respect they deserve.
And I think some of the classes
of computer programmers are similar.
Yeah, definitely.
I think that it's a really good point.
And the other part of it
that's really interesting is that,
you know, a computer scientist is,
it's really interesting to think about
how experience relates to this like experience
versus versus knowledge you know a computer scientist could have a lot of knowledge not
necessarily so much experience yeah that's a good point but they're not at the same time they
they need that experience so a computer science with experience is still a lot
more useful than one without even though they're doing a lot of theoretical
yeah and uh so you know same for all of these is that there's just this balance you have to strike
between, you know, getting a lot of these skills, you know, picking your path and gaining
experience in that path, but also having a wide breadth of knowledge.
And I think it's somewhat of that plays into what happens to everybody first day on the
job.
You know, I remember first day on the job as a computer science guy guy you know not not a summer job where i was just uh you know flipping
burgers or whatever but um first job actually you know in the career workforce and you kind of get
in there and you know first few days you're really timid you don't say much uh i'm kind of outspoken
guy and so uh you know after a few days you start saying stuff trying to you
know show that you know what's going on and then for a while you think wow i'm smarter than all
these people and then a little bit more time goes on you realize you probably have knowledge about
things they don't you know newer stuff that they maybe don't know about yet or haven't looked into
but they have a lot of experience that uh teaches them how and when are the best ways to apply those bits of knowledge.
Yeah, definitely. Yeah, I mean, they have a lot of, one key thing of it is that they have many
points of reference. So, you know, you might jump into a project and say, oh, this is going to be a
piece of cake. And then you hit this snag and it really throws you off. The next time you go into
a project, you're a little bit more wary. You know throws you off the next time you go into a project
you're a little bit more wary you know you say oh you know i'm not going to say this is going to
take me a week because there's a chance that i might hit some snag or or you know last time i
hit this snag so this time i'm going to look and see if the future is going to be rocky like if
this can happen again yeah and if there's a chance that it can happen again i'm going to make sure
that people know about it you know there are things that you can only learn from
from learn the hard way i guess yep yep school of hard knocks that's different yeah that's right so
i should apologize my voice sounds a little bit funny uh i've been getting over being sick so i
apologize i thought it was all the clown training that too uh but riding that unicycle and i tripped and ran into one of those
elephant platforms on my trachea it was really bad oh rough but no so i apologize i promise you
can't get what i have over the uh podcast so don't worry you don't have to wipe down your headphones
but anyways yeah it's not a little bit funny you can't contract diseases through social networking although you are very close to
some people and not so close to others yes okay which kind of leads to our next article which is
google's social networking platform google plus google plus what google plus plus oh
sounds like a programming language it does maybe maybe they'll have an api and it will be okay but
i think that yeah next show is google plus plus now i think that um you know google plus is uh
come out and uh you know a bunch of people are getting in on it i believe that they were doing
invites but um yeah it's closed frozen invite yeah i'm waiting in that long line so uh yeah
same here
i guess they're going to reopen invites pretty soon but i did look at a bunch of the like videos
and stuff other people who were in had posted yeah yeah definitely you know one of the things that
is just really from what i understand i've seen a few news articles on it and the big fundamental
thing that keeps popping out is the idea of the circles where it's now, I think the word is asymmetric.
So, you know, in Facebook, it's symmetric.
So if I'm friends with Patrick, Patrick's also friends with me.
But in Google+, it's asymmetric, which means, you know, I could have Patrick in my friend circle, but he doesn't necessarily have to do the same to me. And so I can post to all of my friends.
And when they post to their circles, it may or may not come to me.
This is kind of cool because there's a lot of people who might want to friend you.
And you either don't know them very well or they're acquaintances.
And there's other people who are like your family where if you know you're having a baby or something you'd want to tell them
you know so so there's different categories of friends there might be some people who
who who know you but you don't know them maybe someone you went to middle school
right so like the circles you're tagging people of like what kind of yeah so this way this this
the fact that it's asymmetric i I think is actually a huge bonus. I
mean, for me, the, the thing that killed Facebook was when my grandma requested to be my friend. I
mean, that was kind of the end of Facebook for me. I really didn't, you know, it's like, I can't tell
her no, but now I can't post rude jokes on Facebook. And, you know, it just, it just, it gets
to the point where it's like, you can't really do anything useful.
So that would be cool.
So definitely something to watch.
We'll see how it goes.
I guess they've had a couple of forays, and I know that's a big thing for them.
They want to get into social networking.
And so hopefully this will be different. When I get on, I guess I'll – or you get on.
When I get on, we'll be able to give a little bit more detailed report.
Yeah, for sure.
Say what it's like one interesting thing is um uh historically if you look at things on
at google that have been blocked by the chinese government they've been the popular things like
like buzz didn't get blocked and wave didn't get blocked by the chinese firewall but google plus
was immediately blocked by the chinese firewall
oh so maybe they're like precognizant of uh yeah that's right they're forecasting yeah it seems
like uh if you use google the chinese firewall as a predictive model so i need to create a hedge fund
that has this in mind yeah yeah creative yeah. Speaking of finance and social networkings,
our next news article is Zynga
going for their initial public offering,
which means that they're going to try
to sell stock shares of the company
in order to make some money.
And there's a way for the investors
and stuff to cash out.
But one of the interesting requirements
that the United States has
is that in order to be able to do this,
in order to be able to sell publicly
portions of your company,
to do that, the people who regulate that,
the Securities Exchange Commission,
requires you to release information
in a certain manner and in a certain way
to basically protect the public
to know what they're investing in
and know that
that's been you know kind of regulated in check so people have to they can't lie about how much
money they make or be completely secret about what they do and so zynga filing for their ipo means
they had to release numbers about like how much money they they make where they make it that kind
of stuff it doesn't mean they have to spill all of the details but more details than they have previously and so one thing that was learned
is that they have a special contract in place with uh facebook oh so we should explain i guess
zynga is the company that does a lot of the social networking games uh on facebook and other places i
think now they even do stuff not on Facebook, but like Farmville.
Uh,
I don't know what the other ones,
I actually don't know that I play any Zynga games,
but yeah, I think they have one where like you build a city.
I don't play any of them either,
unfortunately,
but,
but yeah,
they have several.
Yeah.
Yeah.
And I think they have like a,
uh,
like a poker playing one.
They have a whole bunch and their,
their key is like,
right.
Is to have it to where you do better in the game or a portion
of the game is getting other people involved so like you and i both being like friends in the game
means we both do better because of that but it keeps us both playing the game and then to do
like progress faster you can pay money to basically go faster even though the game is
free to play normally right yeah it was actually really
interesting i was reading another article where they were discussing how they reported the income
and because apparently like they had to because the security exchange commission was kind of like
they have all these different very segmented types of income and they actually treated things you buy online, microtransactions,
as actual things. So for example, let's say you buy a tractor in Farmville. So they actually
count that as a capital investment, as if it's the same as if you bought a tractor from
Home Depot or something. So a capital investment versus you paying for a service.
So for example, if you buy ads on Google Ads,
that's a service.
You're paying for them to show you these ads.
But when you're buying a tractor,
even though it's just ones and zeros,
they're considering it a capital investment.
And they've estimated how long people play on zynga um the average user i think they
said plays 18 months before stopping um so yeah i know isn't that crazy so so they basically said
they're leasing you a tractor for 18 months in game but they're treating it as a real tractor
on paper well yeah i guess there's there's obligations that come with that right like
they can't not have the server excuse Like they can't not have the server.
Excuse me.
They can't not have the server that has the tractor on it anymore.
Right.
That's right.
So they're forced to provide the tractor for at least 18 months because they've made this claim on paper and things like that.
That's interesting.
But, yeah, I think that's pretty cool that Zynga's got kind of their tide so closely with Facebook at this point in time.
I've heard the converse as well.
Facebook is alleged to go public soon as well, do their IPO.
And people are saying Facebook makes a lot of their money off of Zynga.
So this is kind of interesting.
These two companies are really symbiotic at this point.
Yeah, yeah, definitely.
I have kind of an interjection news article.
I didn't post this, but I will bring this to everyone's attention.
This is kind of a shocker.
But California, as you know, I moved to the Valley not too long ago.
And one thing that California is known for is having a lot of taxes.
And they've decided to start charging an online sales tax.
Have you heard of this? No, I heard something similar about not people who are associates for like Amazon having to pay taxes on the money they make.
So they just stopped having them.
But this sounds different.
Yeah, basically, if I understand this correctly, and I don't know if it's been passed.
It says passed.
So I guess it's been passed it says passed so i guess it's i guess it's it's done but basically if i
you know as a california resident buy anything online regardless of what state it's in or
anything i have to pay sales tax so um wow that's uh yeah that's really well i feel like i think a
lot of a lot of states have had that for a while um but they just really not been enforced yeah that's
a good point and this one might be also be equally hard to enforce but i think that um you know this
like on the surface your first reaction is you know this sucks because i have to pay more taxes
or whatever but looking at like the bigger picture i feel like this is sort of a good thing in terms of the macroeconomics because the brick and mortar places are really just getting shafted.
I mean, like if Amazon can sell me something for less because they have this distribution network and it's on demand and they have free shipping with Amazon Prime, which we just talked about, there's not really any reason for these brick and mortar places to exist, you know.
But yet there is a reason for them to exist because often people want artisans. So for example,
you might want fresh produce, like you might want, you know, fruits and vegetables from a local garden instead of getting them, you know, through some distribution center in Kansas, you know. And so by not charging online
sales tax, you really sort of screw all of those people essentially, and they can't,
you know, they can't function. So, you know, but at the same time, everyone, you know,
not really too fond of paying more taxes. So it's really a double edged sword.
Yeah, I mean, we could go into this a long long time it's not really the right podcast for it but uh yeah there's a lot of economic considerations and i have actually
kind of a lot of opinions about uh online sales tax or not but uh yeah we probably should punt
on that so that we don't know that's not why people tuned in yeah yeah good point it could
probably take a long time so no that's good what you said it It just, I don't want to bite on that hook.
Yeah.
On a lighter note, I was walking to a grocery store in the area, and I happened upon this sign, and the sign was really fascinating.
Right in front of a grocery store, it's
Site of First Silicon Device and Research Manufacturing Company in Silicon Valley.
The research conducted here led
to the development of the silicon valley 1956 and little did i know but the uh the uh grocery
store right next to my house is the place where the first transistor was built so not invented
but like the first ones were produced or whatever right Right. I believe the guy who invented it, he invented it at MIT,
but then he moved back to Silicon Valley
because he originally went to Caltech,
and he moved back home and built and started this company
that built the first transistor.
Well, that's pretty cool.
Yeah, I thought that was pretty neat.
So if you have a chance and just want to do some light browsing, check check that out it has a whole history of the transfer read about jason's
grocery store yeah are you listed as a notable patron of that grocery store uh not notable
well we should go add that yeah we should co-host a programming throwdown
there's a regular maybe i'll make my own sign and put it right next to that sign it's time for the tool of the
bi-week
tool of the bi-week
so what's your tool
my tool of the bi-week is
Evernote
it's still a tool
it's kind of a service and a tool mixed into one
but it's basically a note taking
thing
note taking program and it's basically a note-taking uh thing note-taking program and uh it's really
nice because it it's supported on a lot of different platforms they have like a one for
your pc they have one for your iphone your ipad you know i think they have over android devices
maybe even your nook i don't know but they have it for a lot of platforms and uh what it does is
there's you know mostly like what a note-taking app should be
you're able to like you know just say hey this note or that note and uh what it does is it syncs
them between so you have like an account and then it syncs them between the different platforms
and so that's really nice that you're able to you know make a note in one thing like i might be on
my ipad using my ipad on a plane and so i'm not
online and i might type a note into my evernote and then um later when i'm on wi-fi it can sync
that up with my iphone and then i can have it on my iphone and then if i get on my computer
and it's like uh you know something i need to look up online i can bring it up and you know
already have it and just copy and paste the search term or the website or whatever
and so that's pretty cool um they also do some interesting things where you can take like
audio notes and uh even you can take a picture of something and have that be the note and one of the
interesting things about that is they actually run like a ocr optical character recognition
and so um when you take a picture of it it'll actually like
try to figure out what the text says so it was a handwritten note or i take it like of a like
a picture of like a price tag or like a sign or something and then you search through your notes
it'll actually return those results oh nice yeah so that's all really cool it's also like a generally really useful uh device to have
um and it's free there is a limit um i think if you use and i don't know what it it's the amount
of documents you store or how many you do per month or whatever i've never hit it and i think
it goes to like five dollars a month or like 45 50 for the year um if you go above a certain like megabytes
of usage per month okay um but i've never hit that so it works really well for what i use it
and it's completely fine here it says it says you have to go over a gig so okay yeah those people
are probably under that so yeah so i think it's one of those things that almost everybody's under
that and just to keep people from abusing it. But, you know, some people choose to support because it is so useful and so cool.
So some people choose to go ahead and use it anyways.
Oh, the other thing is it does like a geolocation.
So when you write a note, you can see where notes were written, which is kind of cool.
Oh, yeah, that's really useful.
So it's like you find a restaurant that you really want to go to, but not that day.
You can just make a little note.
And then later on, you can have directions to it or something.
Yeah, maybe it'll do that.
I don't know.
That'd be cool.
But I haven't tried that.
But it notes where you make the note at.
Yeah, well, I mean like if you're in front of the –
Like you walk by a restaurant and you say, I really want to –
Yeah, yeah.
Yeah, yeah.
All right.
What's your tool? That's pretty sweet yeah all right what's your it's pretty
sweet man my tool of the bi-week is free nx and actually it's more general it's just nx in general
but the the free version is is uh is almost 100 fully functional so uh you can jump on that
and basically what this is is a way to do desktop, but it's a way that's extremely efficient.
So a lot of people have used, you know, the Windows Remote Desktop or VNC.
And the way these programs work is they basically they take screenshots of your desktop.
Or I guess another way of looking at it is they make a movie out of your desktop. And so, you know, as you open Windows and
move them around and things like that, they're streaming a video of your desktop over to you.
And because your desktop usually doesn't change that much, you know, they could do this fairly
quickly and they could use all this compression and things like that. Now, on the other end,
there's something called the X windows system which is the windows
system that unix and linux computers use so you know windows has something called aero which when
you actually move the windows around on your windows computer you minimize and things like
that there's an engine there that's controlling all of that called aero on mac there's one called
coco and coco is handling the minimizing and Coco looks pretty cool.
When you minimize something it like shrinks down into the bottom right on your Mac and that's all done by Coco.
On Linux and Unix machines they have something called X Windows.
And X Windows has X forwarding.
So what it does is instead of sending all of these, instead of sending a video of your desktop, it sends commands over.
So it says, hey, open a window, hey, move this window.
Sometimes it will send pictures, like here's a picture, now put this picture on the window
over here.
But it's mostly, like 99% of it is just commands, text.
And you know, just to put it in perspective a dictionary of text like a dictionary with every
word in the english language and everything it explains would be what would you say patrick like
five meg or something of text um good question i should know this oh wait let's do some math here
let's see so let's say i'll look it up while you keep going yeah let me just take a guess let's
say a dictionary is 50,000 words in it,
and each word has like a 100-character definition.
Then that's just 4 megs of text, right?
So you can write a lot of text for 4 megs,
versus 4 meg is just a handful of pictures.
So X-forwarding is much, better than than VNC or Windows Remote
Desktop but X forwarding has a number of flaws it's very old technology and it
doesn't really support you know modern operating systems and modern you know
with their fancy effects and things like that so if you run X windows it's not
going to look very sharp it's's going to look very dated.
So this NX technology is a completely new protocol,
and it's been implemented in every architecture.
So to do X-Forwarding, you have to be on Mac or Linux.
But to do NX, you can do NX on Windows.
So it's completely cross-platform.
And it's much better than VNC and Remote Desktop and
all these things for the reasons I mentioned. It's just the compression is much superior.
And in addition, it's also secure. It runs over SSH, which means that, for example, let's say
you're using VNC or X-Forwarding or any of these, and you're using a browser inside of a remote desktop
session.
So you're at home or you're at work, let's say, but you're logged into your computer
at home and you're using the internet there for some reason.
If you type in your Gmail password, those keystrokes go across the wire unencrypted.
So someone listening on the wire in between your work and your home, or someone on
your Wi-Fi, if you're at Starbucks or something, can just see your password in plain text. But if
you're using NX, everything is encrypted, so they can't do anything like that. Well, there are a lot
of ways to encrypt to VNC as well, but the default configuration, yeah. Yeah, you can. We shouldn't
allude that anybody using VNC is unsafe.
I mean, there's a lot of ways to get around that.
Right, and the same is true for X-forwarding and remote desktop.
So yeah, I guess that we should add that caveat.
But with NX, it's built in.
You don't have to do any tunneling or anything like that.
It's built from the ground up to run over.
Yeah, so it looks like there's clients for almost everything,
but it looks like the server,
so like what computer you're actually using,
is restricted to Linux and Solaris.
Oh, really?
Is that, am I, that's the website I'm on.
You know what it is?
This is correct.
So free NX server is a Mac, Linux, or Solaris only to use nx server on windows you have to use the paid one
so basically a bunch of nerds made a free version of nx called free nx but they hope they didn't
make it for windows oh but if you get okay this another thing. The people who make the paid version of NoNX,
they have a free version as well, the NX free edition.
And they have, I believe they have a server for Windows maybe.
And, oh, no, they don't either.
Wow, that's surprising.
All right, well, but if it's for a computer that you have,
you should check it out for sure.
Yeah, definitely. Well, but if it's for a computer that you have, you should check it out for sure.
Yeah, definitely.
I mean, if you're running OSX or Linux and you want to get at your computer across the network or something like that. And so it works really well, not a lot of lag or anything?
No, it works extremely well.
It has a setting where you can sort of dial it down based on the amount of bandwidth that you have
and I recommend this is a good point I actually recommend putting it on the middle setting
so even though you know for example going from my desktop to my server inside my own house I had it
on the max setting and that wasn't a problem but I noticed that if I put it on the third setting, the internet usage went down dramatically, and it looks almost exactly the same.
So I think on the highest setting, it's not even compressing the images.
Like, it's just raw images.
But in the middle, it uses, like, a lossless compression.
So you really, you know, have nothing to lose by going there.
Awesome.
There are a couple of threads talking about how there's no NX server on Windows.
Okay, so maybe that part wasn't completely correct, Jason.
Yeah, sorry about that.
We actually said something wrong. This actually is extremely rare.
We usually only say something wrong.
That's a bold statement, sir.
I think this might be the first time.
Oh, shit!
We should have a cake.
We're going to get hate mail.
No, but it looks like...
I think some people are working on NX server on Windows,
but it doesn't look like it's there.
But if you have a Linux server...
And why don't you have a Linux server?
You should definitely be running an X server.
If you're a guy who's been using X forwarding or VNC, definitely check this out.
Yeah, very cool.
I think that's it.
So is it time for a prologue?
I think it's time for some prologue.
So prologue is definitely a computer scientist's language.
So what does prologue stand for? You got to start off. I don't know. definitely a computer scientist's language so developers are programmers here you gotta start
off i don't know i think it stands for programmable logic but i don't i don't think it that's right
yeah i don't think it actually doesn't actually stand for anything no it's yeah for programming
logic yeah but uh that's definitely what it is. And so to talk about programming or to talk about Prolog, we have to talk about predicate calculus,
specifically first-order predicate calculus and first-order logic.
Well, so why did you say it was a computer scientist program?
Are you going to tell us that?
Yeah, yeah, definitely.
It's a bold statement.
Okay, all right.
Yeah, so this is going to be pretty geeked out but we're gonna
you know break it down and we're gonna to to you know explain all the details but there's something
called well first there's something called logic and logic comes down to many different things but
but one of two of those things are deductive and inductive reasoning so can you give me an example
of inductive reasoning so inductive reasoning is
building up from something smaller right so like inductive reasoning would be like dogs have oh
that's a bad example i'm trying to think of an example that's uh that's gonna always be true
and not just in a restrained example but uh i only go outside when it's raining. It's currently raining. So I go out.
I only go outside when it's not raining.
It's currently raining.
So I won't go outside.
Did I get it right?
Yeah, kind of.
That's kind of.
That's a bad example.
Do you have a better one?
Yeah.
So, for example, inductive reasoning is essentially guessing.
So let's say, for example, okay, I live in Silicon Valley and it rains like 0.1 centimeter for the entire month of July.
Like it never rains in July statistically.
So that is an inductive statement.
So, you know, it has rained in July
at some point, you know, maybe 25 years ago or something, but it's so infrequent that I induce
that tomorrow it's not going to rain, which is, you know, it can be wrong. It's not, it's not,
you know, 100% true, but I'm making an assumption. I'm inducing that it's not going to rain tomorrow
based on all this prior history of it, you know, never raining in July or raining so infrequently.
So, okay, so you're making a prediction about the future.
Right. That would be induction. Okay. Now, deduction is where you
deduce, where you come up with new facts based on existing data but deduction doesn't involve
any guessing so for example um you know uh all mammals have hair and patrick and i are mammals
last time we checked and so therefore we did we deduce that we have hair because we are in the set of mammals,
and anything that's in the set of mammals has hair.
So, you can think of this as like a transitive property.
Like we are in class A, and class A implies fact X.
Therefore, we have fact X.
Yeah, that was what I was doing.
Your deduction.
I messed that up.
I got it wrong.
Yeah, no worries.
Tell me I was wrong.
All right, second time.
Crap.
In one episode. In one episode, man. Sorry. What the heck? All right. deduction i messed that up i got it wrong tell me i was wrong all right second time crap in one
episode in one episode man what the heck all right so anyways uh so from this you can deduce that i'm
never wrong and patrick is wrong twice you have to induce about it but you could actually i was
wrong the first um so uh so okay so now we have deduction first order logic is based on
deduction so you might say the mammals example would be fine so to explain the
mammals example in first order predicate calculus you would say for all X where X
is a mammal and then you draw an arrow which means implication that implies that x has
hair or has hair as a function with x in parentheses so if the has mammal function can run on x is true
on the variable x then the has hair function is also true on the variable X. Does that make sense? Yeah. Yeah, so that's first order predicate calculus. Now you can, then
you can say, let's say X is Patrick and let's say is mammal Patrick is true. And
this, if following first order predicate logic, you can deduce that has hair, Patrick, is also true based on the law that we set up, the inference that we set up.
So with all that said, Prolog is a programming language specifically targeted at implementing first-order predicate logic and doing deductions.
So what does the first order
means there it means you don't make two jumps in conclusion it means you just make one is that what
the first order means um oh i used to know this let me know it's okay well here you you could
talk about maybe the history of prologue and i'll look up second order logic. So Prologue's actually pretty old. It's not new.
It's been around for a while, since the 70s.
It was invented by a guy named Alan,
oh, I'm going to mess this up,
Cole Moreau and Philip Roussel.
And it was, I think it was really, like you said,
it's a computer scientist paper.
So I mean, there's a lot of people kind of doing
this kind of logic and this kind of reasoning and saying that computers should be as well and so
somebody actually finally came up with the idea of having this this programming language to
implement it this way called prologue and they were able to do that the first ones were you know
we talked about this about more early, early it was an interpreted language.
Later, you know, kind of people were able to figure out ways
of actually like doing more compilation type stuff.
And it kind of grew over time.
It's been around.
I mean, it's still used a lot in universities and stuff.
And it's never really faded away and kind of gone away like some languages do.
But it's never really gone mainstream, I don't think.
I mean, it's never had a time when it was the most commonly used
or even a significant portion of programming was done in it.
Yeah, I mean, there was actually a time when,
and there's some people to this day who believe that
first-order predicate logic is the key to sort of unlocking
all the mysteries of the universe.
And this was sort of the key to reaching human level intelligence so people in the 60s and 70s really believe this
and um you'll find guys like minsky and whatever that still kind of believe this they're very kind
of set in their ways and but you you ever see like you know space odyssey 2001 that movie with hal
the robot? No.
It takes over the ship. Go ahead.
But yeah, basically in the 60s and the 70s, in fact, several famous computer theoreticians are quoted as saying,
we'll have human-level intelligence within our lifetimes implemented in the computer.
And so there's a time where people believed that deduction and induction were the key to getting human-level intelligence.
And, of course, now we understand that that's not the case, that knowledge itself involves very high-level structures.
And this sort of gets us on a tangent. engine. But regardless, during that time, you know, prologue and other predicate languages were
extremely popular because, you know, a lot of people with a lot of money believed that they
were going to get human level brain like intelligence from them. But yeah, since then,
it's really kind of died down in popularity, but they do have their applications.
So that's interesting. So the knowledge thing now, we should kind of point out here that your background is in artificial intelligence. So this is right up your alley.
Not so much up mine. So if I sound like an idiot, because I am on this topic.
It goes both ways. Like with assembly, we were definitely asking you how to add.
So showing the strengths, everybody has their kind of strengths. So this is up your alley. But
now I know a lot people talk about expert systems
yep how does that tie into what you're talking about about knowledge and about people trying to
to be as smart as humans or have computers be as smart as humans so let's first let's talk about
the answering your question from before first order versus second order yeah so second order
so first order logic all the variables are either all or or um or one so in other words
i could say uh if if any person is a murderer in the room then everyone is a suspect so it's like
i don't know who the murderer is but there's a murderer somewhere in this room everyone is a
suspect okay um you know once you get to second
order logic then you get into things like sets so in other words for all people who are the set
of people who went on this trip then like those people could be murderers you get into just really
complicated it's called neutrosophic so it's based on uh you know heuristics based on heuristics but
probabilities so in other words for everyone who went to the giants game half of them
experience this and so now you have this bifurcation you have this set so second order
is very complicated and and very limited um but first order is really kind of where it's at in terms of doing things that are
practical. So what was your second question? My second question was expert systems.
Right, expert systems. So by definition, expert system is one that uses deduction and different
rules to create a lot of facts this is this is the core of an
expert system so prologue is the core of an expert system or the deduction reasoning yeah i missed
what the this is oh oh right right so for example um you might think of a medical this this is this
is a good example is medical uh you know not guessing but medical diagnosis okay so
for example you might have you seen these flow charts where it's like um you know figuring out
what illness your kid has like if your kid has a runny nose but then on webmd that happens on
webmd if you go on webmd it says click on the body part where the problem is yeah so it's like
so if your kid has a runny nose then it asks you another question like does your kid have
rashes and if he does have rashes then he has this disease if not then he just has a cold or
whatever right so so this is an expert system where they're collecting facts you can think of
this in first order predicate logic so in other in other words, there's a first-order predicate rule that says, you know, if X,
so if the function runny nose for X is true and the function rash for X is true,
that implies that the function, I don't know, has measles is true, right?
I'm just making these up.
Don't ever diagnose your kid with this podcast.
This is not medical advice.
Yeah, so that is an example of, you know,
a set of rules in first order logic.
And then going through and saying, you know,
hey, Johnny has a cold and Johnny has a rash.
And then traversing through these rules
to discover that Johnny has measles is true,
that is an expert system. Okay. Now, there's two ways to implement an expert system.
One is through forward chaining, and one is through backward chaining. And so we'll talk
about both of these. Backward chaining starts at all of the goals and goes backwards so for example
going back to our so let's start with forward chaining because that's that's
easier so with forward chaining you would take let's say let's make this a
little bit more complicated if somebody has a runny nose and or if somebody has measles and they have uh i don't know constipation
then they actually have something else they have avian flu let's say so you put in the facts you
know johnny has measles he has constipation or no sorry johnny has a runny nose uh he has what
was the other thing for me oh he has a runny nose
he has a rash and he has constipation those are the three facts that you put into this web md this
expert system and it goes forward and it says hey if johnny has measles therefore he and he has this
uh this other thing then he has avian flu but it doesn't know that johnny has measles yet
because it hasn't inferred that yet that's a different rule so it skips that rule says well we can't apply this rule yet all we know is
that johnny has he has a cold he has a rash and he has constipation he doesn't have measles yet
so skip it so it goes to the next rule and it says does he have a cold and a rash oh he does
therefore he also has measles right got it now has four things. So then it goes back over again through the rules.
And when it gets to that rule where if he has measles and constipation,
that rule also fires.
And then now he has the avian flu one.
So that's forward chaining where you're taking your facts
and you're finding how many of the rules fit,
creating new facts based on those rules,
and then just repeating this process.
The problem with this is, you know, the rules might explode exponentially.
So you might end up inferring just tons of things which might have nothing to do with what you want.
So for example, let's say you wanted to know, does Johnny have Davian flu?
And you don't care if he has measles or not. like you just want to know this one answer to this one question you could start there and go backwards
like you could say john somebody anybody not necessarily johnny but a person has the avian
flu if they have these two things which was measles and constipation and then you could say a person has measles if they
have you know cold symptoms and a rash and you could take the cold systems and the rash and
substitute the measles with those two things you see what i'm saying so you're kind of going
backwards and substituting things in and you're generating this one like mega rule seems like
you're going doing less work that way too you don't have to go through all the rules trying to figure out if they apply.
Yeah, yeah, definitely.
So, you know, backwards chaining works when you want to find one answer.
And forward chaining works when you want to just figure out what answers are out
there.
And so as you can imagine, you can make tons and tons of rules.
And people did this.
There's something called CYC. let me see what it stands for uh it's called open cyc
uh it's just called it's just called uh cyc technology anyways basically what they did was
they generated tons and tons of rules.
And you can go to opencyc.org.
You can actually download the rule database.
And these people actually got experts in every single discipline and generated millions and millions of rules.
I mean, this was in the 60s and the 70s when people thought that they were going to end up with a brain when they finished this project.
And so literally, like, they called ballerinas, famous ball famous ballerinas and they said give us facts about ballerinas and they would say well ballerinas
have strong feet and strong legs ballerinas can jump high you know they just kept loading the
system full of facts and then it's almost like if you've ever read hitchhiker's guide to the galaxy
right they just load the system full of facts and then the expectation is you can say you know uh you know should we increase the taxes or should i should i have
should my wife and i have another child and it will somehow use all of these facts and infer
well based on ballerinas and everything else um you know you know you shouldn't have a child or
something like that so i take it this didn't work out so well, because I've never seen one of these machines down
at the store where I can buy one or use it. Yeah, exactly. It turns out that, you know,
as Patrick said, I've, you know, versed history in AI, but, but to keep it short, basically,
predicate logic and rules like these are not the way that knowledge is stored in your brain.
It's much more, it's much less opaque, right?
You know, I mean, think of like a floor, like when you do navigation around your house or
your office or things like that, you don't have a floor plan.
Like you don't really know the thickness of the walls in your house, if you think about
it, or the distance, you know, from the wall in your house if you think about it or the distance you know from
the wall in your bedroom to whatever room is on the other side the thickness of that the distance
of that between 18 feet 6 inches 18 that's pretty thick wall man you have another room there but uh
but yeah you don't know this right so it's the way that you navigate in your house is much
cloudier than that and it doesn't really use rules so you don't know
in advance what you want to know well that's that's another thing true right that's another
thing is that you have to sort of learn on the fly and you're constantly generating generating
these rules and tearing some down and using second order logic you know some of the rules
you know might exist but you're not sure so other words, if you see a ball falling to the ground and it looks shiny and has that kind of like a marble-ish texture,
you're pretty sure it's a bowling ball and it's going to go wham when it hits on the ground.
But if you see a ball that's around the same size but it has bumps on it and lines like a basketball,
you kind of think that it's going to bounce and if if basketballs didn't
bounce over time you would they would train you to think the opposite right so you're constantly
building these these models that are based on statistics not based on logic but nonetheless
prologue is still extremely useful for building these logic-based systems.
Because you think about it, the thing that it's doing is it's searching through all these rules.
It has a bunch of facts.
And you could think of the facts kind of like searching through the internet or searching through doing pathfinding.
It all comes down to sort of exploring your options and finding out what the future is like and what other options are out there. And Prologue has a sort of a built-in search engine
that is extremely, extremely optimized. So because of that, it is very useful.
So it sounds like there's almost two phases here. I guess it's a little bit different than
most programming, but you got one where you're kind of building up these statements, these truths, this knowledge, and another one where you're querying it for something.
Yeah, exactly.
That's a huge part of it.
So, you know, Prolog is, it's all about, you know, generating the Prolog files with all of your facts and your inferences and then as you said going through later and
saying i'm going to give you so i'm you have essentially one thing that makes prologue
confusing to new people is that it doesn't differentiate sort of these permanent facts like
you know if all mammals have hair and things like that from different statements that you make on
the fly like patrick is a mammal or something something like Patrick is a mammal is only useful for that instance where
you're talking about Patrick once you're talking about John the stuff about
Patrick doesn't really matter and so that's sort of the key to all of this
that's something that prologue doesn't quite handle that well which makes it
hard to use but but but it's definitely that's definitely an important part of it and uh one
thing that's important to note of prologue is it's turing complete so i don't know if we really
talked about have we mentioned turing complete yeah i don't know we might need to save that
for for another because that could bear a whole lot of discussion yeah that really gets into but
let's suffice it to say um you can write any program that's writable in Prolog.
Exactly, exactly.
But it makes no statement to how hard or easy it is to write it
or how long or fast or slow it might be.
That's right, that's right.
So, you know, you can actually implement sorting.
You can do file I.O.
You can do anything in Prolog that you can do in another language.
But keep in mind that it's geared to doing this first-order predicate logic.
This gets into something a little interesting, which is the idea of bindings.
And we haven't talked about this either, but I'll just mention it briefly.
Many languages have bindings for other languages.
And so what that means is, let's say I'm writing some kind of application to do an expert system.
Like this WebMD is a perfect example.
So, you know, the expert system part where I collect the facts of the patients and I make inferences of whatever, you know, ailments they might have.
You want that to be done in Prolog because you don't want to have to write your own expert system and see your C++ or Java.
You know, Prolog does it way better than any of us could ever do it.
But at the same time, you're writing an application for the web.
So, I mean, it's going to be done in JavaScript or on the back end in a web server like Python or C++.
So Prolog has what's called bindings where you can create a Prolog environment
and run Prolog functions from inside of another language.
And many languages have bindings for other languages.
You can write C code inside of Java.
There's something called Swig, which takes C or C++ code
and generates bindings for something like 20 or 30
different languages yeah we've talked about this a little bit i don't know if you're set specifically
as called binding but we talked about another language is how easy it is to use them inside
of different ones yeah yeah definitely and prolog is definitely easy to use in fact someone has
implemented a prolog interpreter in python so you don't even have to use the binding.
It's just the interpreters right there.
So is Prolog interpreted or compiled?
Yes, so Prolog is interpreted.
There are different sort of tricks you can use to sort of pre-compute things.
And there's this thing called a cut that you can use,
which gets into more advanced aspects of Prolog and sort of adds more sort of, I guess, preprocessing.
But yeah, at the heart, it's definitely interpreted language.
And if you think about it, the Prolog is, so we talked about MATLAB and how when you're using MATLAB, you might have an operation that says add these two arrays.
And it's actually millions of C++ or C, millions of assembly instructions, right?
But it's all just one line of MATLAB.
Prolog is much the same way, where you're writing these facts,
and then you just say one line, like, you know, do I have measles or something.
And Prolog is doing all this stuff behind the scenes in C or C++,
or as I said, Python has a version.
So it could be interpreted without really any penalty because there aren't many instructions.
So are most of the interpreters commercial or open source?
Yeah, so there is GNU Prolog, which is a open source version of prologue there is a swi prologue which is by far the most popular um that one is an open source but uh it's extremely fast
the the uh the resolution engine is just insanely fast for that one, highly optimized. I think there are, are there any more that you can think of?
There's JIProlog.
I believe there's a PyProlog, or maybe it's called PyLog.
Let me look it up just so we don't make our third mistake.
Oh, it's actually called Pythologic.
But yeah, that's a module for Python that gives you the programming, the Prolog interpreter.
So I would imagine that Prolog is used for kind of things like we've already been alluding to,
like kind of, or were used for like medical diagnosis things.
I know I also saw that they used some for air traffic control stuff,
where there's a lot of kind of rules about how something should be handled.
Yeah, definitely.
I mean, anytime you have a bank of rules.
I know that at university we actually developed a prologue theory creator.
And so this is really interesting.
We input a bunch of theories and observations that were known to be true.
And then it automatically just used its deduction engine to come up with new theories so you know I mean this is I'm
just making this up but if you know that like all I don't know all graphs you
know with this many vertices also have this other property and graphs with this
third property have X vertices therefore graphs with this third property have x vertices therefore
graphs with this property have that property you know just things like that and it would just
it actually came up with just hundreds of new theories and it was really really interesting
and papers were published and things like that and so you feel a little guilty publishing a paper
with a theory that you didn't that you wrote a program to create but then on the other hand we published like tons of theories with one paper so we felt like it was justified
yeah but yeah it's pretty popular in asia right yeah prologue took off big time in asia it's
actually still pretty popular um but other than that it's um you know here in the in the US it's mainly just people use it for geeking out
it was used to create Erlang
so programming language inventors
programming language inventors like Python
I mean sorry like Prolog
again the key strength of Prolog
is that it has this inference engine
that does all this deduction
and it has this inference engine that does all this deduction.
So it has it extremely optimized.
So you know one thing you can think of this in terms of numbers.
It doesn't have to be facts.
So for example let's say navigating a maze.
You might say you know if you are in this spot of the maze then you're one square away from you know any
adjacent spot that you can get to that's not you know blocked by a wall so you can just fill in
these rules you can even write another program that generates the rules that looks at the maze
and generates all the rules for all the you know adjacent tiles in your maze and then you can just say you know i am in this square
is it possible for me to be at the finish line that's actually another thing that we should
mention is prologue doesn't just give you yes or no answers but it also will tell you how it gets
there so going back to like the measles example you could say do i have avian flu and it says yes
but then you can also say well you know
how is that possible you know here are my symptoms how did i how did you figure it out you'll say oh
well i followed this rule and i followed that rule and i followed this rule and then i deduced this
so you can use that um you can use that trail that it left behind um to sort of navigate a maze or to do robot control or many other tasks.
Yeah, people, I remember doing a, somebody did a Sudoku solver in Prologue that way.
Yep.
So all the rules about how to figure out the next number in a Sudoku puzzle.
Yeah, I mean, Sudoku is perfect for this, right?
Because you have different facts like if i have
a one in this row then i don't have a one anywhere else in the same row and so these are all just
facts you can write a meta program you can write a script in python that just generates all the
facts for sudoku and then or sorry generates all the inferences for Sudoku, and then give it the facts, which are the numbers that already exist in the puzzle, and tell it to go, and it will very quickly generate
the solution.
That's the big thing I want people to get out of this, is you can write your own, you
know, inference engine very quickly.
You can just say, here's all my facts, let me just go through all the rules, find out
which ones are true, and then go through all the rules again.
You can do that, but it will take a very, very long time. And I don't want to get into the specifics because it gets really complicated, but basically the Prolog guys
have made this extremely, extremely fast. And their program, if you write it in Prolog versus make your own, you know, dumb inference engine that just looks at all the rules, it will just run, I don't even know, thousands of times faster.
So the inference engine is key.
But Prolog does have some weaknesses.
Yeah.
So this doesn't sound like it would fit, you know, with the way computers work naturally.
It doesn't seem like a would fit you know with the way computers work naturally does it seem like a good a good fit I guess you know you I guess you even have here in the
notes the von Neumann architecture the way computers are now with you know an
instruction instruction line data lines you know registers and a processor and
trying to do you know just streams of math instructions.
It doesn't seem exactly how this would work. Yeah, that's so true. I mean, look at, you know,
the example we gave where you want to check all these rules. Ideally, what you'd want is to just
check all the rules at the same time. Like you don't have to go one rule at a time. You can just
say, look, here are all my facts. I want to check every single rule and find out which of these are true. But like, they don't have, I don't have to check them
in any order. I just want to check all of them. And then now I have a new set of facts. I want
to just check all the rules again. So, you know, think about your brain again. Your brain is
completely decentralized. So in other words, you know, all of the neurons in your brain are all
acting independently of each other and the fact that you know you only
consciously think of one thing at a time or a handful of things at a time is just
because those sets of neurons are sort of dominating but in the background in
your subconscious you're thinking of just hundreds thousands millions of
other things and you're building up millions of inferences, you know, everything you do is adding more to this massive, massive inference engine
that you have and everything you see. So this doesn't really fit, right? You know, the way
computers work now, they execute one instruction at a time. You know, we talked in the assembly
podcast about, you know, cache and registers and things like that.
And the computer can only hold, at the core, 16, 32 numbers at a time.
And it can only operate on several of those and only do one instruction at a time.
So this sort of makes Prolog extremely slow. So this goes against the nature of Prolog,
which is that you have just all these rules and the order doesn't matter.
So if you could implement Prolog on a brain, it would probably run much faster.
But given that computers are the way they are,
the language doesn't really fit with the environment that you're programming in yeah it seems like it'd be hard
like i can't imagine trying to write a gui in prologue oh yeah i mean anything that
requires you to do things in sequence sort of just just is going against the nature of the
inference engine like the inference engine wants to search and it wants to search everything.
And if you want to have a certain recipe,
like let's say you want to take a number,
you know, add 10, then divide by two and then square it.
Well, then you need to create an inference for each of those.
You need to say, okay, here's this number
and it's in stage one.
And if a number is in stage one,
then you add 10 to it. Or if a number is in stage one, then you add 10 to it.
Or if a number is in stage one and you add 10 to it, now it's in stage two.
But it's going to be looking at the stage three and stage four rules
when it implements that one to see if there's anything else that matches.
That's not going to be efficient.
Yeah, it's going to run extremely slow.
It just cannot do things in sequence because of its nature.
And so, yeah, I mean, a GUI or anything that's time-based or any type of matrix math or anything like that
is just going to be just brutally slow and prolonged.
Yeah, and I guess that's not really a weakness.
That's just not what it's used for.
I mean, a weakness yeah yeah we're
trying we're stretching a little here maybe to to say what weaknesses are for those but that's okay
yeah that's true i guess you know to be more broad the weakness of prologue is just that it
has very specific applications yeah that's right it's very specific purpose yeah that's right and
in a way and even in that purpose though it tends to be
slower than maybe desirable yeah i would agree with that yeah i mean in in many of the uh expert
systems something like prologue is almost overkill you know like the web md how many rules do they
really have i mean let's say they have 638 seriously. Seriously? I thought, I was like, man, Patrick's foo is incredibly strong.
His Google foo is epic.
You know, let's say they have 638,000 rules, right?
Now you're starting to approach a space where Prolog is starting to become useful.
But most systems you can just, you know, implement it in C++.
Or, you know, they have different inference engines now in many languages, and so Prolog is, I would
say the applications are just too specific.
Other than geeking out, or unless you're really concerned about speed and you have just tons
of rules, Prolog really has very limited use.
But with that said, it is extremely important to learn Prologue.
Because just understanding, you know, predicate logic, why it's important.
And just, you know, if nothing else, understand, you know, people like the smartest people in the world 30 years ago 40 years ago thought that
prologue would create a human brain and just just let that detonate in your mind for a second you
know people minsky and and and all of these guys thought that prologue was going to get human level
intelligence and just i think just just accepting that that that was the state of things and just i think just just accepting that that that was a state of things and just knowing that
i think is is important yeah well i certainly learned a lot i mean i didn't know a lot of this
stuff before and i'm gonna go write up a bunch of rules and ask the prologue what the purpose of the
universe is that's right 42 yeah i think i messed that quote up a little didn't i uh no i think you got what's
the meaning of life the universe and everything in it yeah that's right that's right we'll get
it right 42 okay anyways that was that was geeky uh do you got any wrap-up notes thank you for
everybody who's been you know rating us in itunes and reviews, and we've gotten a couple more emails. So thank you for all of those.
Continue to do that.
If you want to send us an email,
programmingthrowdown, one word,
at gmail.com.
You can check out our website
at programmingthrowdown.blogspot.com.
I know most people seem to be getting this through iTunes.
But we do post show notes there,
links to the articles we talk about.
Not as exhaustive as could be, but you can also write comments about an individual show.
Yeah, definitely. I think that, you know, once we get our invites for Google+, we can,
we'll have a Google+, you know, we'll put Programming Throwdown on Google+, and you can
add it to your circle, and we'll post on upcoming
shows and let you know
some people didn't know we were out for about
three weeks when we usually
do a show bi-weekly
because we were both going through moving
and being sick and things like that and so the blog
sort of keeps people up to date and also
is a way for people to sort of tell us
sort of what they want to hear so um
we got some feedback for different things some people want to talk about games want to talk
about different platforms and and uh we i think we should kind of we might start doing you know
the beginning of the show you know right after the news talk about you know a certain aspect
like like games or like frameworks or something like that.
So yeah, we might tackle
something like that in the future.
I think we'll probably think about a little shake-up of the format.
Yeah, if you have any suggestions
definitely let us know. If you think that
we should
cut the news a little short and talk about
a specific topic that
you have interest in or want to know more about.
Patrick and i are
pretty eclectic when it comes to programming stuff we've done just about everything between the two
of us so um we could definitely talk about talk about just about anything so all right well i
think that's it yeah all right so next time guys yeah have fun with prologue. The intro music is Axo by Binar Pilot.
Programming Throwdown is distributed under a Creative Commons Attribution Sharealike 2.0 license.
You're free to share, copy, distribute, transmit the work, to remix, adapt the work,
but you must provide attribution to Patrick and I and sharealike in kind.