Thank you, thank you very much Eric and thank you to all of you coming out tonight It's wonderful to see such a big crowd and wonderful to hear that It was booked out for tonight. Obviously. There is a great deal of interest in this subject Before I begin I want to open with a quote from someone who I think is One of the world's greatest broadcast reporters working at the moment John Simpson from the BBC John wrote in the new statesman late last year on a piece on IS Islamic State. He said you have to hand it to Islamic State It's not only good at capturing towns and cities cutting off the heads of its enemies on a camera Selling off 14 year old girls into sexual slavery carrying out mass executions with great efficiency and cutting videos to music It's also managed to persuade us that it can't be beaten Just last week Iraq's Vice President Ayodhelaoui Dismissed reports that the US-led coalition forces have weakened the Islamic State group and in a report on the International Business Times website a couple of days ago. Alawi is quoted as saying in Davos when he was attending the World Economic Forum ISIS is getting stronger. It's not true that they have lost control in Syria and are losing control in Iraq Let us face the facts as they are Now his warning came as part of a plea for greater cooperation among Arab countries in the fight against ISIS an effort he described as currently chaotic and Uncoordinated and he went on to say that without really an effort to get things moving with a structured strategy Not only in Iraq and Syria, but globally Then it will not work. We will not control ISIS He said without this the region is going to be exploding more than it is now and the whole region will be engulfed by fire now obviously very bleak and alarming words and it was in stark contrast to words from President Obama during his State of the Union address last week Where he said very clearly in Iran and Syria American leadership is Stopping ISIL's advance instead of getting dragged into another ground war in the Middle East We're leading a broad coalition including Arab nations to degrade and humiliate and Ultimately destroy this terrorist group. The effort will take time. He said It will require focus, but we will succeed Now the rise of the so-called Islamic State has introduced another complex dimension to an already volatile Middle East It's forced a set of new alignments and Re-alignments along multiple regional fault lines including sectarian divisions and geopolitical rivalries IS has Confronted all the regional states from Iran to Saudi Arabia with a common enemy Yet It is the United States and its Western allies that have taken the lead in launching a military intervention to degrade and eliminate is Despite the US's lack of successful track record in the region in the past which of course Raises a number of questions Tonight is an attempt to unpack the nature of the mess that has become of the Middle East a Region so turbulent and yet so rich from which the world Cannot simply disentangle itself and we are very privileged and fortunate to have as Erika said one of the world experts On this region here with us tonight professor. I'm in cycle. I mean there are so many questions It is hard to know where to start on this one, but I think perhaps given we've got quite a bit of time we should start a Little bit further back. Let's go back to Iraq and talk first about How a vacuum of power was created in Iraq in the first place that has given space for the development of IS I think the origins of the so-called Islamic State Really go back to the 2003 US-led invasion of Iraq The invasion itself was very successful but the US handling of the post invasion period Was incredibly messy They did they definitely had a plan for the war But they did not have a plan for how to win the peace afterwards, I think the biggest mistake that probably the United States made and the American Leaders probably would acknowledge now it was the process of debatification dismantling the Iraqi bureaucracy the Iraqi administration and the Iraqi security forces Just simply because that they felt that they had been Associated with Saddam Hussein's regime in one form or another That amounted to two basically the dismantling of the Iraqi state and that generated a massive political and strategic vacuum Which opened the way for various societal groups? which had been Divided along ethically sectarian lines to come out and fill that vacuum Just on the vacuum itself our how is it that? There wasn't enough consideration given to what was going to fill the space After that invasion was over as I understand there was a lot of bureaucratic in fight in Washington The State Department had a plan for the post invasion period or the post invasion transformation of Iraq But it was very much sidelined by the Pentagon and of course there were different groups within the Pentagon who were competing with one another and At the same time there were different agendas Which be either overlapped or contradicted one another and as a result The United States could not really come up with a viable post invasion plan in order to achieve What the United States had originally promised that is to? create a stable secure prosperous and Democratic Iraq and that they means to be the case to the present day so with that that power vacuum as you call it That had was created and of course this has echoes of what else has happened around the region previously and continues to now But with that power vacuum, how did that actually give rise to is itself and I think perhaps too We should talk a little bit a little bit about who is I is well I Mean the origins of the IS really goes back to the penetration of Iraq by Al Qaeda Under Saddam-Sahddin's dictatorship Al Qaeda had no niche in Iraq but of course some elements within the Bush administration were really looking for a length between Saddam-Sahddin regime and the 9-11 events but They couldn't really find that links at the end just as they didn't find the other reason for justification of the invasion that was that Iraq had weapons of mass destruction and But it was of the invasion that Al Qaeda found the necessary space to establish itself in Iraq and Then expand its operations in Iraq and one of the man who was really leading the Al Qaeda operations in Iraq was Zarkawi and At that time the current leader of the Islamic State Al Baghdadi was associated with Zarkawi So in a way It was essentially Al Qaeda which spawned What eventually became known as the Islamic State of Iraq and Syria or what is now called? Daesh at Daesh is basically the acronym for the Arabic name of the Islamic State of Iraq and Syria or ISIS It really from my point of view doesn't matter Whether you call it Daesh, of course the Islamic State leadership doesn't like it because they would like to See the world acknowledging its legitimacy as a sovereign political and territorial state and therefore now they shun the acronym Daesh But it really doesn't matter whether it's called Daesh or whether it's called ISIS or ISIL the important Point is how we are going to really deal with the reality behind this sort of name. Okay, but before we get on to that so the What spawned it effectively was almost like It became a franchise of Al Qaeda and yet there has been a severing of Connection with Al Qaeda only last year. Yes, I think then the Islamic Order ISIL began to homogenize from 2010 onwards and it really took off from 2012 Particularly when they succeeded this particular group succeeded taking over Raqqa in northern Syria Of course they established their niche first in northern Syria and it was from there That they started expanding their both political and territorial influence and of course Syria has Virtually by then had disintegrated and remains so to the to the to the present day and Now also what we really have but in large is a disintegrated Iraq The biggest challenge now facing not only the Iraqis in the Syrians and for that matter the regional Players and the international community more importantly the United States and the Sun lies how to really put these two states back together to the pre-crisis and both countries and that is going to be a challenge Which is going to be extremely difficult to meet successfully How big is IS do we know do we know what their numbers are well We were initially told that the IS had 5,000 fighters and then later on we were told to buy a western intelligence services There was to have about 10,000 fighters The latest figures that we've been given is 21,000, sorry 31,000 But at the same time we have been told that something like 21,000 Foreign fighters have gone and joined 21,000 have gone and joined the IS and of course Officially, we've been told that something like 90 Australian are Working for them or fighting for them, but there are also some unofficial figures which put it to something like 400 So we really don't know the exact numbers But what we do know that now IS has control over some eight million people and our large sorts of territories in Iraq and Syria Large swathes of territory and an enormous number of people for such as what it effectively is a small troop if we are Talking about 31,000 people How how are they managing to do this and and where is the support coming from where is the money coming from where's the firepower coming from Well, I think when they succeeded a last June and defeating the Iraqi army They managed to capture a lot of modern arms that the United States had supplied to the Iraqi armed forces in fact That we were told by Washington at one point that they had built and trained and Equipped the best army in the region, but obviously that did not turn out to be the case So a lot of their arms. There are a lot of the arms that they were using their IS using Really have been the ones they've been captured And also they succeeded in taking over the Iraq's second largest city, Mosul and Eradied the central bank or Mosul They got a lot of money from there, but let's not forget that prior to that They were also Funded to some extent from a number of Arab countries If not from the Arab directly from the Arab governments, but also at least Arab private citizens We should be reminded that There is billions of dollars in the hands of private citizens in Saudi Arabia and Kuwait in United Arab Emirates and They these citizens they do pay saddaka or religious arms two and a half percent on their wealth and Often they really send they send it to what they call religious causes or deprived groups Muslim groups in the past a lot of money was channeled into the into the coffers of The Afghan Mujahideen who were fighting the Soviet occupation of Afghanistan in 1980s and then subsequently a Lot of money really went to to the Taliban and I recall from the Former a chief of intelligence of Saudi Arabia Prince Turkey al-Faisal who personally told told me that Saudi Arabia on its own Provided some 24 billion dollars Support to the Mujahideen and the Taliban alone and that's a lot of money and also I think initially a Qatar was providing Support financial support, but the financial support were not specifically for the Islamic State of Iraq and Syria it was for this Syrian opposition But because the Syrian opposition was so divided and because they were already a number and was dominated by a number of extremist groups And the moderates really could not Get their act together. So part of the funding which was channeled to them also went to these extremist groups So in whose interest is it for our eyes to continue to grow in strength? Well at the moment Publicly speaking, it's in the interest of nobody It is an extremist Sunni group and therefore it is very anti-share and anti other sex in Iraq as well and in Syria Because that's said publicly but but privately, but it's a bit of a different story Yeah, well, I think it's different story because yeah, Iran is totally opposed to us and So is publicly Saudi Arabia and it's a Partners in the Gulf Cooperation Council. That's Kuwait United Arab Emirates Bahrain and so on But let's not forget that one of the reasons that I Is was able to establish a strong niche in Iraq was because it found sympathy or support Among the Sunni population of Iraq who form about 20% of the population of the country and they had been terribly marginalized and ostracized under the shared dominated government of al-Maliki So the grievances that these that is a rocky Sunni had had brought in not only a Force like IS to gain support or the Islamic State of Iraq in Syria to gain support, but also Saudi Arabia Which claims the championship or the leadership of the Sunni Muslim world was sympathetic very sympathetic to the Sunni population of Iraq and in some ways The Saudis Were involved in a proxy conflict with the Iranians because of course We know that also a majority of the population of Iraq is made up of Shears and you do have a strong sectarian links with the Islamic Republic of Iran But my my my point at the moment is and you know the point that I wanted to make is that While Saudi Arabia and some of its partners and the Gulf Cooperation Council are publicly opposed to IS at the same time Did you remain concerned about the plight of the Sunni segments of the Iraqi population and if IS is a force which can help them and Or defend their rights and one for more another one should not rule out the possibility of Saudi Arabia and some of its allies Seeing the rolling back of IS But not its destruction altogether as a possibly anti-Iranian force which Therefore would suggest that IS in one form or another is going to be with us for a long time. I Think it's going to be there For as long as the current conditions exist It is the the conditions of what I call Authoritarianism across the region the reasons on which they draw in order to justify or Expand the circle of their recruitment and justify their extremist actions range not only from the prevalence of authoritarian regimes across the region But also to Israeli occupation of Jerusalem the Palestinian lands United States unqualified support of the state of Israel and of course at the United States support of various authoritarian regimes and the region and of course since the Arab the reversal of the so-called Arab Spring and the support that the United States has provided to the developments in Egypt and also to what is now sort of become very much well known as the counter-revolution That is taking place across the Arab world. Let me ask you this see I From what you say, I'm understanding or hearing that you don't think that the US United States Really has a place in in fighting IS Well present Obama has Gone into this air campaign against IS very reluctantly I mean we do recall that, you know, he came under a lot of pressure Reluctantly, but now doing it with great vigor and Doing good with great vigor, but they're still extremely reluctant to send ground troops Just simply because he doesn't want to get involved in another ground war Which could result in the return of too many body bags to the United States Absolutely, but when he says things publicly such as that they will be eliminated and denigrated I mean, I'm sure a military Experts would have to assume that somewhere along the line that's going to involve ground troops. I think this is what the military experts have said Eventually this war would have to be really one on the grounds and it's not going to be one from the air And I think probably President Obama is very much aware of that But at the same time there is this thinking in Washington and that over a period of time That's why President Obama said that this is going to be a war or a conflict which is not going to be Finished in weeks or months, but possibly years Do you think it is it is correct that the the US take the lead on this the US and its allies my personal position from the very beginning has been that while the origins of the conflicts really go back to the 2003 invasion and perhaps some people might even go further back and You know under the personalised state that Saddam Hussein had created And That what has really emerged in since last year, it's a more of a regional problem I Felt it was imperative and indeed very reasonable For the region that this problem be left to the regional actors to deal with it I just simply cannot imagine that for example Iran With sit back and allow Baghdad to fall to Islamic State It would be too much for Iran in terms of its overall strategic interest in the region to let Baghdad fall or For that matter I just cannot imagine the Saudi Arabia in his partners and the Gulf Cooperation Council And their Arab supporters across the region would sit back and allow the IS Forces to cross the borders of Jordan Kuwait and so on my I I Feel very strongly that this was a very unique opportunity that the United States and its allies should have used in order to Bring about a degree of regional cooperation In fact the IS could have been used as an incentive to bring about regional cooperation Because ultimately if IS is an enemy a common enemy to all the regional states Then they had to act in some ways collectively in order to defend themselves against this menace Which is really emerged the difficulty there are a number of difficulties I can say but but one being that Assuming that all the players in the region would act But as you've just said a moment ago for some of them there is an interest in an IS of some nature or form still existing the other is that You know many of these regional players would admit themselves That they rely on the US time and time again for this kind of intervention And in fact there's this lovely quote from Joe Klein the the journalist who writes at the time time magazine who said just recently that when he was he was traveling through the Middle East An Arab diplomat said to him When in trouble we always call 911 in other words we call our now American friends now Isn't that what we're seeing? Here they're that reliance and also your theory then that if the region was left to its own devices It would have taken action also assumes that the region the various actors would have worked together And there's no evidence that that would occur. Well, I mean there is No question that once the United States In the salaries took the lead then there was less pressure on the regional actors to act They could have sort of sit back I think the participation of the Arabs Arab countries in this international coalition is more of a symbolic nature Rather than importance in terms of substance. Yes They have for Saudis have carried out some air bombardments and the Jordanian Air Force have carried out some but on the whole They have not really Come into this campaign in a very big way in order to reduce their Dependence or the dependence of the campaign on the United States in its western allies Which are doing the heavy lifting at the moment and that may continue to be at the case for some time to come explain to us Something about the the religious extremism that has been at the heart of this Particularly in the propaganda wall that seems to have attracted foreign fighters, etc How how can this sort of extremism be contained or dealt with? Well, I think it's reached the point from my perspective that you and Secretary-General call should call a Regional summit of the order a summit of the regional heads of states Because even if Saudi Arabia and some of its allies are Very concerned about the plight of the Sunnis in Iraq Ultimately, they don't want the Islamic State to become an Incredibly viable and challenging force. You don't want Because that would really challenge the legitimacy of many of the regimes in the area and I think this regional summit Should also be participated and supported very strongly by the five permanent members of the United Nations Security Council There has to be a regional consensus and The regional consensus is not going to really emerge until such time that the regional heads of states get together with the support of the five permanent of the Security Council members to Come up with a Resolution of some of the very fundamental issues, but that would not be just I mean in terms of the military operations They will have to really come up with a very viable and Comprehensive political strategy because there are so many Root causes of extremism which cannot be resolved by military actions and Therefore our comprehensive Political strategy has to be designed in order to deal with those root causes of Extremism which defy military solutions Just the extremism if we come down to I guess grassroots level when you've got Young people around the world including from Australia You know sitting in their bedrooms on Facebook and on online and getting a rather You know excited about the prospect of joining this fight and then we're here We we've got you know someone in the Northern Territory a Labor Party figure going off to fight with the the Kurdish Peshmerga It seems unstoppable and as you said before with so many foreign Thousands of foreign fighters it would seem unstoppable again the attraction seems to be something that is is almost impossible to put down and that's that that further that passion and Religious attraction that many of us just don't understand. Well, this is the first time in that Islamic group has succeeded in establishing a Very strong territorial base and declaring an Islamic state or Khilafat Which is basically trying to present itself as successor to earlier Khilafat or Islamic states in the Muslim history The Khilafat was abolished by the founder of modern Turkish state Mustafa Ataturk in 1924, but There are groups across the Muslim world That you are still very nostalgic about the Khilafat and they have been advocating the unity of Muslims under a single leadership and Groups like Al Qaeda is the Tahrir and a number of others Have been remained very much devoted to this ideal but I think they're all sort of dreaming Because What has really happened since the disintegration of the Ottoman Empire and The colonization of many parts of the Middle East Of the World War one and then the age of decolonization That the concept of nation state has taken a stronger roots in the Middle East then the concept of a Borderless Oma or Islamic community or the concept of Khilafat Today if you ask a Saudi who are you he would first tell you I'm a Saudi then he will tell you I'm an Arab and Third he will tell you that whether he's a Sunni Arab or a Shia Arab and then Fourth he might tell you that which tribe he may come from or which province he may come from and the same applies Right across across across the board, but it would seem and forgive my terrible pronunciation But it would seem that the emotional pull of a caliphate Has has been very successful in that it has pulled people from around the world to this idea and it There are some very simplistic messages that sound good. They tweet well all that kind of stuff about Creating an Islamic state that seems to be at core Wanting to be at war with with with the West well, there are quite a number of Young hot headed if I could put that that way Muslims in the West Who are attracted to this new quote unquote Islamic political and territorial state which is coming to existence and Of course, many of them may be marginalized in the Western societies and I think what has happened recently in France this issue of marginalization has been very much acknowledged by the French leadership and Of course, that's also an issue also in the United States and many other European countries and Australia and possibly Japan in a number of other countries as Closie associated with the Or states which are within the Western Alliance But there is no a very dangerous dimension is taking shape and that is that the jihadis in the Middle East being countered by a Western counter jihadis and We have recently heard the example of Matthew Gardner Who has gone to Iraq in order to have a fight for Pashmerga and The Kurdish Militia and of course the Kurdish militia is not an internationally recognized force is not an Internationally legitimate force because it's not under the control of the Baghdad government at all it has been operating for years Independent of the Baghdad government and that's why the Kurds have succeeded in establishing an Extensively autonomous state in the north which is just another challenge even if the IS is not there And I think the Kurdish issue would be another challenge not only to the Iraqi government But also to the region, but that's another issue. But of course, there's no also various groups which have been set up in the West and One of them is this said the lines of rogue over which basically means in Turkish West that you're recruiting Westerners who are non-Muslim Westerners to go and fight for Pashmerga or for the Kurds in Iraq and this carries the risk of a global Struggle between jihadis and counter jihadis Taking taking place in it's not at the level of Western governments acting against the IS. It's at the level of People in the West Acting against the people in the Middle East or for that matter in the dark there's no doubt IS has been has been incredibly successful in its propaganda Without a doubt and and its media as well. One of the difficult things I think in in this War is certainly from a media perspective. It's impossible to get close It's impossible to actually penetrate and so so much of what we hear is is imbued with great fear and In fact even pitching the idea of IS being all about pure evil and a death cult You know, it makes it psychologically seem like that IS is invincible So in that sense they've been very very powerful and very clever in the way that they've used the that the propaganda war won The propaganda war look, I just want to move on because we are running out of time, but let's get to our core question Is IS vanquishable? Can it be defeated? I think that we are look at it at this point IS is containable But whether it can be defeated That will depend very much on the extent That the regional countries and International community Succeed in changing the conditions across the region and how does that happen? Well, I think the reforms will have to come from within the region. I Don't think that the regimes in the region Can afford to treat their citizens With the degree of restrictions political and social restrictions That they've done so far They really have to open up their their systems for wider participation on the part of their public and support of policy Implementation and policy formulation processes To me the systems and most of the countries is still remain very much close. So you're talking about a spread of democracy I'm talking about probably not Something which would be the replica of Western democracy, but I'm talking about a degree of political pluralism Which we need to be in conformity with the building of civil society and in conformity With why there with the need for why the political participation as the foundation for liberty and Then as a foundation eventual for some form of democracy, which is going to comfortably rest with that some of the traditions which really Define the characters of the people and the way of their the lives of the people and that part of the world


