So right about now we want to talk about awards and the most upcoming like really really upcoming ETA awards and with me I have the CEO of ETA awards and they are looking forward to the third edition of the awards so we'll be getting to know what ETA awards is because I have also seen kilamjona semawi wot for them on ETA awards so I also want to get to know what ETA awards is about so ETA welkom to the show thank you so much yes so can you introduce yourself to the people watching back at home okay to the viewers at home my name is Edward Wilton's diary I stay in machaikos county and partly in Nairobi I'm from busia county and I am the executive director of the CEO ETA awards Kenya yeah all right oh so it's ETA awards yes it's ETA you see it depends with where you went to school yeah some of us call it ETA some people call it ETA others call it ETA so it's just ETA all right so what does ETA stand for it's a rebrand actually we used to call ourselves ETA awards that was back then this is an idea that was born back then in 2019 2017 around there from the initiative the former governor machaikos an event that we used to call Talanta festival at the people's park I remember so many artists used to come from Nairobi and other parts of Kenya just going to to the people's park every Sunday to perform so every Sunday yes every Sunday we used to have a very big sound and of course we have an amphitheater in machaikos so people used to come from different counties people traveling from all the way from kisumu mombasa and other counties just coming perform on Sundays and then from there we used to ask ourselves the question of yes we've been doing this for quite some time but now what next because this is just more of a platform where artists just come to showcase whatever they have but now after showcasing so that is when we thought of bringing up an award that probably was going to appreciate and do add these efforts and that is how we thought of now having our first award which was in 2021 we held it in Kitangela and it only had four counties that was machaikos, makweni, kitui and kajadu county and then from their last year out of the public demand uh so I think the first year worked so well so so many people were requesting why don't you stretch to all the counties in Kenya and we were like you know you need to go step by step yeah always the answer to and then you find yourself national and we also we wanted to make a very strong foundation before we get to the national level and so we did 12 counties last year that is the entire eastern and part of rift valley which was all the masai counties and then now as we were laying our plans for the next five years uh one of the main things that we want to achieve by then is that by our fifth year which is in 2025 we are supposed to be taking over the east african market yeah and that is why now we thought that we lay a kenyan foundation this year next year we do kenya then now 2025 we go to east africa so uh in a nutshell that is what eight awards how it started so we actually because of going national we decided to rebrand to not call ourselves eastern because people are raising questions why is why you're going national and all that so we actually did a rebranding event uh on fifth of last month and then that is the same day we were unveiling the nominees okay and now we we decided to come up with everything differently even this logo is totally different from the logo we heard last year and the other year so it's a total rebrand so that we may be able to accommodate all the kenyans okay so um what gap were you trying to bridge when you thought of you know eta awards like what what what did you see that you needed to feel it i think uh generally our industry the music industry is i wouldn't say dead but it's somehow equal equal to you see there were back years back then that we used to have bingo awards bingo was covering all both gospel and secular and then we had groover awards which was so huge and i remember it was attracting artists even on the east african market uh kenyans uh now if i talk about the the gospel uh uh industry an artist was releasing a song in january targeting a nomination for grove and that was spurring the the industry growth so much as in msania li kwa na fukiria to manzee nikiwa nominated for grove as an artist so every other artist was looking forward to either being nominated as a new artist the gospel artist of the year i'm at the male or female artist of the year maybe uh the quality of their production was top notch kwa msania li kwa na enda studuakijwa manzee i'm wishing this song can be nominated as the audio of the year the video of the year the producers were working so hard to be nominated just as the audio producer i'm at the tv director of the year but after iii groovy kaisha isha bingo ii kaisha industry karudichini so was like there's nothing the artists are looking up to msiana amukana enda studuoh he just want to do whatever he wants to do but there's nothing he's working towards so that is why we thought that we could be able to bridge this gap and at least bring something that artists can long for artists can work towards nadya msania ki amuka kijue niya mimi amuakin the uh this hard because i want some recognition because again these recognitions are the things that make artists getting known and those men come from these recognitions that is why you will see people like in adiamon and all that they pay their flights they go pay for accommodation in foreign countries just to secure themselves these are collaborations so that they get nominated on maybe be a bt amakina free awards because it takes you to another level it takes you to a specific levels uh somewhere you are not let's talk about the kenyan market look at the people like kina bahati bahati became bahati we know today as a result of groovy yeah ile ile temi niya lwin groovy i think it was three times or four times consecutively everybody now was talking about bahati we lipo in case and we lipo all the same case the likes of akina gloria the same case but now today where are we as an industry if you are you are asked today who lives in manzee uh e-industria kenya you are a tv host in indahapi you don't i don't know whether you have an answer but personally i don't because there's nothing artists are working towards so that is the gap we needed to bridge to party yetu asani a platform where they can look at i want to get to this level i want to get this recognition so that different brands can identify who i am yeah all right so um planning um such an event has its own challenges and its own like ups and downs so maybe tell us what are some of the challenges you have experienced you know um trying to plan for the third edition of eta awards uh bearing in mind that it's a national event uh it takes a lot uh of course resource wiser and uh i'm talking about monetary and monetary resources uh it's so it's such a tedious process it involves you traveling to different counties and have not just me because i have a team it's a team if you get our website to our website www. eta awards.co.k you will get more information about our team but as in this team you want to uh at some point uh we throw up uh we peleke maybe cost amo ipeleke nyanza amo ipeleke western these are resources uh we did cost me immediate were the other day and i was looking at myself and i was like why if i knew what it all costs i wouldn't have gotten myself into this as we are speaking part of our team is in Nakuru right now for the road shows we are partnering with kukakuna to do the road shows so the road shows started yesterday so they are ongoing this morning when i was leaving my place i was organizing the team that is covering uh the the road shows in the eastern region and in masai counties we have a track that is going that direction so again you realize uh the resources that are involved it's a lot too much yeah but uh mimi kitwe ni many many fanyan kafilam it's it's a big task worth it it's it's worth it and it's also a very big task that you get to mingon with so many creatives and that i think for me it's very fulfilling because you get to understand the needs of different artists you know seated where i'm seated maybe in my house or in my office i may not be able to understand these artists sometimes we complain about artists too much but we don't have time to understand yeah itemeni una unendaga region flan and you are seated with these artists they are telling you the challenges they go through they are telling you what they've gone through to be where they are that is now when you understand that surely this industry needs a facelift to some extent and so those are things we keep learning so it has been alaning journey for some of us that were had never had a chance to mingon with so many artists na pia it places your brand somewhere sometimes you go to different places and uh you don't need to introduce yourself me sometimes na na pita maalu na skia Edward then i'm like okay how do you i had to look one amali flan we were with you in Nakuru we were in you within busia and i was like wow so yeah it's it's a good experience yeah all right so what are your expectations for you know ita awards the third the third edition wow maybe let me let me first start by when we were opening nominations uh actually the first year we only had around 11 000 submissions for the four counties 11 11 000 the second year we had 32 000 submissions that was last year for the 12 counties and now this year we had 58 000 submissions i was shocked at 11 000 i don't know what to say at 58 000 we had 58 000 submissions and uh well i looked at all these numbers and i was talking to uh tuva sometime back and i was like hey bro he's part of the team by extension yeah so i was just telling him how do you even choose from 58 000 to 400 nominees you sound shocked so i was like wow yes we had to pay for a team of experts yeah a hotel for one good week to sit down and evaluate all the submissions so that now they help us get the 400 submissions so it has been a process and of course we're expecting some serious competition and one thing i always say about ita is most of the times when i always personally i expect what i win they've never won as in it's always nili na kuchanganyanga akili kwa you're like flania me kwa kwa i kategori flanina flanina flanina and so everybody is watching for this person but wherever this other person will come from to clinch this win you don't even know you get it so uh i'm expecting some serious competition and of course out there to the people who are the nominees and their fans don't be relaxed you see danie jumse maybe when superstar you see also maybe something that i may have forgotten to mention is that ita is a regional award yes so we don't focus on the Nairobi artists only other awards that have been there were focusing on wasani when you may make it na i for us we are focusing on the county artists is it you get so those are the artists we are targeting so you realize that we've got also the regional artists like we are nyanza artists of the year so na pata awasani wa nyanza kuna ulem se mune everybody's thinking wind will atakwa wina kwa zwanam juo kwa kwa zwanam juo but kuna awasani we again they are equally doing well but probably they don't have the social influence that everyone expects but umse wuki niya kwa ground na kuna ability ya kumobilize votes i think also something we may need to talk about someday is this ability as uh as an artist how are you able to mobilize resources towards yourself towards your brand because again nadyo asanuengiwa naliyanga manzes dui mziki ailipi a bcd and all that but you forget that as an artist ume eko somewhere where now you have a point that you should be able to mobilize resources for yourself you are supposed to come up with something that can spur this particular brand that you're having it's not just about the music we are doing unadiyo kuimba mi nusema as a talent developer kuimba kuimba only contributes to 15 percent yeah whatever you do with this talent is what matters that is why sometimes when you listen nadyo fulani and i'm a hit now nobody knows him i'm a talent but mziki akema it's being played all over it's about mobilization how can you be able to mobilize people to support your content how are you able to talk communication also how are you able to talk to a presenter mziki aemansi you get but kuna wele msani yameka tu pali an expect you mean you big name i must kill akitum kujie the is work that needs to be done there's so much work after this i think actually the most work that needs to be done is after the studio yes you know i have gone to the studio i have recorded i have my video out it is that work that matters alone your talent in a contribute to 15 percent After that 85 percent, this 85 percent, one distribution, you see there's a question, you guys women are most of the times, where can we find your music answers in a kuanda YouTube, how much do you get paid on YouTube, that is a question probably we need to answer at some point as to because we need to watch our subscriptions, so at the end of the day you may not be able to be paid by YouTube, so where else can you be able to gather resources for your brand, there are other platforms you can be able to distribute your music now a days all the platforms music is going digital, it's actually digital not going, so that means distribution is on digital platforms, how many digital platforms do you know as an artist, both locally and internationally, these are things the artists need to understand then once you've been able to bring up all these platforms and making sure that your team has worked on having your music on these platforms, now there's an aspect of marketing that comes on board maybe one thing I always say it's a turn off for an artist to share his music on WhatsApp group, how many of us even open these songs on WhatsApp group, how many times do you open? broadcast list once you've been able to have an icon of broadcast like this guy, he needs to be serious it's not even personal, it's not personal, I know you've sent it to many others so it doesn't have a personal touch it's not having that personal touch, but Pia, forget about personal touch, atokini to me at WhatsApp direct I just feel kunavene aoko serious how many emails do you have as an artist, these are different DJs, both on TV, radio and club DJs and other platform social entities do you have their email address, that is where now the marketing aspect comes in so from marketing that is where now you can start earning because your music is on platforms, you have marketed it, your music is being played after that aspect of being played, you have a few interviews now to introduce yourself and introduce your brand that is where now people start associating themselves with your brand and from there that is where now what I end our stream because we are planning to do it 24-5-4 so let me stream, let me see if it will be on any other platform that is why when you start streaming you may not know him that much but he will be able to stream as much as he wants and now when you start streaming, you see that is how the difference between making money and making a name now when you start doing it, you will be able to do it in a big time now when you start doing it, you will be able to get it and at the end of the day when you start making bank statements you will see he is being paid it is a very good example for our Mount Kenia artists these people you may not know them but they must have the art of music distribution you go to skiza they are the highest paid artists and that is something you will see when you start to make money Ako apana ii, ako na very big name, amewin mawads, bato kumoliza bank accounti kwa kwa inaridadze, manze maziru tu. Ya, so we need to work. All right, so one last question before we wind up. After the event, what does Ita do to kib, you know, or rather to kib, to make sure that, you know, the people that have won, all the amazing artists, the amazing personalities that have won, you know, you're keeping, you're staying connected with them and just making sure that their platform is growing bigger. I think as far as the awards that are within is concerned, I think Ata Awards is the only award that follows up on artists to see their growth. I have two examples. This 28th, we are going to celebrate our male artist we now are 2019, now the 2021, the first male artist. He's called Daniel Onomakawa. He won as a male artist from Ata Awards, we were able to work with him and from that he got a doctorate degree, recognition. As we are speaking, he's been conferred as a bishop on 28th. So we are going to celebrate two wins out of Kutembe and Aikos, like he doctorate, actually I was involved even on signing the documents, recommending him, he got an international recognition. That came from Ata. Another example is DJ Queen, I don't know whether you know her, but she's a big name right now. We can go to social status, social sites, say she has almost half a million other about followers and this was as a result of Ata Award. We met this girl back then in her village, a place called Biseel in Kajadu, nobody knew about this girl. But as we are speaking, she has what we call DJ Queen Foundation as a result of winning Ata DJ of the Year. She has her own DJ Academy as a result of winning Ata Awards. And normally what we do with the winners is we help them organize homecoming events where we go and celebrate with them and introduce them to the community and endorse them and say, this one has won as this particular category winner in this year's award. So to Makudyaku, we introduce for this particular community, we introduce him or her to the county officials and the department in charge and we let them work together so that they may be able to empower the communities even more. Maybe just to wind up, we are doing this year's event at Nairobi Cinema. Wow, Nairobi Cinema on 2nd of September. As we are speaking, people are voting. But on 2nd of September, as from 3pm, we shall be unveiling the winners for the Ata Awards this year. And of course, so many shocking news this year. Yes. Right, we also have one of our TV presenters in one of our shows that has been nominated for Ata Awards 2023. So yeah, congratulations, Filingin and Bounce Nation and all the best. All right, so a parting shot as we wind up to the artist watching you because I'm very, very certain that we have so many artists watching us right now because of the nature of our show. And you can give them a parting shot, a word of advice and yeah, we want Ata. One thing I'll say is that you need to work as an artist. Don't just sit down, don't just go to the studio and release songs and you feel you're done. You need to put in more effort. And of course, let us always work with God's timing. Don't push too hard. Is on the way to zyofanya or zyofanya asewanakwa na some emotional disorders. Just work smart, just make sure you deliver as per the expectation on your own end and any other film will just fall in place. As long as you're doing everything right, you are linking up to the right people, you will definitely get there. Do not push yourself too hard in the story of flania, me hit, so I must also hit you to the hands of Naiei. Kilam say you konataimiaki, but make sure you connect yourself with the right people. I think as far as music is concerned, it's all about connection. No someone who knows someone who knows someone. And at the end of the day, your music will get to someone who knows someone who knows someone. All right, so thank you so much, Edward, for joining us. Thank you as well. And all the best at Eta Awards 2023 and may it become as big as you want it to be. We are looking forward to partnering with you guys in the future. And we are inviting you guys, actually in our later invitation, doko se kukudya, nesema tuli kwa nawe kwa shona wuli lenga kukau. So I'm extending our invitation even to the DJ and the producer, Karibuni Sana at Eta Awards this year's edition, 2nd September at the Nairobi Cinema. Thank you so much. Now at least I have a gown ready. So I have somewhere to go in. Thank you so much for the invitation as well. And all the best once again. And congratulations to all the nominees out there that have been nominated for Eta Awards 2023 and may the best person win. Yeah, so right about now, we are about to get into request hour, but before we do that, we will definitely have our MC come through and introduce himself. And we get to know what are our expectations for the request hour. And we are taking a short break.  We'll be back with more of the Eta Kids.