Think Tech Hawaii, civil engagement lives here. Welcome to What's On Your Mind Hawaii. I'm Tim Apachele, your host. Today, we look at two topics. The first is about the air quality on the Big Island, specifically the unhealthy fog levels in Kona. Residents are concerned that the air quality alerts and news stories are not being issued out of concern of reduced tourism. The second issue focuses around the recent NFL rule requiring players to remain in the locker room or stand on the field while the national anthem is being played. Yesterday, President Trump disinvited Super Bowl champs, the Philadelphia Eagles from the White House with only one day notice because few players were willing to attend. So now let's take a look at the yesterday's air quality map in Kona. As you can see, the Big Island, all the green spots basically showing fairly good air quality. And then you have the two red dots showing areas of concern for air quality. And the ratings is 160 and 142. Basically, anything over 150 is an alert that all residents should be aware of, not just those people that have respiratory problems. So to talk about this and a little bit more is our guest today, our Kono resident, Mingo. Welcome to What's On Your Mind Hawaii. Hey, Tim, thanks for having me on. Oh, Mike, our pleasure. So you live in Kona, and you've noticed in the last week or so, week and a half, you've had some pretty bad cases of air quality issues. Why don't you tell us a little bit about it? Well, it started, of course, when the eruption began over a month ago, Tim, and it's been getting progressively worse. And on Tuesday, we blew a 154, which is in the dark orange and healthy for everybody range. And then yesterday, we were back up to 153. And it's ranged from the 80s to the high 120s in the week between those dates. And right now, we're a little bit better, but I'm looking out my window at the ocean, and I cannot see the horizon. And normally, I see a real crisp demarcation line between the sea and sky. So it's bad. But the weird thing is that we're not being told how bad it is by anybody in the TV broadcast media. And also, I think during these bad days, and I've confirmed this with both Civil Defense and the Department of Health, the Air Quality Division, is that there's really no official broadcast or alert about a high rating of bad air quality. And it's into us over here. Because imagine, like looking at the map you showed, imagine if the tables were turned. Imagine if that 160 was in Honolulu, and that nice green four was overcoded. Do you think that Honolulu News Now, oops, I mean, Hawaii News Now, would actually broadcast it and talk about it? I mean, they have plenty of time to talk about Bruno Mars and Honolulu traffic. But this is a very serious issue that is not being covered. So do you think that's just how the news cycle works here in the state? Because Honolulu has close to a million people and Big Island doesn't? Or do you think there's some other ulterior motive as to why the reporting is not occurring? Well, there could be a bit of Big Island fatigue going on right now, because we have to give credit where credit is due. They have all been doing an incredible job covering the lava eruption, and they've been doing it with great compassion and with amazing detail. And in some cases, they've been risking their own safety to give us incredible video images. But there is another priority that is not being covered and that is, when you talk about the coverage of air quality, they basically stop down at the Ka'u District, but the whole west side of the Big Island is being deeply affected by this. And we're just all wondering when we're gonna be mentioned. I mean, there was a 30-second mention on one of the new stations and then there was an eight-second mention on another one, but these are all dovetailed into economic impacts. In fact, I remember the other day, one of the people was talking about how the Pride of America cruise ship was skipping Hilo and Kona again this week, citing Kona air quality. And his closing statement was this is gonna result in financial losses of about one million. Not one sentence or one word about the health impacts to everybody living and working in Kona. Well, that's true. And I actually, I found a quote from one of the legislators from your district, Nicole Lohan, and she was quoted to say the following, we deserve information for the county, the State Department of Health air quality to basically have our questions asked. So that's quite a statement. Apparently there's a feeling not only from you, but from your representatives that information and alerts and warnings aren't forthcoming quite well enough. That's true, Tim. And Nicole's been doing a really good job. In fact, there is a meeting tomorrow night, right here in Kona to get citizens questions answered. But remember that we're over a month into this and there's still no alert on the news. There's no mention of the actual rate in the poor air quality.  There's no problem here. Yeah, I remember that very well. He wanted to help the economy. Yeah, I mean, the mayor's running up and down the beach going, hey, Chief Brody, you get those people back in the water right now. There's no problem here. And Chief Brody's like, yeah, we got a little problem here, Mr. Mayor. So, you know, of course, the focus on the lava zone is important.  That is the most important, no question. And the coverage of that, as I mentioned, has been fantastic. But there is a statewide issue. The west side of the island is being deeply impacted. And it would be nice to get just a cursory mention of the level of air quality so that people can prepare. You know, I'm a healthy guy and I've had really bad problems with my sinuses, my eyes burned, my throat's really dry. And if I'm a healthy person experiencing this, I can imagine what somebody who's not healthy has to deal with when they go outside. So your point is at least before, you know, before everyone goes outside for the day, it'd be nice to hear from some agency whether it's Civil Defense or the Department of Health Air Quality Division, someone to actually issue an alert saying that things are rather unhealthy, not only people with respiratory issues, but with people, all people that live in the area. Exactly, Tim. And here's what we deal with in the world we live in today. If you don't get in front of the message, people are gonna fill in the blanks by themselves. And I'll give you a perfect example. There's a lot of online forums and there's places for people to go rate businesses like Yelp. And there's a woman who's been online bashing a local hotel because she asked what the air quality was like and she feels that she was misled. And so she came over here anyway and got very sick.   And this is the world we live in now. So you can't ignore these impacts for some short-term gain to a local business without realizing the long-term ramifications because if people feel that they're not being dealt with fairly and honestly, they are going to have anger issues to deal with down the road. You just, you have to be truthful. You have to give them clear and accurate information and it has to be timely. Well, I think the point of communications is well founded because as of today in today's Star Advertiser, it looks like civil defense in conjunction with the Department of Health Air Quality Division. They're talking about a website to centralize air quality reporting. So in the headline, it says centralize, meaning that there's information coming from all over but maybe people aren't catching on to where it's located. So what I'm gathering through this article is that it's not enough to just have sporadic websites. It's important to have an official website in conjunction with news announcements on TV and radio. Exactly, because you can't make the assumption that everybody has a computer or everybody is really internet savvy. There's a lot of people that aren't comfortable with computers or tablets or don't have a cell phone. They're not gonna be able to go online to like purpleair.com or punch in Kona Air Quality on Google and get an immediate reading. They're gonna rely on their TV news. Right. Well, I know some of the news stations have a brief mention about air quality. Again, most of that pertains to the east part of Hawaii Island but not so much in the other parts. So if anything, it sounds like there's brief mention that affects the Kona-Kailua area but not a whole lot. Yeah, it's been very brief. 30 seconds here, eight seconds there, 10 seconds there. The mentions are greatly appreciated but a little more needs to be done. And again, their coverage of the actual devastation over in the lava zone has been phenomenal. And I can understand. People may be a little fatigued of big island bad news but this is something that affects everybody. Every time you step outside, you take a breath. If that air has got a quality issue then people need to be aware. So you live in Kona and so I'm gonna assume that you go into town. Have you noticed a reduction of tourists on the sidewalks or does it seem to be the same as usual? It seems to be pretty much the same as usual. People here are really resilient and they're a tough breed. We've got a lot of people that are into fitness here in town and I see them jogging and running. I've read some things that say that particulate levels at sea level are a little better. I don't know if that's true or not. I'm not a scientist but I don't notice that much of a difference. Kona people are pretty tough. They're gonna get through this. This is temporary. I just don't want there to be any lasting image issues that we have to deal with because people feel like they're either being misled or they're just not being given the information that's readily available. Right, well there's a gentleman by the name of Larry Holland. He has a post-doctorate and he's a fellow at the University of Hawaii, Manoa, Department of Atmospheric and before the eruption, it was cited that there was about 2,500 tons of particulates or actually air quality issues and now it's increased 15 to 20 times more than normal. So that's quite an increase in air quality issues and doesn't sound good if you're living there. Sounds like it's gonna be pretty tough and maybe more people are staying indoors more than normally. They are. My neighbors are, I am, the reality is we live on a live, living, angry island right now and Tutupele is not done yet and when she's done, she'll let us know but for right now we just need to be aware and take the necessary precautions. I mean, it's obvious to anybody, I'm looking out my window right now at the ocean and I do not see the horizon line. Well, but the air today is definitely better than it was yesterday. Ultimately, what would you like to see in addition to what's occurring? You'd like to see more news alerts or news and radio alerts or you think there should be a more broad-based approach? Well, broad-based would be best. Broadcast news, TV news would be excellent because everybody tunes into that. It doesn't have to be long, just a number and again, let's go back to that map. Imagine if that 160 was over Honolulu and imagine the coverage it would get if it was over Honolulu or a populated area on Maui or somewhere else. We're just all kind of stymied that it's not being reported on at all. Yeah. Well, your points well made and I wish you luck and we'll see what happens at that public meeting tomorrow or is it tomorrow or tonight? It's tomorrow evening. Tomorrow evening. So I hope that goes well. I'm sure they're gonna talk about air quality issues. And Mingo, I'd like to say thank you for joining What's on Your Mind Hawaii. Your comments were very important and we appreciate it. So thank you. Thank you, Tim. I appreciate being allowed on as a guest. Okay. Mahalo and aloha. This is Tim Apachele again and now for our second segment and that is about the issue of NFL's recent rule to require NFL players to stand during the national anthem. This issue has really hit the news way, the news airway ways quite substantially in the last couple of days. Most recently, in fact, as of June the 4th at 4.55 PM, the president of the United States tweeted the following and he said, the Philadelphia Eagles football team was invited to the White House. Unfortunately, only a small number of players decided to come and we canceled the event. Staying in the locker room for playing our national anthem is as disrespectful to our country as kneeling. Sorry. So that's what he tweeted and I guess before we look at the next interviews here. So little known facts. First fact is the national anthem didn't become official until March 3rd, 1931. Number two is prior to 2009, players remained in the locker room and they weren't present for the national anthem. It was only when the Department of Defense contracted with the NFL to pay the NFL to have the players come out on the field during the national anthem. So this is only a phenomenon the last nine years. And last but not least, the Eagles in the last season, not one player knelt during the national anthem. So that was interesting for me to just recently find out that there wasn't no one on the team that decided to take a knee. And so let's just look at these two interviews and hear two separate opinions. Ah, this is Tim Appichella with Think Tech Hawaii for what's on your mind, Hawaii. And the topic today is the NFL ruling about standing for the national anthem. I'm here with Don and Don, this is a recent announcement by the NFL and I guess I'm just gonna ask you, what do you think about it? Yeah, I definitely do not agree with it. Our First Amendment right is the freedom of speech. I believe that that freedom is being taken away as far as you have to do, you know, I believe it's being taken away as far as you're forced to salute a flag. You know what I mean? A lot of people put their lives on the line. I come up with a military family, my grandfather served, I got uncles that served, I got little cousins that serve right now. They're out there defending our rights. I think as soon as you take that right away and you make them stand for the flag, it's definitely not right. I strongly recommend that the players in the NFL stay in the locker room for now because I believe I actually saw a business plan. I mean, everyone do the history back home, check it out. Back in the day, they didn't have to come out on the field for that anthem. Soon as the NFL and the military made that deal together, all of a sudden now, every player has to come out there. Colin Kaepernick, taking that knee, you know, there was a lot of things that happened, especially in the Bay Area. A lot of folks around the country, it's for police brutality. Well, let me ask you this because this was a non-issue at the end of the season. I mean, there might have been only seven or 10 players across the NFL that was actually taking a knee. So it kind of settled out itself. So the question is, why do you think the NFL took this on at this time? Honestly, I think it has to do with business, business and politics.  Everyone kind of wants to hold back, you know, act like they don't see it. And that's part of the recognition. As soon as we recognize the problem, we can find a solution. But if we don't even see the problem, we're never going to get a solution. So unfortunately, the commander in chief made kind of his point to say that if you don't stand, you're not only not American, but maybe you should exit the country. Did you hear that from the president of the United States? I did not, but he can, you know, for him to even, his opinion is his opinion.  And I mean, if everyone knows Donald Trump, it's about money, you know? The fact that he was able to get it, you know, he's the president, you got to salute him for that. He did what it took to become president. It did what it did, though, I think it opened our eyes to see how many people are really with the new world, new movement, as far as terms of America, and how many folks are still in the past. You know, the New York Jets, the owner, Christopher Johnson, he made an announcement that he is going to cover any and all fines for any player that does want to take a knee on the field versus having them stay back in the locker room. What do you think about that? Man, that's a real coach. That's what, that salute. I'm a raider, but a salute New York Jets coach, you know what I'm saying? That's righteous, that's all right. You sure you wanted to go on public record that you're an Oakland Raider fan? I'm an Oakland Raider fan, the captain, I'm with you. So do you think this is an issue? You said business and politics, but do you think it's a, well, more of the politics issue is that trying to wrap the flag around the president of the United States and trying to him determine what is patriotic and what isn't patriotic, a lot of people feel that Donald Trump's the last person in the world to basically define patriotism. What do you think about that? I definitely agree. What I've heard is I heard he didn't serve his country five different times, I believe, I heard. You have to do the research on that yourself, folks, but yeah, man, you know, there's a lot of good, you know, just like the whole situation, even with the police brutality, you have very, very good cops out there that want to make a difference. There's other cops that are bad.  But understand that those bad cops are giving you good cops bad names. Same thing with Donald Trump, just because he's up there and you know, he says things that are outrageous. I'm sure he's done good things for good people in his past and I heard about a lot of bad things he's done, but he doesn't represent all of us. So let me ask this question. We basically had a situation where, again, the players more or less had not really, you know, the whole issue kind of just settled down and now it starts up again. If you're a player for the NFL, what are you gonna do? Do you think you're gonna stay in the locker room or are you gonna join lock arms on the field? Will that signify a defiance that President Trump or is, you know, people that feel very patriotic? Is that a disrespect to the flag and to the national anthem? Depends on where you're at as a player, as far as salary, because I know all those players, they're regular people just like me and you. You know, everyone gets paid differently. If you have the funds to afford it, I would definitely still go out there and kneel, pay that fine. If you don't, stay in the locker room. That would be the best bet to do it.  Because when it's all said and done, we all gotta live on the search together. Well, that's a great way to end the conversation. Don, I wanna thank you so much for joining me on What's On Your Mind Hawaii. I'm Tim Apachella and thank you Aloha and we'll see you soon. Aloha, Tim Apachella with Think Tech Hawaii for What's On Your Mind Hawaii. We're here today to talk about the new recent NFL ruling about standing for the national anthem. I'm here with Sal and Sal, what do you think about it? Well, I think, you know, they run a business. So, I mean, I'm not allowed to make a gesture at my personal job and I don't think that the players should use their job as a platform to protest. Well, that's a really good point. Also, speak a little louder because we got a lot of road noise here. That is a good point because a lot of people are arguing that it is a First Amendment right and that the NFL is infringing upon the First Amendment but you just hit the nail on the head and that is when they are employed and they're on the field, they're on the company time and therefore, they may not be able to exercise their First Amendment right. So, say that again and I think that was a good point. Yeah, well, it's a privilege to be in the NFL, first of all, right, if they interviewed you before you were selected to the draft and the rules was implemented before that, would you take that stand, right? I don't, me as an individual working in, you know, in a common job, I can't show up to my job and meal and not do what my company expects me to do. Have you ever gone to an employer and saying, hey, I want to say what I want to say because it's my First Amendment right? Have you ever said that to an employer? Well, when you apply for a job, you're applying for the job under the circumstances and what is expected of the job. So, in that sense, it never crossed my mind, you know. I didn't accept the job and tell myself, well, when I get this job, I'm gonna protest against whatever, you know. Did you have any reaction to President Trump basically saying that if they don't stand for the national anthem, even though they come out of the locker room, that maybe they should depart the country? Did you hear him say that? I heard him say that, you know, President Trump, at times, he's not very presidential, you know. I didn't vote for Trump and I didn't vote for Hillary. So, at the same time, I'm more conservative than I am liberal. So, in that sense, you know, what Trump said didn't really have anything to do at what Kaepernick is protesting about. So, to me, I think Kaepernick, if he wants to protest, why don't you go volunteer and be a police officer? Put yourself in a police officer's situation. You know, go work one whole month. You got money, when you're not working in NFL, go volunteer, be a policeman wherever this, you know, stuff that going against the police. So, if you were an NFL player and you felt very strongly that you were protesting something very close and very close to your heart and something that really had a lot of meaning to you and that's what a lot of these players are doing, would you be one to just stay in the locker room and then later come out, or would you come out and take a knee and take the penalty? Well, first of all, I would respect the flag. That's the flag represents our freedom, regardless that, you know, we're Hawaiian people here in Hawaii and our government was overthrown, you know, in the name of, so to speak, Christianity and I can't think of the correct word, but I'll get to it, but you know, you got to stand up for what you feel, but there's a time and a place. Like I said, if you want to protest, well, go volunteer and be a police officer. Look at two sides. You're only looking at one side, right? Do you remember the 1968 Summer Olympics in Mexico and the track and field awards and there was two African-American players that raised their fists with black gloves on and they took a lot of heat for that, a lot of heat. Do you think it's a similar situation right now? Well, I don't think it's similar.  Do you think the timing was good for the NFL to make this call or do you think it could have been done at a later time? Because the issue was almost over. There was only seven people or 10 people at the end of last season that was actually taking a knee. So do you just think the timing was real bad on this? I think there was a little more than that, you know. What do you think, what else was more? There were more people that were protesting than seven people, I think, you know, I may be wrong, but I think more people were contesting than seven, but like I said, the platform, you know, the NFL is a business, right? They were losing money. Nobody wants to admit that they were losing money because of the protesting, so like I said, I think. Do you think standing in the locker room waiting for the anthem to end is a good parcel solution to those players that feel this is a very important issue to them and not forcing them to stand during the anthem? Do you think that's an elegant solution? I think the solution would be like the media shouldn't focus on the players who are kneeling.  But for a national, I watch the NFL to watch the NFL, you know, to get away from politics, to enjoy the sport of the NFL. Do you think the sports announcers should just steer clear of it and just not even put it on camera when it happens and just go with the game, just report on the game? Yes, I'm tuning into the network to watch the game, not to, if I want to watch anything political then I'll turn it on the news. You go to ESPN after the game? Well, ESPN, sports and politics, it should be separated, that's my opinion. Okay, Sal, well, hey, sports for sports. Sal, thank you so much for taking your time. I'm Tim Appichella with Sal and this is What's On Your Mind Hawaii for Think Tech Hawaii. Aloha. Welcome back and thank you very much for tuning into What's On Your Mind Hawaii. Our next show is on June the 19th and look forward for you to come back and check out the show. Aloha.