Yeah, okay So you two team keep it clean what's going on it's engraving here with another video and boy oh boy Do we got a lot to talk about in this one, but before we get into it? I love y'all team keep it clean seriously And I know I always tell y'all to check on people which is very very important, but first Make sure you're right first make sure that you're good first Make sure that everything with you is a okay because you you can't really help somebody else if you're not good yourself You can't so make sure that y'all are good. Make sure your mentors are good Make sure your physicals are good I've been myself trying to take some walks and eat better and eat less too cuz y'all know me like I talked about yesterday Lamar Jackson he got big he ain't getting gravy big, but he got Lamar Jackson big so We've been working to so um just make sure y'all are doing good man I love y'all shout out to all the team keep it clean patrons appreciate y'all supporting the channel just a little bit extra If you want to become a team keep it clean patron the link is in the description You can go to patreon.com slash engraving vids and just I love y'all Thank y'all for supporting the way that you do cuz support is something that you choose to do It's not not to anything that's mandatory, but the fact that y'all do it so much. We love y'all so appreciate it now Justina Anderson She has something to say about the Baltimore Ravens and the Julio Jones situation. Let's look at her tweet She said and shout out to swag in five two four He actually said the Ravens got Julio because he was actually responding to a tweet where she said Interesting dot dot dot and you know when people put dot dot dot that means hmm There's something that they want to say but they just can't say it So shout out to him for even for asking a question So she responded she said my understanding is Baltimore likes the young core receivers They have this is not on the radar speaking of Julio Jones At the moment a number of intriguing possibilities out there for Julio, but enjoy your Memorial Weekend's relax So Josena Anderson was saying a couple of things one She said Baltimore likes their young wide receivers and we know they have a lot of young wide receivers They got a Sammy Watkins who's only 27 and everybody besides Sammy Watkins is younger than him So that showed the group is super young. You got Hollywood and Boykin in their third years Duvenay and crochet in their second years. You got Rashad Bateman and Tyler Wallace in their first years You got Dion Kane still young Victor still you got Sillens Sillensio. I'm sorry. I know I still mess up the name. You got Dante. I'm gonna call him Dante So you got Dante and so you got a lot of young guys. That's the point So she said that the Ravens they like all of their young guys now interesting Where have we heard something so similar to that before? I don't know. Maybe it was pre-draft in the Liars luncheon Maybe because we remember Eric Dacosta when he heard about all the talk of people talking about Ravens wide receivers Eric Dacosta said it himself. He said it is insulting. I Am insulted that y'all feel that way about the Baltimore Ravens wide receivers I'm insulted. How dare you how how could y'all feel that way about the receivers that we have? Why how I don't like it. I'm not with it. I don't agree with it. I love our guys and Then he proceeded to draft to not one but two receivers a couple weeks later One in the first round and the other in the fourth round Rashad Bateman and Tyler Wallace. So how insulted was Eric Dacosta? He wasn't insulted at all. He was just talking and it worked It worked So this this report because we know in the business of the NFL Teams will put out stuff intentionally Teams will put out reports. They'll put out information intentionally just to keep people off their tail Just so that trail is not hot just so people don't realize what they are really trying to do and whether it's accomplished or it fails yet to be determined but Teams don't like other teams knowing what they like to do what they want to do So that part where it says my understanding is Baltimore likes their young core receivers. They have they might and I'm sure they do But in my opinion, I do not believe it takes them out of the runnings for Julio Jones Now the second part of her tweet. She said that this is not on the radar at the moment So she let it be known at the Ravens Julio Jones is not on the radar for the Ravens at the moment. She's straight upset it and Again, it's the same thing. It's the same thing Because Nobody wants to let their plans be known ahead of time because you have I mean the Ravens are not the only team in the league It's 31 other teams and 30 other teams that could use a Julio Jones 30 other teams Where Julio Jones would make their team that much better and that's whether they have a lot of nice receivers or not But with the Baltimore Ravens Why would you let your plans be known when you got other people that are in this Julio chase too? It wouldn't be smart. It wouldn't be good for business Because you could possibly i'm not saying that they do But you could possibly have an offer that the Falcons are like We love it.  You know, no, I mean sometimes if the offer's high enough, they may be willing to but that's Probably not gonna happen But Ravens could have something on the table that the Falcons really like and they may be with it But if Ravens let those plans be known and somebody could be like, oh Falcons like that. Let's let's bid some higher Just to both spite the Ravens and to get Julio Jones. So he doesn't go to Baltimore So but we'll see what happens now. There was another report That also came out yesterday That said the Falcons reportedly Have a first round pick on the table for Julio Jones And the lie detector test determined that is a lie I do not for one second believe that at all at all because If the Falcons had a first round pick on the table for Julio Jones who they need to move off They need to move them off the books That they don't have the leverage to get a first round pick They don't If they get if they were to get a first round pick for Julio a boy, I would be the biggest surprised person in the world They ain't get no first round pick for Julio It's possible that if Julio was If they didn't have this whole situation with the cap and somebody wanted to get Julio Then I think okay, maybe it's possible to get a first round pick for them then But with them needing to move Julio Jones with them being required to move Julio Jones off the books You ain't get no first round pick my friends You could try and that's exactly what that report was doing. It was trying It's trying to drive up his prices trying to drive up his market The whole thing with with Shannon sharp and Julio Jones You again, we talked about this before but you really think that Julio didn't know that he was on the air Julio knew He knew that of course. He knew that He knew what he was doing Shannon sharp know what he was doing Falcons are trying to get this thing rolling man Julio's trying to get this thing rolling, man They trying to get it moving So a trade could be announced literally any day now Any day now now it wouldn't be official until June 1st, but it can be agreed upon right now So we just got a wait and see by this report it by no means means that the Ravens are out of it It doesn't It by no means means the Ravens are in it But it definitely doesn't mean that the Ravens are not interested So again remember how to read these things because everything with every report that's put out It's not really what it seems team keeping clean. I love y'all. I appreciate y'all make sure you have a really good day today. We out