Welcome everyone to the session now, we're really pleased to have the modern Jayatandra with us. He's going to be speaking to us on typescripts type system from solving puzzles to proving facts of program. So we'll be interested to see what you've got to share with us there. We're really thrilled that you could join us today and share your knowledge and experience with us. Yeah, hello everyone. So this is Damodaran. You can call me Damo. So I'm from India and I've been working in so for the past eight years. And so today I'll be talking on typescripts type system. So let's get into the presentation. So the things that we'll be dealing with this, we'll be using typescripts type system to solve puzzles. And this is for the fun part. And for the part of the profit, we'll be looking at how to prove properties of programs, like what all the facts of programs that can be proved using typescripts type system. And before getting into the actual presentation, like this presentation is live. And you can you can also follow through me on the link is given below this one. It's damo.js.org slash fncon 2022. So you can go to this slide and you can use the slide. So without much further ado, let's just dive in. So JavaScript is this omnipresent language that is being used by almost almost like every place every device just runs JavaScript, right. So the problem with JavaScript is that it doesn't have strong types. So in order to solve this program typescript came along and it just gives us types. But the thing about typescript is that the types are present only only in the compile time and they are not present in the runtime. And what happens is once we compile it down to JavaScript, the types gets gets erased completely. So let's just look at a small demo. So what I have over here is the typescript playground and I have two types over here. The first type is the person second type is I'm calling it as alien and both have names. So if I just want to create an instance for this, what I'll have to do is I'll just have to create the object alone. Let's say I gave name and I just type a generic name and this gets accepted. But let me change this to alien again and this also gets accepted. So the thing about typescript type is that these are actually followed by structural subtyping. So once it satisfies the condition that it has a key name and the value is going to be just string, typescript just finds it totally cool and it just moves on. So moving on top of that, what others we have is we have like higher order types like array, promise and these guys are actually generics. So let me just show one more demo on this. If you look at this, I have four types over here and the first thing is going to be an array of string and this is going to be a promise of string. And since array itself is a containment, you just say like string alone. If you look at this thing, this is where I write my typescript code where this is where is the compile.js. And so none of the types get carried along and there is no JavaScript being generated at all. And the moment I add a declare before some cons, I don't even have to initialize because these are also just considered like they are present and you don't have to do anything else. So I can still move on. If you look at this, type x dot, I get all the functions that are present within the array of JavaScript. So it just considers like this x is an array of string. And then similarly, if I give y, you have the dot then method within the promise and if I get it as the value, if I go and check the type of this value, it says string because the type automatically gets inferenced and everything, all the inference and stuff happens within the browser because this particular editor, Monaco editor has this typescripts compiler running within itself. And this gives us this very good intelligence. Let me just show this because since this value is going to be string, if I give a dot again, I just get all the assistance for string types, which is like nearly, it is nearly impossible to do it in plain JavaScript at all. So moving on, let's look at one more tool that is being given by typescript and these are called as assertions. So the type gets erased from the type system once it is compiled to JavaScript. But the problem is that there are certain times where you need to have those conditions to be validated at the runtime. So with the Bayes rule set, assertions can take care of runtime validations too. So let's now look at what happens. We actually do this right often. We write code like document.getElementById given by a id string. So if we go and inspect the type of this particular variable within the editor, it says HTML element or null because this id may be present, may not be present. If it is present, we will get the HTML element or not. But it's like most of the cases, we'll be getting it right. So what actually happens? Like let's say, let's take the condition that it is definitely present. So what you have to do is you just say like as HTML canvas element, that's it. So immediately what this now says is, I'm just telling the compiler that this id is definitely present and it is going to remove the R type of null and I'm going to get it. So this is one type of assertion that you can guide the compiler through without making a mistake or something like that. And followed by this look at this. This is a very interesting example. So the method is below four and I haven't actually implemented the method and the only thing that I've told is it gets a param. I don't care about the param, but it makes an assertion that the param is going to be either one, two, three or four and that's it. So this is what is the function is all about. And then and I also declare another constant, which is going to be a number. Now I call is below four of X one. So since this is this gets called it immediately understands that X one is either going to be one, two, three or four and nothing else. Now this is where it gets even more interesting. The moment I say the context whose type is just literal five, the only value X can take is five alone and nothing else. And this one is now throwing me an error. The moment I hover on top of this, it says the type of one, two, three and four is not assignable to five. So even though the code is actually not run, the type systems inference takes care of these kind of things because we are making sure that this assertions just get taken over through the compiler itself. So this is what is the sum of the key features of type script that really helps in real time. So moving on. So this is what happens in type script because like type script is coming from JavaScript and basically like more than 90% of the code that you write is going to be just pure imperative code. So let's say suppose you want to go full-blown functional program. I mean with type script, it is still possible that with very strong types and there is a library called as FPDS and then there is a very small example program within itself. I'll just show it to you. So what actually happens is the higher order types are being implemented on type on top of this type script type system and you get all the good flavors of Haskell like EQ or semi-group monoid category and etc. So like fungther applicative monoid and these guys are like implemented on top of this FPDS library and there is one example that we can go through. So what actually happens is like since we don't have imperative code, since we don't have like statements of sorts, let's look at the small code over here. So he just writes pipe and then he just does this what is the secret and what is the guess and then this guess it just asks for a particular name. It just pops up an alert or something and then once these values are injected, you can write functional code because right now this these two values get injected in this arguments. Say suppose you want to go full blown pure functional programming using TypeScript, along with the goodness of great abstractions like monoid, monoid, fungther and applicative, which is still possible on top of TypeScript type system thanks to this great FPDS library and if you can look at it, it's just going to be like it's sort of a lispy code on top of this very good abstraction also. So moving on like this is where the fun part actually comes in. So like you can now see how rich the TypeScript type system is and right now when it comes to this type system, we are actually going to use it to solve some small puzzles of sorts. So whenever it comes to solving puzzles, like we just give partial clues, we keep getting the partial clues and sometimes when the clue list is complete, we immediately get the answer out of the clues that are given. So in order to model this, we also have like logical programs like prologue and there is a very small interpreter that is being written on this blog post and you can look at the sample code in prologue. So it says Father, Child, Massimo and Rich. So it says the father is Massimo and the child is going to be Rich and then followed by Eric and Thon and then Thon and Alexandria and this is just kind of a family's complete hierarchy. So given this much of data and if I just ask for father, child of Thon, prologue says yes, Eric is the father and Thon is the child. So let's say you ask something like this. I know the mother but I don't know the child. I don't know who X is. So the moment I click it says there are actually not one but three children for Stephanie. So this is what happens in prologue actually. So you just give prologue the facts and after that you just ask for some generic question and it will be able to answer. And also you can actually write rules like this. It says a parent of X is the parent of Y only if X is the father of Y and X is also the mother of Y. Only if these two conditions get satisfied you can say that X is the parent of Y. Now look at this particular query it says who is the parent of Thon and if you click on ask it says Eric and Stephanie. It just gives you both the father as well as the mother. So this is the structure of prologue and the person who wrote this blog post has implemented this prologue on top of JavaScript and it runs using JavaScript. It just takes the string parses and so on. The usual compiler's lifecycle goes on but we are going to do something different. So what we are trying to do is we are going to encode those facts using structural types in TypeScript followed by we are going to populate the base data and let's look at what the type system can do for us. So let's look at this puzzle solver. As you can see the same three rules I have just modeled them using plain type using TypeScript ridges actually it goes in the opposite direction because the direction I have taken is child to father. This is actually child to father and it goes in the opposite direction and whatever is not present we will have to mark them as unknown Felicia and Kristen and followed by these three rules that were written in prologue are also mapped on to this TypeScript type. And then everything else. This is kind of a boilerplate that I need to map these things within the type level and then followed by I just have some utilities and stuff and just and now let's look at the actual progress. I just ask for who are the parents of Thon and I don't have to run any code or anything. All I have to do is just hold on top of it. I'll be able to see the parents. It's going to be Eric and Stephanie. Followed by if I ask for siblings of Felicia. All I have to do is just hold on top of this and I'll get all the siblings and then for the grandfather it's going to be this one. So all I have so all we have to do is just map through this particular series of keys and we should be able to do we should be able to solve small persons like this but the even more interesting factors we still haven't written a single line of code because these are all living on type of the type level and there is no JavaScript that is being still generated at all and we are still able to run some kind of logic on top of the type level. So moving on top of this, I wrote an article on this speaking about how we can do these kind of small stuff and why it actually happens in this article where you can go and have a look. So what happens actually is we can write even more interesting stuff on top on using this type script type system and one of them is you can model numerals on top of these types and you can also do some very basic math on top of this and one of them is what I'm going to show you next. So before getting into how I have implemented this, I'll just show you a demo on top of this. I've just said this is going to be one, this is going to be two and three and four and so on. So why should I even call this as one? Let me just hold on top of this, it just says Len once and if I hold on top of two it says Len two times and so on. If I look at the six, it says Len six, Len six times within this depth and if you look at this function, look at this type, it says MUL of three and four. So it is just multiplying three and four. So if I hold on this, I should be getting Len up to 12 times. So it comes 12 times actually if you count it, it will come 12 times. So how did I implement these functions at the type level? This feels like we are teaching the compiler about what numbers are on top of types at type level. So we have this inductive definition on numbers where we call this zero as just zero. This is the usual literal type and we have a function called a successor where it is a generic type where it takes in the t and just encapsulates with Len and that's it. So this is all we do. So one is going to be Len of once and then two is going to be Len two times and three is going to be and three times and so on. This is all we need for this successor function. So continuing on top of this, we can even write an addition function like if you give two numbers on type level, it should be able to add them and give you a result. So how does this actually happen is TypeScript actually allows you to write recursive types on top of like type of add x, y you can add on top of this and it just goes on. So now let's try out some cool functions on top of this. Let's say we don't have seven, right? So let's just define one underscore three and underscore four. And if you just hover, you'll get this Len defined seven times. So it will get up to you'll get it up to seven times in this and using this model, I've just defined like addition, multiplication and then subtraction maybe like even division is possible but I just, we can just have it as an exercise or so, so that we can develop on top of this. So moving forward, like, this is like totally it seems like fun part or people sometimes call this as overengineering. So why do you even want to do this? Why do you even want to model numbers on top of types? But it actually seems like these are like very important, very important in the forthcoming slide. So if you look at this, there is something called as this indexed list. So what this indexed list is that we have a value, we have the usual list but this list on the type level carries the length also. So what if it carries the length? So what actually happens is if you look at this up and function carefully, it takes an element of type X and a list of type X followed by length n. Let's say this is a list of number. So if I say list of number and underscore three and so this X2 at compile time we know its length is going to be definitely three. So if I call this append and I get this X1 and compiler now knows like this, I call the append function with a list of length three and X1 is definitely going to be of length four because I've appended this one. So what is the implication on top of this? So I type X1 dot, it immediately gives me next and then I call for the next value. This is the second one and followed by the third one, fourth one. And when I after the fourth, it doesn't give me the next value because the list is now complete. The type system now knows that this list is just of length four and that's it. It doesn't have, so you don't have, you will never go wrong with this when you have something like that. So right now this list is very similar to the cons list that we define in functional languages where it carries a value and followed by the next one, very similar to an usual So also we have this another function that is being declared over here. It's called, it's the concat function where it takes two lists of length m and length n. And since we have this add over here, we can say the return type of this list is going to be of length m plus n since we have this add function. So when I look at this, we have the first list where the length is going to be two and the second list where the length is three and this one is going to be of length five because we have concat at the two list. And following the same exercise, you are still going to get this next five times and it stops over there. So these are like extremely, extremely strong type lists where you will where you can also do this type level gymnastics and you can never go wrong at all. So if you look at the bottom, whatever black box we had set for the previous time, it just gets carried over and then you will still be able to move on top of this. So let's just try moving still more further and right now we are going to look at indexed matrix. So how do we actually program matrix using this? I think it's going to be far, far simpler because since we have list, matrix is just going to be list of list and then the first thing is going to be the type, type of the matrix. Let's say a matrix of numbers and then the second argument is the number of rows and the third one is going to be number of columns. And we can try something like really interesting. Let's look at this function. Let me just zoom out a little bit. If you look at this function, we are just trying to multiply two matrices M1 and then M2 and the M1 matrix is of row R1 and C1 and this one is going to be C1 and R1. And the written type of the matrix should be R1 and C1 because when you multiply two matrices, let's say three cross two and then two cross three, the result is always going to be three cross three. So this is what is the actual matrix multiplications underlying operation. So we just declare again a matrix of three cross two and then two cross three and then we multiply. Now if you look at this, this constant, I ask for the value. I get the next three times and then this is like the iterating through the row. And for the third row, I am getting the third value. By continuing this, you can just get all the nine values.  So let's look at the opposite case now. Let's say we define matrix of some other row and column. Let's say suppose we have like underscore four or something underscore five. This is a four cross five matrix and immediately this says with a very cryptic error and it goes to a very long depth and says a very cryptic error but the actual error is this type doesn't match at all. Because I think there's a variable, something going wrong over here. Yeah, now we are through. So the actual thing is since this is going to be m one is going to be three cross two definitely the column of this one is should this one should always be ending with two. It shouldn't start with four at all. So this is what is the error that it's throwing. So let's move on. So these are for the some of the fun part maybe like this one actually. So like we have this might be useful this might not be like sometimes be useful in the real life and people again can call this as over engineering or something, but there is like this particular use case where it's really really useful. People always we always need this particular use case of some kind of an automata like let's look at a life cycle of a bug in a very typical software development project lifecycle. You have the bug it will be filed by someone and it will always be open and immediately the next stage of the bug is going to be like it is under fixing stage. And once it is the developer market does I am fixing it and after fixing it he is going to say that this is to be tested and this is the next step from fixing you go to to be tested. And from to be tested you then go to the bug is now closed because whoever filed that bug will test whether after this fix the bug is there or not and then it will be like this bug is now fixed. Now we will just move on but sometimes what happens is that if that bug is going to persist again you just go back to like this has to be opened and it has to go on. So this particular life cycle is yet again model us on top of the type like key value pairs on type level and we again declare a function we call it as move bug and then we write this is kind of a generic function we say x extends key of bug life cycle. So this we TypeScript has this particular operator called us key of which just which just gives you the keys keys alone open fixing to be tested and closed only you get these four values. So the argument is going to be this x only those four values of this particular key and this is and the return type gets again interesting. If you look at that look at the return type it says bug cycle of x. So if it is open the return type will always be fixing and so on. Now let's look at I say I call it as move bug and what is the return type of why it says fixing. So if I call it for again fixing the return type has to be to be tested that is the next step. It says to be tested and so on let's say I just give something else like remove or something definitely it is going to throw error because it is not assignable to this particular type. So like people actually use this kind of an automata kind of thing with client libraries like read eggs and stuff where you will have to move from one state to the another. You get the state it followed by the action and then you move over to the new state. And for these things you can truly do the strong typing on top of this automata or this bug or this life cycle kind of things where you can never go wrong that the compile time at all. So I didn't want to use this word but these are actually dependent types and disguise and types here we cannot like say whether we can prove facts or like prove the I mean like through theorems on top of type script but definitely these come in very handy. So why not stretch this even further why not go even further because in the latest releases of type script they introduced some something called as template literals. Which we are going to look at next. So template literals are very similar to template template literals present at JavaScript but these are present in types type level actually in typescript. So let's look at the demo first. I just say Zoho it's going to be the URL of this one. And I just say whether it is URL of Zoho and I'm just hovering on top of this it says yes it's an URL. Let's say I give something else. I remove this HTTPS or colon on something. It says false it is not an URL so this happens actually at the type level because typescript now has the ability to define something similar like this. Like you can say the string has to begin with HTTPS and these are like capturing parenthesis of your regular expression. This is the first capture and this is the second capture. If it is of this particular pattern you say through otherwise it falls and with this you can say this is an URL or not. And you can go even further let's say you can define a type something or let's get domain and it can say like since it is able to get this value of you can just return it. Now for the same value of this Zoho if I just hover over here you get Zoho instead of true or false. So these things are as powerful as regular expressions and you can still program using them and you can strong type your code. So since we have now come to the lexing part why not do try doing parses. So let's try to do something on top of the parser level. Look at this we are just trying to do the balancing parenthesis. Since balancing parenthesis involves pushdown automata you definitely need a stack. You cannot write a validation for balancing parenthesis using the regular expression because you need to keep hold of the stack and you definitely need either a stack or a variable or something. Or the combination with the regular expression or something so it's definitely not possible using regular expressions. So we write something like this balance and we say we write this particular rule. We ask for whether it starts with the opening parenthesis and ends with the closing parenthesis and I try to infer whatever is in the middle. And whatever is in the middle still has to balance and this is again yet another recursive type. So with this if you go and test for this we are going to get yes this is getting balanced and let me remove only one thing and it's going to give me false. I guess the parenthesis are not matching right now and we can just go even more deep because we can just define something like these are going to be my operators and you can write a balancing grammar also like complete full blown mathematical expression or something. I just have a small demo of this where you have balancing parenthesis followed by operator plus and then it says yes it's true again because this is still going to type check. So this is what is so cool about this we can still go further and people have gone even more further and they have defined things like JSON parser on top of the type level. So if you look at all the demo we don't have any meaningful code in the right side and this is just on top of the type level and this is just very easily possible right now because of this particular tooling. So moving on so why is this even possible the reason for this is generics. Generic types are actually type level functions and then functions that is generics they can compose easily because since they compose easily we can say like these type system of type script is a very small lambda calculus. And the implication is actually very huge because type scripts type system is actually during complete. Since this is going to be during complete and this has been marked as an open issue within the GitHub but we can use it to our advantage because since something is during complete the equivalent in the church language is going to be like this is actually lambda calculus and with lambda calculus we can do even more fun stuff right so we can use it to our advantage. One of the unfortunate thing about proving using typescript is typescript steam calls this to be a non goal actually like having a sound type system or probably correct type system is not a goal of typescript type system but the thing is we don't have to limit ourselves to just go even further and try to prove even more crazy stuff on top of this one maybe like we can have a parser on top of the type level which can do which can parse these types and prove even more proper facts of the program or something similar of sorts. So, and the next part is going to be since we already have these kind of things right so we saw a program something like get an append off a list where you get the element the list of length n and the written value is going to be n plus one. And these programs you don't have to test it at all because even before writing the code you're writing the conditions the preconditions the post condition and so on and these things are like probably correct code and the formal verification takes care of the list. And what this means is we have like a very huge open source code basis, where you can actually scan for back doors of sorts. Let's say we have like very robust software system, like let's say there is an offline tool and it guarantees that I don't give a center request to any, any server of sorts.  Of course there are like programs that can browse through the source code and do, but we don't have the actual proof which can be like we can be very damn short, but with these which is like really, really possible. And the second part is we do this test driven development like test driven development in the sense we write tests first and then followed by we do the actual implementation, but since we, but what we can actually do is by during the development if we are sure of the types, we can just move over and then just write the implementation alone and we can be very damn short during the development time itself like we don't remove these constraints of sorts. And then following this, this is like very, very opinionated because like types seem to be the dualness of imperativeness like imperativeness I have for the deal of imperativeness I mean like you say in imperative language do this in first statement and do this in the next and so on. But when you look at types what we say is just give clues. This is my input and this is my input of some additional clue and this is my output with additional clue which is very similar to what we did in prologue we just give it facts and then we just let the system decide what to do with that. And if we keep giving these constraints, tighter constraints and tighter constraints on top of this at one point of time it is just going to be a puzzle solver. The types themselves act as a puzzle solver and just gives you the correct value. So as you can look at the first beginning of the slides you can look at the type system did not know about numbers.  So you can look at the compiler as a small toddler or something and you just keep giving it some small clues and then it can figure out like higher level details and so on. And so specifications can just be encoded at the type level and like approvers can take in these specifications and generate and give us a program which we can be very well sure that this is going to be like very secure and stuff. And then moving further, correctness of the software is now completely under the testing team or like going through very strong reviews and so on. But since this is involving some human effort, like most of it can be averted because right now from hospitals to software that actually use, that are getting used to drive flights and so there can never be errors at all. So in places like these where correctness is the major setback, we can make use of these very strong types to avoid this. And moving on, the next bank or the country's constitution could only be programs. Now that we have smart contract systems built on top of blockchain where everything is decentralized, the constitution itself can be written as a piece of code. And someone has to come and verify whether something is written wrong or bad using a panel or something. But with some kind of system like this, a provable system like this, we can just give it to the formal verification and then we can be sure like very sleek errors are not given up of sorts. And another implication is that right now we have lots of bureaucratic machines moving over like someone has to come and verify something. And with these kind of things in place where the constitution or something like that is itself being written as a piece of code and all it needs is like approval from someone. Now these can be again replaced by piece of code and in these kind of cases taking chances is never an option at all because we just need software that we are very sure will work and would never go wrong. So with this I conclude my session. And then for this session the major inspiration was like Philip Waddler's proposition was types talk and then Nadia's refinement types and those two talks are like really, really very engaging and like really, really path breaking. And then of course it is dependent types where I just I was thinking like if I had a system like this where I can use it in my work and in daily life I'll be like very helpful. And then of course Haskell has always been my good language for functional programming and then even though I don't use Haskell in day to day programming but it may be better programmer by learning a lot of these stuff on top of TypeScript. And the usual Haskell's Reddit thread is a good place where like it accepts newbies like me and they just give me videos and books and so on. And then I just want to introduce two books where you can get started and the first one is going to be a type of programming written by Renzo and this program just introduces to functional programming in a very elegant manner and also to theorems and proofs followed by algebra driven design. This is a very new book that has been written and it just talks about this how you write code, how you write code which actually has provable capabilities followed by I just have I just want to thank my friends at Zoho. And then thanks to functional content team like for the opportunity and a very cool cover photo for the presentation because I was thinking like what should I have as a first slide and like functional content just solve the problem for me by giving a very cool photo. So with this I just conclude my presentation and go on for the questions. You think there's a few, few questions there that people have Rick, Rick's got one. Why, why the reverse relationship? Yes, because I'll just go back to the slide. He just thought he's his next comment I think relates to the question to so look at both of them. You C2F and then invert. Okay, yeah, I'll just go to the program. Yeah, okay. So the thing is, whatever direction I go, I need the reverse one also. So let's say I'll have to define this twice. So either C2F or F2C I'll definitely be needing both because we have siblings as well as grandparents, right? That is why I wanted both. So I just defined C2F for me, but you can do it in the other way also very similar to the prologue way, but I just wanted this to work this way, nothing else. I think it's similar in the example. So have I answered Rick's question. Rakesh has got a question as well. Yeah, I think both are same questions then you C2F. Yeah, I think the second question is also same. In the example, some of the strings used like it should be as defined as the type. Defined as the type. How do you make this URL type to work and say and user users and okay fine. Yeah, let me just show over here. Yeah, let's say you define a function and it takes an argument. Okay, this is just returning me the let's do for the get domain. Yeah, this just returns me the Boolean value. We cannot get the thing. So yeah, we cannot be sure. Yes. So you have to do something like this. Yes. So I'll just give you a very small demo over here. What we have is we get the length of the string where we have a generic function and we have written as is going to be a string and we call the get domain thing. So now we know that it is going to get two types actually the first one is going to be string and the second one is going to be Boolean. So we'll have to do an enumeration on top of this and that is why we need to write an if check if it is going to be Boolean then it's not a domain. So we are returning null value and else we are just now asserting that is definitely a string because in this particular place type script is not able to make sure that you is a string and so the moment we assert we start getting the length of the string. So this is how we use this generic types or these kind of template literals in on your functions. I think we just about out of time. So thank you the modern for that little demonstration of how this all works and what the benefits of it are.