Hello and welcome to People's Dispatch and Globetrotter, great to be joined today by Huda Amori from Palestine Action. I got an email just yesterday which said victory in Oldham, Elbit forced to sell Faranti after sustained direct action campaign. Now I've written a lot of press releases I suppose or press statements one way or the other, very rarely does a press statement coming from the humanitarian side of history start with the word victory. So victory in Oldham, I don't know where Oldham is, I barely knew much about Elbit, we'll get to that, certainly didn't know much about Faranti but I know something about direct action. So here we have it, victory in Oldham, Elbit, Huda welcome to People's Dispatch and Globetrotter. Thank you, thank you for having me, it's good to see you again. It's a great pleasure for us and congratulations. Thank you, no it's a great victory not just for us but for everyone involved and the Palestinian people of course. That's amazing, that's a great way to put it but before we get any further Huda can you please tell us what is this thing called Elbit and who knew that in the British Isles they made weapons incredible? Yeah, no I know it's quite shocking and even for me growing up in Britain I had no idea about it and then as I got older I started to realise that actually what Elbit is and they are Israel's largest private arms company. And their business model is basically based on developing and testing weapons on Palestinians who are trapped in Gaza or the Palestinians in the West Bank and they actually develop these weapons in Gaza and market them as battle tested on the captive population there. And then in Britain they actually have 10 sites here, five factories, well one less factory now actually I have to change that. And two offices and they operate in three different RAF sites but they are basically Israel's largest arms company so as you can imagine they produce everything under the sun when it comes to supplying the military regime they provide 85% of Israel's military drone fleet. So often for the people of Gaza these drones are flying above their heads constantly day and night and trenching Israel's occupation over the Palestinian people. But actually and also these drones can also be used as weapons to target missile strikes to the people of Gaza so they have to live with these drones constantly hovering above their heads knowing that it may have killed their family or their neighbours or their communities by these same weapons. And actually many of these parts are built in factories in Britain and Oldham is just as an example of one of the factories where they were producing parts for Israel's drones here in England. And Elbit do have factories across the globe, but they are very densely populated in Britain and I think this has a lot to do with Britain's past and support for the colonisation of Palestine going back to the Balfour declaration. But essentially Elbit are murderous in our eyes and war criminals who are profiting from the oppression of Palestinians and then not only are these weapons then tested on Palestinians that built here and then exported to assist other oppressive regimes across the world. And actually these same drones that they have modelled on the people of Gaza, the British authorities are now contracting Elbit to supply the same drones in order to surveil and stop refugees coming in from the English Channel into Britain. So not only are these weapons and Elbit profiting from forcing and displacing people out their homes, but they're also profiting from the people when they're trying to seek safety and stopping them from even seeking safety. It's disgusting whenever you hear about it and I think for me as a Palestinian and I grew up in a northern town not far from Oldham and finding out just how deeply entrenched Britain is when it comes to not only supporting Israel's apartheid regime but literally hosting their weapons factories here in Britain. And Britain is actually the second biggest exporter of arms across the world and we're a tiny island. So it's actually very populated with these times of arms companies but specifically Elbit managed to profit from this deal that they have with the British government basically.  You said in RAF sites, that's RAF, well people who have watched World War II movies know RAF, the Royal Air Force, these are British government facilities. So can you please tell us about that? It's a private company. Did you say that it's operating on British government, British military facilities land? Yes, definitely, yes they are. They operate in three different, in three of those sites which are actually designated as Ministry of Defence land where they help and sometimes they're doing simulations for when people go into battle and assisting the RAF in those type of things. But also with trials for their drones and flight simulations, the British Ministry of Defence and it's something which I've noticed happening even more recently are heavily invested in the success of Elbit. And actually in recent months we've seen them make massive deals and it's almost as if they're doing it to save Elbit's skin in this country because they are being targeted so much by campaigning disrupted so much and they are closely working with the British Ministry of Defence. But also we know that their ties go right to the top of the British government. When we launched our campaign against Elbit in July 2020, it was just three or four weeks after we launched the campaign and we'd taken action against their offices in London several times. So we were getting a lot of attention and we were new, we were a fresh group and there was suddenly a meeting between the Israeli Ministry of Strategic Affairs and Dominic Raab and Benny Gantz. Dominic Raab was the foreign secretary of this government at that time and basically the Israeli Ministry asked Dominic to crush our movement, which obviously I think for us was a success to be honest with you. To actually have such a strong reaction and to see how worried they were about not being able to operate their arms deals here in private or in secret or behind closed doors because often these factories just look like normal buildings. And actually part of what we do is to expose those crimes of these companies. So just to make sure that I'm getting this clear, Benny Gantz flies from Israel to the United Kingdom or meets Dominic Raab, the foreign secretary of the United Kingdom at some point last year. In 2020, around 19 months ago or so, and it's high official of Israel tells a high official of the United Kingdom to crush a movement inside the United Kingdom. Yeah, yeah, it's a it's a shocking and as crude as you as you pull it. And it's kind of, to be honest, I wasn't surprised. I was actually quite pleased because I thought, well, at least they're reacting.  I don't know if that's the right term. I'm quite bad at phrases sometimes. But, but, you know, and that followed with numerous things that happened to activists taking direct action, including myself by the British state, you know, heavy handed policing, violent arrests, raids, or like routine for us at this point by the by the British police passports being taken devices being taken by the police. I mean the list just goes on to show how how they were following you know the orders of the Israeli Ministry of Strategic Affairs and I think compared to other groups who do civil disobedience or action. It's on a whole different level of approach to us as activists. But nevertheless, we have to plow on and I think when you're fighting against something that can seem so big and daunting as Israel's largest arms company then you kind of expect that in order to win in the end, you're going to have to overcome some massive obstacles because they're never going to make it easy for us. You know, if it was easy, we wouldn't, you know, we wouldn't be having to do these type of campaigns in the first place. Well, you had again a high official of the Israeli government telling your foreign secretary to stop you. A foreign entity was telling your foreign secretary to prevent you from exercising your democratic right. Now, we know that in the history of peace movements, particularly the Quakers, they take the Bible very seriously, Huda, they read in the Bible that swords must be converted into plowshares.  I first came upon the work of Palestine Action when you went in or not you necessarily because I don't want to put that on the table. Somebody went into an Albert area and put red paint or through red something 18 months of sustained action by Palestine Action. Tell us a little bit. And by the way, I want to tell our viewers the group is called Palestine Action. I think the word action is used deliberately. Tell us a little bit about Palestine Action's work regarding Albert systems. Yeah, definitely. I mean, as you said, the clue is kind of in our name. We're all about taking action and doing more action than we talk about it. And so we are a direct action network launched over 18 months ago now in July 2020 and we basically take action against Israel's arms sites here in Britain to disrupt them, blockade them, occupy their sites. And often in most actions there is red paint involved, which is covered to cover their premises and to signify the blood shed by these companies. And also on many occasions, especially at their factories, there has been a high level amount of damage and dismantling done to the machinery inside the factories and to the infrastructure by the infrastructure of the actual factory themselves. And just in our first year, when we launched, we caused an Albert £15 million in losses by doing these type of actions. And that was with just over 100 people being arrested and actually they were shut down for over 105 days, which was three months out of one year. So we went into it with a clear mission. We wanted to shut this company down. We wanted to shut Albert down. It was as simple as that for us. We were sick and tired of begging and appealing to politicians who weren't going to act on this issue. You know, we've been waiting and asking for this for so long, but each time something happens in Gaza, each time something happens in Palestine, there are no sanctions brought by countries like Britain. And instead, they're actually deepening their ties with Israel's apartheid regime. And I think it gets to a point. And when you realise that Palestinians in Gaza and Palestinians in the West Bank and in the refugee camps cannot wait. The situation is urgent and we have to act with that same urgency. And when you start to realise that actually these weapons are never built in front of the people that they will kill. They don't build these weapons in Gaza. They won't be able to because the people would do the same thing we have done. And to stop the weapons from being produced, but they are built in front of us here in Britain where we do have privilege. And we do have an ability to actually go out and stop these factories from operating. So for us, it's the most logical thing to do when you know that most people, I think somebody was going to hurt someone in front of you. Most people would step in the way and try and do something about it. And I think it's exactly the same principle. When you know that you have an arms factory which is building these weapons and will be used to kill people and has been developed on killing people. Then we have a duty to actually go out and do whatever it takes. And if lobbying, if they don't respond to our call out or to lobbying of MPs and politicians, then we will do it ourselves. And I think that's the point is lives at stake and humanity is at stake. And I think when you see the inequality of the world, I think for those who are in a privileged position, we do have an obligation to step out of our comfort zone when it comes to campaigning for these issues. Otherwise we're going to end up in the same situation over and over again. And I think like myself, many people are tired of seeing what we saw in May 2021 when we saw Gaza being bombed once again with weapons again that are probably built here in Britain. And even though there is global support amongst people for Palestine, it's not translated to government legislation. So for us, going out and shutting these factories down is saying we don't need the government legislation to stop Israel from being able to produce these weapons here in Britain. And, you know, for for Elba in Britain, they actually are so and you mentioned before about not knowing where Oldham is and I'm sure many people who are listening to this won't. But these factories are normally not in the kind of metropolitan areas that actually in working class communities. And for example, Oldham actually has a very large Asian community, very large Kashmiri community Arabs there as well, who are actually weren't aware of this factory existing until the kind of action stepped up against this factory. And, you know, it's so insulting to see that they put the manufacturer of these weapons, which we used to kill the communities back home right in front of them and think that they'll be able to get away with it. And obviously they didn't and they won't. Well, you see, they will be outraged with and have been outraged by the by the property damage that Palestine action inflicted thousands of pounds, you said. Meanwhile, thousands of Palestinians killed in Operation Protective Edge, thousands of Palestinians killed in Gaza in a punctual basis through the year. Outrage is minimal. We're not even getting into BAE systems and what's happening in Yemen. We're staying with Oldham and your great victory. Huda Amori from Palestine Action. Congratulations for the victory at Oldham. It's really something and I hope you can come back and talk about how Palestine Action is closed down all these factories. Congratulations. Definitely. Thank you. Thank you.


Alright, it's 1.30 or 15 seconds still, so close enough round we got to count. So, good to see everybody, I missed you guys. A week and a half, I know, I know. So sad, so sad. We'll start off and we have questions on Homer3 and Hindley Milner type inference. Anybody? Somebody may be over there in a band's t-shirt. It's too specific. Can you generalize it? I don't know. You want to see, like, in the example, the PowerPoint that you put the video up, at the end there's a very large example of it going through the wall. You want to see, like, a table like that be over-placing, like, t-section, so it's kind of like all the other stuff in the class so far, right? If you end up with the right answer then, I don't really care, but that table helps you think through how you should be doing it, right? So that can help you work it out and if you mess up the final answer, right, we can go back and grade that and give you kind of partial credit to say, okay, correctly calculated the type of this node and this node and this node and this node, but, okay, you make one mistake here and act as gated through all the other. I know the video. Can you see any instance where there was an error? Were you going to say, like, I'm just not matching? Did that happen somewhere? Oh, I'll say yes or no. It can happen. So one of the examples, the earlier examples, has a type error, right, where we set, like, A is equal to 10, which meant that A has to be an integer and later on we used A as a function, right? So we had two conflicting types. We can't unify integer and function, right? So that's a type error. Okay. Any other questions or any buddies, friends, or neighbors want to volunteer them for a question? Yeah. Do you, yeah, you should mention why there's a type error, right? You want an explanation. So, like, at this node, you try this here, because of this constraint, A is an integer and because of this constraint, A is a function, you can't unify those, so it's a type error. Any other questions? Yeah. Can you speak up a little bit? So it means that if you have, that means that if you have, so do you see a function call, right? You know that you have, the first time you see a function call, you know you have some type of that function that is being called, right? So if later on that function is called again, now those parameters have to be the same type, you have to unify those parameters as well. So it has to satisfy both of those constraints. Project four questions? Yeah. So yeah, I was going through it again. So I saw that, like, the first half to, basically, I would call the first half, but yes. The first part. And then the second part is trying to determine the types. Right. And determine if there are certain types of errors that occurred. So should we go about implementing the parser completely and then worry about the type of data structures that we're going to implement to determine if the types are people who are not learning anything? Yeah. So the question is basically the first step of project four is to create, complete the parser. So you're given an incomplete parser. It's missing, I think, five different parsing cases. So the question is, should we do that first and then go to the typing or do the typing first? I'm sure if I keep in mind the data structures that we would save different... I would say no. I would do the parsing, get that 100% working so you know that that's working because test cases, right, are going to presumably have those structures in there. So you can't type those structures. You're going to fail. It doesn't matter who your type checking is, right? So yeah, you need to be able to have that, have the whole grammar so that that way as you're parsing you can keep track of whatever type information you need. When you have... When we have all of our inference types... Do we infer that the two types must then be the same or do we say that there's a type that's the same? If they're both gendered. Oh, then they must be the same. So yeah, if a type is being used, so that's all about propagating constraints, right? So you know when you see that that same type somewhere else being used or that same variable being used somewhere else, you know that those types have to be the same. You may not know exactly what it is yet until you continue doing your type checking, but yeah, you've got to make sure those are the same. Yeah? Will you use the same constraints that we have for the project, for the homework? More or less. Oh, the same constraints for the project? Yes, yeah. You can use that. Anything else? Project four? Yeah. If we had an operator type less than an operator then... So we say like both the types are the same type? No. So that's... A numeric type isn't really a type, right? It's a grouping of types. So that's in the project four description. That's kind of what that question was about, right? The project four description specifically states what the type constraint should be on relational operators. So in that case, the only thing that matters are the types are exactly the same and it returns a boolean. So you can use that same logic in homework three. All right. Anything else? Oh, let's get started then. It's been too long. I don't remember how to do this anymore. All right. Okay. So now we've looked at type checking. We've gone all the way through, if you remember, all the way back to the beginning of class, right? We started with, well, how do we define significant tokens amongst a series of bytes in our files and then how do we properly compose those tokens into a grammar so we can make sense that looks like a programming language. And we said, okay, now we know how to parse this grammar. We can write a parser for this grammar. We can create a parse tree. Then what we did before is we tried to say, okay, well, what are the semantics? What do all of these operators specifically mean in our parse tree? What does it mean when we have A plus B or even, I don't know, X is equal to assigned the value of 10 and the dereference and address of operators. So, and then we talked about type checking, right? So then how to say, okay, do the types in this program make sense? What does the type system look like? How can we actually check that? And then we looked at some really cool stuff on how to automatically infer the types of a program. So now we're going to kind of shift a little bit and try that. We're actually going to go pretty in depth here because we're going to talk about the runtime environment of the, of that the program is executing. And so we've talked, abstractly, about locations and names. So when we talk about semantics, what's the, what are the difference between locations and names? Oh no, it was three weeks ago. Yeah. A name is bound to a location. A name is bound to a location? Yeah. So what kind of the location represent what we're doing about circle diagrams? An address? Yeah, I'd say a location and memory. So a location had an address, right? So it's kind of was representing some locations, you know, in memory or somewhere that had some address. So what we're going to be concerned with now in this first part is how does the compiler actually implement locations and names, right? So the compiler is going to take in a program, generate the parse tree, type check that parse tree, and then it needs to find locations, right? It doesn't have these abstract box and circles like we've been talking about. It has a CPU with registers and memory, right? So we're going to look at how does the compiler map names to memory locations? How does it keep track of that? How is this kind of actually implemented in essence under the hood? And how do those, maybe some of those things then go back and help us think about how these languages and programming languages are implemented. So just to be clear from here on out we're going to assume static scoping and all of these examples. So we don't have to worry about dynamic scoping. So we know, it's going to say lane. I said yay. Okay, good. Much better than lane, I guess. Unless maybe you're like a really big fan of dynamic scoping. We could do that. Okay, so we're going to focus only on static scoping to be very familiar to what you're used to. Okay, so global variables. What are global variables? Somebody refresh our memory. So a variable that's ever deallocated in the scope of a program. So then, okay, so I guess I kind of being mentioned it, but. So the question we kind of want to ask is where can the compiler literally place or where can it reserve some location for this variable? So what are the options available to the compiler? You can say yeah. Stack. It could place it on the stack. Yeah, what's the stack though? What is it?  Yeah, I'm talking like physics, like maybe not exactly physical, but yeah. With the stack, it's in those registers that are, I mean, I guess it could put it in the cache. It could put it into the dynamic range. It could put it. Okay, so yeah, we have memory, so it kind of, I guess, depends on what we're talking about as our model of the processor and what the processor can see and can do. So it's got a few things, right? So what does the processor have that's, let's say, incredibly fast that it can work with? Not the cache. Registered. Yeah, so why not the cache? So we're going to see if you directly access the cache. It should be no. There could be weird ways to do it, but the cache is basically some bits that are closer to you and a lot faster actually on the CPU, and they cache some memory locations. So that way when you access them, you're accessing them really close to you locally on that CPU. So what's also very close to the CPU, I think somebody said, is the registers. Right? So there's, the compiler could decide to store global variables in the registers, right? It has the advantage that it's super fast, but maybe what's the downside there? What was that? Yeah, so we may need those registers. Those registers are very fast, so we want to use them for calculating. Somebody else said something over here. Yeah. Yeah, limited space. There's only a fixed amount of registers. I actually should have looked this up. You know, the register account on the x86 processors. I think it's like only six or something. For five or six general purpose registers. Somebody looks that up and then raises a hand. That'd be awesome. So we can place it in registers, right? On the chip. Where else could the compiler place the values? So we kind of talked about the stack, but what is the stack really? What was that? Virtual memory. What was that? Oh, virtual memory. So from the point of view of the program, the program actually has no idea that it's using virtual memory or not, right? So the virtual memory is a layer between the program and the actual hardware that's managed by BOS. To the program, the program gets all the memory. Yeah, the program can basically store it in memory. Eight registers. Awesome. Do you have a list of them? EBS? ECX? ESI? EDI? Wait, EDI? EDP? ESP. And then there's, is EIP in there? EIP. Okay, so yeah. Eight registers. There is the EIP, which is the instruction pointer, but if you as a program can't really control that, you control that all of a sudden, all that kind of stuff. Okay, awesome. That's good. It's going to come up in a bit. So we can store our global variables in memory. We can think of memory as this kind of big thing. We can store it on registers. Where else could we store? I don't know. I think crazy. What was that? Storage. What's storage? Hard drive. Yeah, you can store it on the hard drive, right? What else? Are you on the slides? I guess another way to put this would be somebody else's computer, right? So you could, yeah, you could store your global variables there, right? There's nothing that says it has to be local and it has to be in your process space or even on your computer, right? As long as your program can perform the computations. So we kind of mentioned it a little bit earlier. So what are the constraints on global variables specifically? So semantics wise, right? So what are the constraints on global variables? Or more, I guess more succinctly, or put another way, what are the semantics of global variables? That may influence where we put these things. Yeah. Yeah, so one thing is, because it's global, right, we said that it has to be accessible to every single scope or function in our program, right? Somebody else was saying something too. We don't want to share that out. Where's that coming from? There it goes. He's answering questions. Raise your hand. I look at it again. The sound all comes from everywhere. It's really crazy. Yeah, it can't be deallocated, so that's another thing. So not only it's valid throughout the life of the program, but that memory can't be deallocated. It has to always be accessible. So we talked about who can access that. Are there any limits on who can access or what code, what functions can access our global variables? Not really, right? That's the whole point. They're global, so literally anybody can access them. So, given these constraints, and I guess these four kind of varyingly different crazy options, where would you think would be a logical place to put these global variables? Don't want to argue for one side. Yeah. On what? At the beginning of the program, there's these four options. So which one did you choose? The disk. The disk. That would be really interesting. You could probably do something crazy like that. No, because the disk is, I can't remember the exact term, but the disk is like a thousand or a million times slower than memory, or than registers, which is... Yeah, you can do it in registers, but we talked about you have the problem that registers are being used constantly, right? So if we only have eight registers, but global variables, you know, if you have three global variables, well now we only have five registers to work with. And who knows, maybe we never actually even use those global variables that much. So storing those registers really doesn't get us a performance boost. What's one of the other options? Memory. Memory. Yeah, we want to store it in memory, but I guess we talked about it a little bit, right? So we have the stack, which we kind of envision as this thing that's constantly moving. So does that really make sense to put the global variables there? No, right? Why? Because there might be times when we're not able to access them. Yeah, depending on how the stack moves and changes, right? We want those global variables to be located at a specific location and to have that work. But the other way, the constraint is, anytime we access a global variable, no matter what function or where it is in our program, we need to know how to reference that memory location. And so if it's on a stack and the stack is constantly moving, changing, things are popping off of it, that may not be the best approach. So to answer this question, we're going to look at how GCC compiles a program with global variables to see kind of where it places the variables. So we have a super simple example. We have three global variables. We have a main function. We set A to be 10. So which A does this refer to? Global. Yeah, global A. Awesome, that was a test. B, it's referencing setting global B to be 100. Setting C to some random, I don't know, 10.45 to C as a flow, so we know we could do that. And then we add A and B together and store them back in A. Then we should return to zero. So, okay, we talked about, so compiler knows there's three global variables, right? So we know it has the name of A, right? So then well, essentially what the compiler does is decides, okay, this is where I'm going to put global variables. I'm going to save some memory in the program's address space. And so here, we're going to first go through it kind of symbolically kind of pseudo-coded. So the compiler says, okay, I'm going to store A at location A in address A, and I'm going to store B at location big B in memory. I'm going to store C at location big C. So when it compiles this code, what it's essentially going to do is say, okay, the memory at address big A is going to get the value 10, right? So everybody kind of see this syntax that's, you know, kind of weird, just pseudo-coded where it's saying, okay, we have all the memory. Whatever A is, A is just some compiler-defined memory address. Set that, copy the value 10 into that memory, those locations. And then copying this along, we do the same thing, right? We would set, okay, let's take 100, copy it in the memory location and specify by B. We do the same thing with C with that variable, and then we essentially say, sorry, this doesn't line up right, but I'd say memory A is equal to memory B and memory A is equal to memory A plus memory B, right? So that's essentially the computation here that's performed. And the return and stuff we're just going to ignore for now. Okay. But the compiler, right? The compiler really can't do these symbolic names. And the program that's executing has to know where do I get that memory address from. So when I compiled this program on CentOS 6.7, 32-bit, so it's x86 syntax. It decided, okay, I'm going to put A at location 80, 49, 63, 4 and B is going to be at 80, 49, 63, 8 and C is going to be at 80, 49, 63, 3, C and what did the 0x before these numbers mean? X. Yeah. So what base are they? 16. Yeah. So they're base 16 numbers. That's why you have a C in here. And so why are these all, so you can see these are four bytes or four addresses apart, right? You took the difference between B and A, right? It's four bytes, so why? So we're going to have that word size. It's a word size. Maybe. Yes and no. Yeah. It does have to be word aligned. It does have to be word aligned. There's also another reason though. Yeah. 64 bits. Four bytes is 32 bits, I believe. So this is specifically I compiled this for 32 bits. It's all X, A, 6. That's how you set it. Yeah. Size of int is 32 bits. Yeah. So size of int is 32. So actually it's 32 bits, so four bytes. So that's actually all those reasons are pretty much also valid. The mate and so if you think about it in memory, right, the compiler is just essentially saving these four bytes in between, let's say 34 to 38 for A, and in between 38 to 3C, 38 to 3C for B, and then the next four bytes after C for C. Yeah. So do they have to be one after another like this? No. Right? The compiler can do whatever it wants. It's clearly easier to do this, right? A lot less chances of things going wrong I don't know. It just makes it easier. Yeah. Also four bytes. On 32 bit float is four bytes. I did check that. And I believe a double would be eight bytes. Because it's 32 bits. Correct. So that's so the question is if we in our program took the address of A added one to it, which I believe should do pointer arithmetic and incremented by four bytes, the actual address by four bytes, we would be pointing at B and then we could with the star operator actually change that the value of B. I'm 99.99 percent sure that's probably outside the C specification. And so it'd tell you that it's undefined. So, you know, just like we said the compiler for alignment reasons or for performance reasons, right, could put those at different offsets from each other. I mean, I think it would compile. It would compile and it would work. It would work on this, yeah. Exactly. It would just be if it works exactly the same on every single system. I don't know. Is that okay?  Isn't that how you work? You work with a void star. You would send a type into a specific function and just use pointer arithmetic with the size of that type or something like that. And you would add... Yeah, you can do the same types of things with stars, but for this thing, specifically because you know they're actually laid out in this way, you could go back and you could use the address of A to essentially get to B and change the value of B without ever touching the address or a pointer to B or anything like that. But I think it would work in this instance, but it's not something that generally you could depend on. Okay, so now let's look at the actual XA6 code that this function generates. So everybody is definitely familiar with assembly, right? Yeah. Okay, you may not be exactly familiar with XA6 specifically, but that's okay because we're going to go through it slowly and the instructions here are not that complicated. They're kind of complicated. But before we get started, so assembly especially XA6 assembly, there's two different styles of syntax that people use. One is Intel syntax and one is AT&T and what that depends is, so here I have a move instruction where I'm moving you could essentially, the question is, am I moving from the thing on the right to the thing on the left or am I moving from the thing on the left to the thing on the right? So just to be clear we're using AT&T syntax and if you really, if you want to try this out yourself in the notes on the slides here I've put the command that I ran to get this assembly. So the syntax we're looking at here is the destination is always on the right, so from is on the left destination is on the right and we're moving the important thing here is what's the star mean? Sorry, what's the dollar sign here mean? No. So constant. So this is moving the constant 0xA so what's 0xA and base 10? 10. Yeah, so that's where this comes from, right? So we're moving the constant value 10 into 0x 8049638 634 and because there's no dollar sign in front of here, we know that this is a memory address and not a constant value. So this essentially says move 10, the value 10 into the memory location right here, which is essentially what we know as A, right? So this is what the compiler translate A is equal to 10 to. Questions on that? Okay, then the next line we're going to move 64 hex to 0x 8049638 So what's 0x64 in 100? Yeah, you could check I have to use like a hex calculator to do all these things just because I'm not at the leap level where I can add and subtract hex in my head. Okay, so now we're moving the constant value 100 into the memory address 8049638 which is we know is the memory address of B and so how did the compiler know to put these addresses here? Exactly, so yeah, so all these definitions at the top, so I will take one moment to just kind of step back and say there is, so we're talking about compile time, there's kind of two things there's compilation and then linking if you're compiling different object files and linking them all together so technically this is done at link time but it doesn't really matter, the point is the compiler decided hey, I'm going to put A at this memory address and I'm going to put B at this memory address and so now when I go to compile this code I know any place I'm setting A to B10 I know where A is, I know where the location of A is it's at memory address this memory address. Alright, so then we have the float, so now this is actually kind of interesting because the compiler generates two instructions here so the first thing that's going to happen is a move instruction, moving this hex value 41273333 into the register Eax so in the syntax that we're using the percent sign signifies a register so Eax is one of those eight registers that we talked about earlier and then it's going to move whatever is in Eax into memory 804963c which we know is the address of C so why did it do this so essentially what's the effect here yeah so what's the effect first so what is this value yeah, presumably I should check it but presumably 10.45 in IEEE floating point format which is a 32 bit format is this in hex I think you'd have to somebody can go verify but I'm pretty sure that's the case I think we're going to I was going to say how does it know that it's IEE floating point instead of just regular just confirmation I believe it's the C specification for a float I'm pretty sure it's the C specification that says all floats are 32 bit IEE floating point format I mean the C when you have the memory location at the very top of the float is there like a flag somewhere that represents at this memory address will always be IEE floating point values so the question is is there any guarantee so kind of the question is after the fact that we regenerate this assembly yeah because you just said floating before you said the float and you both have the same amount same size so what's the stopper in there for a whole integer value in there so what is the thing that's stopping us from doing that is EAX a float register? EAX is not a float register EAX is just a 32 bit register wouldn't type checking because that's a fine perfect yes it's a type system that actually prevents us from doing this exactly to your point to the CPU it's all just memory and they're all just bytes and bits right so it's only when you interpret them for something so like it's only when you're doing math on this memory address you have to actually use the floating the floating point operators to do the addition if you try to use the 32 bit or the integer operators to do addition, the two complement it would do it, it'll do it just fine because now at this point when we're in this assembly the program has no idea what's an int or a float or anything like that because all that information goes away and we actually compile it so that's the type information that makes sure that we can't write a program that does that even though the assembly code could do it and do weird stuff okay so essentially the effect is removing this value which is 10.45 moving it into EAX which is a register and then into the memory location so I don't know, anyone want to take a stab at why? I have theories, I actually don't know but yeah it could be, the compiler could be smart so although we can look at this and say well C is actually never used after this so this 10.4 so you know maybe it's a premature optimization or maybe it is an optimization I don't know, any other theories? yeah maybe it's a little more time to convert into a floating point yeah so probably so the main answer for most of these things when it comes down to why does the compiler do this, it's usually optimization so they usually try to do some, so remember x86 does not have so I think most people learn MIPS for assembly yeah so there I think they have it's a reduced instruction set every instruction is the same size so that all a certain number of bytes, the instructions but whereas in x86 instructions can be variable length so the compiler maybe through profiling or whatever realize that hey when I do this with these two instructions maybe the instructions are shorter together even though there's two of them then just copying that one the one value because in the instruction you have to define this whole so instruction has to have the value 41, 27, 33, 33 so the instruction has got to have four bytes at least and so I don't know it's a performance optimization but if you look at the maybe I don't know maybe we have time towards the end you can actually see the sizes of each of these instructions so it could be size or it could just be performance x86 has tons of instructions okay so what line are we at here 1, 2, 3, 4, 5 what have executed we've executed 3 so we're at 4, forgot to have 4 okay so now the code is going to do that computation A is equal to A plus B and so does everybody kind of see that these lines pretty much map identically to this abstract pseudo code we have here in the middle this is pretty much exactly what it's doing it's just saying hey copy this value into this memory address at this location copy this value into this memory address at this location alright so here it's very very similar so we say okay we know the address of A right we know A is located at 34 so we're going to move that into EDX this is a different register and then we're going to move 38 into EAX so now what's in EAX and what's in EDS so yeah what are those values 10 and 100 perfect okay so now presumably we have to do the addition right we're going to add them together this is one of these other things where we get in the weird compiler optimizations so it uses this assembly instruction called LEA which is load effective address this is so the way to read this so we know we're going to do something with the thing on the left that's in the parentheses and we're going to copy it into the register on the right we know that from the syntax so this one of those things we have to look up what this instruction means or the semantics of this instruction right this is basically another language we're learning essentially what this does I believe is takes EAX times it by the third parameter and adds it to EDX and then copies that result into EAX so this is essentially just adding EAX and EDX together and putting the results in EAX so specifically why it's doing this as opposed to another addition I think it's just crazy compiler optimizations but the effect is the same so have we finished this have we finished this instruction yet no cool so now we've done the calculation right but that value of A is sitting in the register it's not actually stored in memory yet so we need to actually move EAX into area 30 into location 34 so any questions on this? okay and this is pretty I don't know maybe clear maybe straightforward but we're going into detail so we want to see how these low level features of the processor affect kind of the language and everything going on and how we can actually implement the language features we want in this runtime environment so that's one of those you have to look at the semantics and the length so I think with a move L yeah I know things for long I think this saves it in that memory location so it's essentially point of view reference I know the memory location copy the value 10 directly to that memory location the L means long and I don't really remember why I don't know exactly why it's used here I'm just curious where did you get these memory or these so I have it in the notes on the slide I'll copy it into the slide when I repost it so there's tools you can run on your try to I think it's still recorded okay so we're here we looked at this let's do all this okay so any questions any other questions on this it's going to cause me to lose any more electors okay so you talk about global variables right so global variables pretty easy the compiler just decides where to stick it and it's a little bit more involved in that but the compiler essentially just says hey these are where they're going and then puts them there so what about local variables so what are the constraints on the local variables be allocated at the end of the scope yeah so local variables are deallocated at the end of their scope so that's one of them they're accessible within the scope so we don't really have to worry about anything outside of that scope accessing them so what would be I don't know what would be the easiest thing maybe I don't want to ask too many questions okay so one thing you can do you're writing a compiler, you're writing a language and you think well I basically just allocated essentially global memory for global variables why don't I just do that for functions too right I can reserve so I know how much space the local variables for each of the functions use right and I can reserve a lot of memory in that memory for those variables is this a good idea, bad idea yeah access, yeah so I could be over reserving or using memory in case I never call a function I'll still have allocated some memory for it yeah yeah so the question then is okay well what if I want to write a function let's say factorial and I'd say if n is 0 return 1 otherwise return factorial of n-1 times n so this work if this local variable or this parameter n if this is stored as a global variable why not yeah get overwritten right so if you only store this n in one global location every time you call this function you're overwriting that value and the function is going to try calling itself by an overwriting that value I'm going to keep on overwriting that value yeah and so you actually can't have recursive functions or even well so you can't have a recursive function you may not even be able to have you really in general can't have functions calling other functions because you have a function calling a function one of those other functions is then going to come back and call one of the functions that you already called then you clobber all the local variables so there's actually early versions of Fortran when you wrote didn't have functions as we know then it has procedures where procedure is just a bit of code and no ability to call other procedures so in this way they could do this this is how they did it, they just allocated global memory to use procedure and said boom we're done but in our languages we want recursion right we want the ability to call other functions and we want the ability to have those functions call themselves or call other functions and they call themselves and this beautiful beautiful recursion so we kind of talked about it but so then okay if we can't do like global static memory where might we want to put these local variables close it yeah put it on a stack or what I want to say is we kind of want so we think about global memory right as this defined here in this specific area right here's global memory and we can access it but what we really want is we want each function to have kind of their own private little memory we want each function to just be able to use the memory that it wants to use but have that be specific to each invocation of that function so that's where that comes in is the stack so the stack we've kind of been talking about it in kind of very abstract terms and now we're going to talk about it in super concrete terms about it exactly what it is and what we're talking about so the stack is essentially this is the kind of way I think about it is it's essentially scratch memory for the function most processors and assembly languages use some sort of a stack and so these are kind of the conventions so what are the what are the operations of a stack as a like a data type push and what and pop and what do they do more abstractly from a a queue is also can be thought of as like pushing and maybe popping the thing about pushing why does semantics different there you're still putting things in and taking things out yeah so a stack is last in first out so you are pushing things on to the stack and then when you pop something off the last thing that you put in is the thing that comes out where as a queue you're pushing a lot of things on you're taking the first one so it's a first in first out where a stack is last in first out so you just have to all of this that are lying here is pretty much just convention right so how the stack is actually implemented in memory on the processor could definitely vary but these are kind of things that would coalesce around so the way it works in x86 is the stack starts at a high memory addresses and it grows down so this could be you know when I use the word down I'm talking clearly visually down but once again remember this is just a convention right this is this is how I like to think about it you could completely flip it around and think that it grows up that's valid too but it's wrong to me no it just looks really weird to me I think of it like growing down moving like this way so the top is always constant and so the function each function can basically do whatever it wants to the stack you can use the stack as its own what I refer to as its scratch memory so it can push registers it can push values onto the stack it can pop values from the stack into registers and actually on x86 the assembly language explicitly supports these push and pop operations so the way this works is the register so we've heard about the eight registers one of those registers is ESB so we've talked about like EAX, EVX, ECX, EVX have you know what the E stands for what was it? extended me so it does stand I believe it does stand for extended but the semantics means that it's 32 bits so before they had a language that's very similar to x86 I actually don't know exactly what it's called but if you refer to like AX or BX or CX you're talking about the first usually the last 16 bits so half of a register because this is why all these things start with ECX so there's a specific register one of those eight registers its job is to hold the memory address of the top of the stack so ESPs holds the address of the top of the stack and so there's an instruction called push EAX which just like you think of a stack pushes that value onto the stack so you can do any register push it onto the stack and so the semantics here are at first and we'll kind of see this visually but at first decrements the stack pointer ESP so this is why we're going down so I start high values, high memory locations at the top until the stack grows to the bottom so we decrement it which means we're growing the stack down so we just created a location for EAX then we push we store the value of whatever's in EAX onto the stack of that location and pop works exactly identically but in reverse so it takes whatever the value is that ESP points to, the stack pointer points to puts in that register and increments the stack up so moves it up so let's look at an example okay so this is how why does it move doesn't ESP always point to the top of the stack so top of the stack I just realized is kind of missing over it points to the there's no other good term for it the bottom of the stack so it moves up to the previous scope don't even think about scope we're just talking about the stack all it is is a register so ESP holds the value you can push stuff you can pop stuff that's pretty much it I understand that what I'm saying is you added memory to the stack by decrementing ESP down correct and so to get that back we increment oh I understand what I'm saying I thought you're also pointing EAX to the current scope in order to figure out where in that part of the stack nope all we do is take whatever values so we're going to see in a second point to a certain value, take that value and then move the stack up for that's it I understand why you would move it up for because that's still the top of the stack alright so okay so we have remember like I've been talking about we have high memory so high memory addresses so what's the highest memory address on a 32 bit system all f's so however many s's it takes right so a bunch of f's so that's the top what would be the bottom zeros yeah perfect so I just kind of think of it as just and I kind of think of it as four four byte chunks but it's really just a bunch of bytes and so there's some stuff from where the current stack pointer is above us so let's say the stack pointer is here pointing at just this memory address it really doesn't matter because it could change throughout so after us so then the question is okay so so when I say top of the stack this is kind of what I mean is that the stack points to 10,000 packs so what's above this higher memory addresses but stuff that was put into the stack prior to yeah the stuff so legitimate stuff or older stuff or depending on when we're executing it's not our stuff so we shouldn't touch that but we know that it's valid stuff right we know what's above us could be legit is our legitimate values that somebody before us maybe was using what about what's after us perfectly fine exactly so garbage that right so that's the whole point is the stack grows down so we're gonna we can put whatever values we want onto the stack and we're gonna go right down you know so all that's basically after us we can consider as garbage we don't know what it is or where it is or whatever we don't care but we're gonna make sure we're done executing and kind of put the stack back where we found it right because otherwise we'll get to that in a second there's only one stack per machine in RAM that's kind of a global stack that you would keep on adding and pushing and pumping so here's the way to phrase it is every process has its own stack so different each process in your operating system each has its own stack they're all in memory because of virtual memory you don't have to worry about clobbering over each other or stepping over each other's toes okay so we're going to look at two super simple assembly instructions push dax pop ebx so the way I'm going to do this is I'm going to represent the register values in the lower the left eliciting and so there's as we learn there's eight values, eight register values but we only care about really three we have dax ebx okay yeah we have dax which has some value whatever we have ebx which has some value and we have esp so what's the value of esp yeah yeah so it's the address of the current value where the stack is pointing so it's pointing at 10,000 that's where it's pointing to so remember so there isn't actually an arrow or anything in memory or on the processor right this is just a visual representation of whatever is actually in esp so this is what controls where the stack is and where the stack is located okay so the first thing we're going to do is we're going to push dax um so this is the first instruction that's going to execute here so when we push dax what we're going to do first de-increment the pointer so we're going to decrement the es key essentially moving it down how far are we going to move it down how old of dax why because if we don't then there's not enough memory to store all dax right so dax is a fixed size right and so we're going to put whatever is we want to put whatever is in dax onto the stack so we have to make sure we're moving the stack pointer down enough to put whatever is in dax so from what I just told you dax is 32 bits so we're going to move it 4 bytes 4 bytes down so we're going to subtract 4 from 10,000 which is no we know it's in dax that's in dax so it's some hex value fffc which is then going to move the stack pointer where 1 or 2 sound like we're at the eye doctor 1 or 2 1 or 2 are they the same 1 1 or 2 1 or 2 2 why 2 we can use moving into memory that we can use there's a couple ways to remember right so one way would be well the stack is growing down so we can't actually go above 10,000 because somebody's using that memory right so we know intuitively we should be growing down we should be going down the other way to think about it is why know this value is fffc right and I know here's all zeros where's fffc going to be 2 yeah it's going to be this one here right so then what's this address assuming they're all 4 bytes 10,000 right 10,000 10,000 in hex okay great so we we successful okay now we haven't actually so now we're going to actually then so we did half of that right so we incremented the stack pointer for we started the stack pointer we moved the stack down 4 bytes then we're going to put eax in there in memory so now when we want to execute the pop instruction now we're going to do exactly the reverse of what we just did right so the first thing we did was decremented the stack pointer put the value so now going backwards we want to pop the value increment the stack pointer so we're going to then when we execute this we're going to take whatever's at fffc take that put it into ebx so it's going to be 0xa and then we're going to add what to esp4 and add 4 so we're going to increment esp by 4 which is going to move the pointer our stack pointer where up yeah so it's going to be right any questions on that very important before we go on yeah so where eax is right now and the stack is now considering garbage data exactly yes so kind of a little forward hinting if you recall we're looking at garbage values and we're looking at getting values that were deallocated what values they had and we saw that it changed depending on compilers and all that stuff that's because we essentially had the memory address of something on the stack and so through our function calls and through stack manipulation that value got overwritten so anyways we may go back to that we'll see so we talked about the stack so not only to get an intuitive understanding of what's going on but an actual physical real processor level understanding of what's going on at the assembly level so what is this all about why are we talking about this so the main idea is that for functions so we talked about it right the ideal place for functions to store their local variables would be on some scratch memory and it seems like a stack is a pretty good place to try and do that so the question is we want to use the stack to kind of allocate space for our local variables but can we use the stack pointer for this yeah so we could basically move the stack pointer down enough to allocate memory for our variables and then later in execution we can kind of refer to those values and use those values on the stack and then afterwards we can kind of make sure to bring the stack pointer back yeah that's definitely, we could definitely do that so what would maybe be a downside of that yeah you don't know where the scope of those local variables ends because you don't so if you move the ESP down then you have the top of the stack you don't know where that extra chunk ends that we just added so that's a very good point so we're going to definitely want to use the stack for our local variables but what else might we want to use the stack for so how many registers do we have 8 total right is every function going to use only 8 variables or less so what happens if we need to use more than 8 variables what about temporary variables right you can easily write an expression of 5, I don't know, a times b minus c plus 52 divided by 120 times whatever some other thing right you can easily create an expression where you need more than 8 temporary variables so that's why we want to store those yeah so we don't really want to store them in a global location right so we're going to have the same problem as recursion so we really would like to store those on the stack because it's our private little scratch area but then that leads us to a problem right so if we're changing the stack pointer but we we kind of said hey let's use this memory for these local variables with the stack pointers changing but how do I know how to get to every time I reference it is that why you move the sp back up almost so we want to move the sp back up when we're done so we want to leave the stack at the same location when we found it the main problem is as our function executes the stack pointer can change and ideally we want each of our so if you think about the global variables the global variables are kind of like so they're at fixed locations but we kind of saw you could think about it as well I maybe could have said hey let's start at this location and then each variable is an offset of that location so 1 is plus 4, 1 is plus 0 1 is plus 4, 1 is plus 8 so I may want to do the same thing here so I what I really want is some way to say hey somewhere on this stack that I've created for myself at offset 0 is variable A and at offset 4 is variable B and so that's where this concept of so instead of using the stack pointer which can change we're going to use this idea we use this idea of a frame pointer which points to the start of the function frame on the stack so you can think of the frame as being the part of the stack that your function is responsible for so that way you point that and we'll see exactly how this works you point that at the start of when your function starts executing and then you can use that as offsets and now the stack can grow as your function goes but you can always still use that to compute offsets so essentially what's going to happen is each local variable will be different offsets of the frame pointer and so in x86 it's a little bit confusing we'll use the term frame pointer or base pointer because it's in x86 it's considered the base pointer and it's stored in the register EBP so another interesting thing we thought we had eight registers now it turns out we use the stack pointer for important things and we're going to use this register EBP for other important things we really have a lot less registers than we think we do so let's look at kind of that similar example to our global variables but now bring those A, B and C variables into main scope so here we have our function main we have local variables now A, B and C A and B are ints these are floats we set A to 10, B to 100 C to 10.45 set A to B, A plus B and return 0 so now what does the compiler do to decide so in our pseudo code what does the compiler do for each of these variables move them into register we're going to ignore registers kind of for now because we want to think about so we definitely want to store these variables on the stack right so we kind of already said we want to use a base pointer and we just want to use essentially all of the variables are going to be offsets of that base pointer so that's all we're going to do is the compiler is going to define what these offsets are and it's going to say okay A is located at whatever is in EBP plus A B is going to be whatever is in EBP plus B C is going to be whatever is in EBP plus C then we set that memory location to be 10 this memory location to be 100 and this memory location to be 10.45 and then the final step is going to be this memory location so the big difference here from global variables right global variables have one static location but here instead of static locations we're going to use offsets from the base pointer does that kind of make sense okay so when I compiled this the compiler decided that it was going to put A at the base pointer minus C B at the base pointer minus 8 and C at the base pointer minus 4 and so this is how the assembly looks so it first so it first moves the stack pointer into the base pointer so why does it do this? to save where you're working for almost so to save so our function executes the stack is at a certain location and we want our base pointer to point to essentially the top of the stack when we start so that's what all we're doing here is saying the base pointer is whatever the stack pointer is right now so remember at this stack pointer point everything above us is garbage or everything above us is important and anything below us is garbage at this point so we'll see how this is used so we're saving that location then we're going to subtract what's OX10 in decimal for base 10 16 so we subtract 16 from the stack pointer so what does this in essence do to the stack pointer allocated so remember that memory is already there right so all we did was move the stack pointer down port down 16 bytes so where is EBP pointing to right now the original stack location so 16 up so EBP here and the stack pointer is now pointing to here so then what's EBP minus 4 where is that going to be so we have EBP at the top ESP at the bottom EBP minus 4 is that going to be above or below below is it going to be outside the stack no so essentially minus 4 and then minus 8 and then minus C which will be 12 right that's all in that space that I just you can think of allocated right because we're moving the stack down but so we're essentially creating room on the stack for our variables AB and C and now if any of that other code needs to push something on the stack or pop something it's fine it's not going to mess our offsets from our base pointer so these are pretty much the only things that are different from this code versus the other code the global variable so in this code we're doing the same thing we're going to move the value OXA which is 10 into mine so this is this syntax says take EBP and minus C from it so that's doing just this operation so move the value 10 into EBP minus C move the value 64X into EBP minus 8 what's EBP minus 8 B yeah it's the address of B and then we move that crazy value into EAX then we move EAX into EBP minus 4 and then we're going to move 0 8 EBPs what's EBP minus 8 EBP minus 8 is B so we move B into EAX so what's in the value of EAX in the EAX register right now 100 and then we're going to add EAX so when it's an ad like this it means you add EAX to whatever to EBP minus C and store that value into EBP minus C so this essentially this essentially takes EAX which was 100 adds it to what's in EBP minus C 10 8 right so yeah minus C is here the value is 0XA which is 10 we're just going to add that and then it's going to store it back in there so now at the memory address A which is EBP minus C we have the value 110 we're going to add that how did you know how did you know the offset the compiler decides the offsets so the compiler knows for local variables I'm going to use the base pointer and I'm going to assign each variable a different offset of the base pointer the compiler stores it when it looks at this function yeah so the compiler knows exactly how many variables I declared and it knows the base of all those variables so it can generate this subtract to create the space and it knows all the offsets that metadata the compiler uses it and then that offset is stored it has data itself it's the only data it is right here we're going to go into it we're going to go into it