And welcome back to news on I'm Miranda Khan CEO and founder of Stock Swoosh Melissa Armo and attorney and Democratic strategist Ken Altschuler join us for our bipartisan panel today. Good to see you both Good to be here So we were just speaking with Ben Burke-Wam our contributor who is there on the southern border on the Mexico side of it Getting his reaction to what he is seeing on the border. They're still seeing that influx We've been covering the story for months now Sending him out there. We've also talked about recently that there were 50,000 people that were supposedly led into this country There's no way of really keeping track of them. And then we just got inside directly About vice president Kamala Harris's strategy. She just released that today. It's pretty much a One-page document if you will it seems to be a Little lacking there, but I want to get your thoughts on that Ken It seems to be and I just want to get your opinion on this. Is this just Regurgitating talking points that we've already heard from the Biden administration Well, you know, I've been I've been critical of the Biden administration and I'm a big fan of Kamala Harris But I've been disappointed with the way she's handled this her one trip to the to the border Three months after being appointed the czar was disappointing Yeah, it is talking points at least it's something But I'm not one to say, you know token gestures or progress. So I'm disappointed in it I think it is regurgitating. I mean, we know that you have to make the central America a more fiscally Responsible environment for people you need to get rid of graft in governments And the Biden administration has been doing something toward that end You know, you have to have some kind of policies with real results and real action So I give this maybe The plus I'm not really enthused by it. It's a step, but too little I guess I would say too little too late I'd like to see much more concrete plans and and goals in mind And I'm not seeing that and I'm disappointed and it's gonna hurt the Democrats in 2022 as I've said every time I've been on the show. We've talked about it Melissa Well, I agree with him that it is gonna hurt the Democrats in 2022 because this is a big issue One of the reasons it's such a big issue right now is because of the fact that we still have cove it these people are coming in They're not testing them. Some of the people have already said that there's people that have cove it They've been getting cove it going into Texas. Why aren't we testing these people? Why are we letting people come in from foreign countries when we still the pandemic and now they're talking about cases going up They want to remass people or in the middle of a pandemic whether or not they want to help other foreign countries We have enough problems here right now in our own in the United States of America I don't think we should be worrying about anybody else right now, but this country we had bad economic data that came out today Worse than expected and we'll see how the market reacts to the end of the week We don't need any more of these problems We want to stop cove it and when you have people coming in across the border And you don't know where they're coming from and you don't know what diseases they have and then they're shipping them all Over the place. They're not just coming into Texas and California. There's some some of the people They're saying they're sending to the middle country middle states and even New York well That's spreading coronavirus if in fact they have it, which of course, we don't know the people aren't getting tested But I heard cases That were in Texas that they feel like it was spreading in Texas that I think it was one of the local Sheriffs have talked about he said we didn't know yes, these people. Yeah coming We're that they were being released. I know exactly what you're talking about Which is why we mentioned at the top of the show that the governor of Texas Issuing that executive order saying that they can't just be dropped off here We'll continue to monitor that situation But speaking of health and we are going to get to cove it in just a minute But I want to talk about California Because it has now just become the first state in the nation to provide taxpayer funded health benefits to elderly illegal immigrants So california will provide 75 million dollars and disaster relief assistance This historic move is expected to cost california taxpayers at least 1.3 billion dollars ken You're killing me You're killing me this afternoon randa because this is another thing I don't think you give benefits to illegal illegal immigrants. I mean You've got to be in the country legally to get American benefits and and i'm all for helping people in need But you can't just make this an open pocketbook and particularly in california and particularly when they're they have a surplus because of government Funding because of covet and I understand you can use it for you what you want But no you can't give something to someone who's here illegally We have to improve the system improve the immigration system Get people processed quicker give asylum when necessary, but don't give handouts. It's not good policy It tax our economy and as melissa said we have some financial issues here Why compound it so I don't agree with it and as a liberal? I think this is a bad way to go I really am not in favor of it Well, keep breathing because we still have more to get to So melissa, I want to get your thoughts on that because there are so many americans right now that Can't afford their day-to-day expenses as it is. You know, you've already got the president trying to extend That eviction moratorium right now There are plenty of people watching this program right now who can't afford health insurance And now you have the people in california probably many of them who can't afford their own health insurance But now we're going to be taxed to provide health insurance and health benefits to people Who don't have the legal right to be in this country to begin with your thoughts If I was a california resident I would be angry about this because to be honest with you the health care system changed And insurance premiums went up and a lot of health care companies went under when the affordable care act went through That this is years and years ago now I mean the rates for insurance as a as a healthy single female I can't if I told you my rate you fall right off your chair right now because I own my own business If you work for a company you can get a cheaper price if you're in with a big group plan But if you're an individual or you own your own small business and you have to pay for health care The costs are astronomical and it's been that way since the affordable care act So that's across the board. But as far as california goes california is a disaster They are trying to do every an election to recall the governor there I don't know of larry elder who's running against him is going to win But he's got a shot. He's got a shot people are upset people are leaving california They are tired of this nonsense. They are tired of being taxed I think it's one of the worst states as far as these things go And it's hard to say that because I live in york and we have a lot of problems here The california has serious serious problems. They're losing residents who is going to pay for this One of the things about the illegals that are here I know some of them are working and some of them are working under the table and some of them are working with With ein numbers or illegal social security numbers that aren't yours. The problem is they're not filing tax returns They're not paying taxes. They're not paying into the system even though even though some of them are working here They're not paying in so it's really not fair to the people that do file every year and do pay in And they're paying tax every single week Well, I'd love to know for the viewers that are watching if you live in california Would love to know your thoughts on this or maybe perhaps you moved Away from california for the very reasons that melissa just mentioned there I know that's one of the reasons why ben burquam Who's on this very network left california and moved to arizona? So i'd love to know your thoughts you can always do that by Finding me at real moranda con and social media hashtag share your voice So i want to get into this and we're probably going to have to get your reaction coming up after the commercial break, but Obviously, I want to talk about covet. So as we learned yesterday CDC now recommending vaccinated individuals including children K through 12 or mask indoors We've talked about congress now enacting that Mask mandate all of this to protect against the new delta variant But according to the CDC director Rochelle Walensky, there's not evidence though when it comes to Justifying children masking in schools. Let's take a listen Now the delta variant Isn't making kids any sicker per se. Is it because the statistics as the studies have come back from children in covet? What from the uk, uh, what did we learn there some 99? 0.995 Of the 470,000 children in england infected Survived. I mean that's an incredible survival rate. The delta variant isn't making kids any sicker. Is it? We don't have any evidence that is doing So we don't have any evidence I'm going to ask both of you because we're coming up with a commercial break and I want to give you adequate time To respond to this because this is a story that's affecting Everyone in this country. So melissa can stick around. We're going to talk about that We're also going to talk about that bipartisan agreement that happened late last night on infrastructure As 17 republicans voting in favor of it including mitch mcconnell Not making uh former president donald trump all too happy what he has to say about it and wife for once I think him and aoc Are in agreement. We're going to explain that coming up. You're watching news on