Thank You Martin. I see this is on. Did you say seminar or sleep after yeah? This is going to be tough because after following probably the greatest jokester in the philosophy circle, Henrik Suss and Martin is known for his for his witticisms, though two of them are keeping us often in stitches, so I'm not even going to try. I'm just going to go right to what I would like to do with you this afternoon, which is the Q&A essentially and to get you involved in helping me think about certain kinds of cyber conflict and what we are to make of them and the reason I thought would defer to you is because generally it's the case that while I'm very interested in this stuff I suspect many if not all of you know way more about it than I do and So you'll have some intuitions that would help guide us. In fact, I was mentioning to Henrik this these cases that are Are up here now that I'd like to to talk to you about Come out of the Journal of Military Ethics In a debate we're having trying to understand how cyber war and cyber conflict ought to be Understood by looking for appropriate analogies in the real world and figure out what we would do then and then figure how Whether or if this translates over into the cyber realm so let me start with that and The the first case there asks you if you would how you would react to a scenario in which real human beings wearing real black ninja suits As nation-state agents from a foreign power were observed detaching real You know bombs and mines and grenades and explosive devices to bridges power stations dams air traffic control centers in Aurora Illinois and so forth to set them on fire or to disrupt them if that happened and We observe them How would we as a nation? How would our government? How would you in the military? think about respond to What would you propose to do?  Obviously living in the US that would be a huge difference compared to what normally We're exposed to so I mean I think first you go through all the phases you fear and then you question it anger and anger yeah, and then How long it's going on and what the motive is and the motivation and obviously response there you go It's a yeah that fear and anger Outrage terror This this would not sit well with us. I assume We would assume if we captured some of these people and discovered that they were state agents that they were from a foreign government As I mentioned my first would be all their terrorists. Maybe they're domestic terrorists. Maybe they're foreign terrorists. Oh, no They're coming from The People's Republic of China or they're coming from North Korea Let's try North Korea just for the sake of argument We discovered that these folks are from North Korea What are you gonna do with them when you've arrested them and and discovered this Anybody what would you want to do with them? What would you want to do about North Korea? Yeah, there we go. Well, I think that's one of the things we struggle with now, sir I mean we right we invaded Afghanistan after 9 11 because they were harboring terrorists and then we capture the mastermind And we try them as a criminal not as a agent of a non-state actor not as a Warrior but as a criminal so I think the issue would be up to the politicians when we treat these non-state agents as Agents of the state and thereby hold them under war powers or we treat them as criminals and just put it under the umbrella of terrorism There you go. That's an interesting point is what we have here a criminal act or Is it a? state-to-state Interstate conflict How do we treat the individuals if we apprehend them do we treat them as criminals and put them in jail and put them on Trial for domestic terrorism for acts against the safety of the public or When we discover that there's a conspiracy and a nation involved behind them. Do we do something different? Suppose just for example that this didn't happen once it happened several times first time Maybe we found the devices and said who the hell put these there and we took them down And there was a hubbub over you know Do we have terrorists in our midst and our? Surveillance devices sufficiently robust to catch them and so forth and Then they come again this time we see them people say they're people in black ninja suits up there on the bridge And they're putting explosives up there and the police come and they arrest them and They find that it's not just one city, but many cities where these folks have been and they're doing just that they're putting up Explosive devices on vital infrastructure. It's quite clear that the infrastructure itself will be damaged and in the course of that damage If those things should go off People will lose lives There'll be a lot of a loss of life So we arrest her we put him in jail now what?  Shall I come down and grab everybody? I don't know make sure Help me out here. I don't know what the what to do about this. What would you recommend? well at this case it's not good after we consider it as the criminal case in the morse is We have to do well we have to return whether it's the terrorist act or not it depends on The purpose so depends on the agency can find out more information of behind the purpose who back in the month Are they yes? They from North Korea, but they're backing up by the government's or they just rock agent So so we do really know the intention behind the roof So we can't really go full Military to military action again that nation whoever it is We have to find out more until before we make Okay, so we're gonna need some more information. We're gonna have to interrogate these folks and That yields all kinds of interesting and difficult prospects in itself, but suppose they're truthful Yes, we are agents of the government they say the government of North Korea the government of the People's Republic of China or something They identify their nationality and they they say their work. Well, of course. Are they telling the truth? We need to know that so presumably we get on the horn or we send somebody to if it's the People's over People's Republic of China we go to the embassy we complain we just caught your guys And the emissives well, we don't know who they are, you know, they don't work for us And we don't have diplomatic relations with North Korea. So we don't have anybody we can obviously ask But the agents who are doing this stuff tell us they're working for a government We need to know if they are and then if they are and we know who the government is all these questions about accountability and so forth we need to tell them to cease and desist or What we've caught your agents now doing this two times they say they work for you you deny it But then they keep coming back. They say the same thing. Oh, no, they say something else interesting. Oh, we're not gonna set these off We don't intend to blow up anything We just want these in place in case You should get involved in our internal affairs over on the other side of the Pacific or something and Then if you get into an altercation over there, that's none of your beeswax We'll set off a couple of these things, but that'll be after you've done something wrong We don't want to do anything.  That's what we're doing. It's harmless We don't mean any harm. We're not gonna set them off and they will go off accidentally unless you get involved in our internal affairs like Arguing over who owns the Shinkaku dial you islands or something. That's none of your business. That's our business We have a treaty that we signed back in Cairo in 1940 that says the islands are ours And then when everybody got together after World War two and Potsdam the Americans and the British and the French and the Russians all said the islands are ours and So we have it right here in writing. Oh, but the government changed. Oh, well, that doesn't matter We're still China Chinese those islands are ours Now if we try to take them and you try to interfere We'll set these things off But if you stay out of that, you've got nothing to worry about Now that's the story the ninjas are telling you where the Chinese embassy is we don't know who these people are They don't work for us This is a fantastic scenario So now we're into international relations to help me out here. How do we handle this? What's the next step? It's like a war game here Except well, that's the question. Is it in fact a war game? Yes Well, sir lieutenant commander Alan Hester. I would say in this specific case of them Installing these devices I'll be it not planning to set them off unless this then and that occur They still impinge upon our sovereignty and that by itself is problematic Right. It sounds like even just that Not single but constant infringement of sovereignty violation of our rights of sovereignty and Appearing to put our citizens in jeopardy would invoke what in the discussion in our by dr. Seuss in the preceding Our lunch would that this is a just cause for war. Isn't it or is it? Do we threaten to go to war over this? Do we threaten to do something to the Chinese or to the North Koreans or to some of their hardware or what? Exactly would we do if this just kept happening, especially if we arrested them? We yelled at the embassy Folks we yelled at the ambassador. We denounced the actions in our press And then we sent the people home and said I'll go home and don't do this again And they kept coming back. Oh, yes, here. We are fixing more bombs on your bridges and so forth How long does this go on? Before we do something and what do we do? We've tried negotiations. We've tried arguing. We've tried denouncing people We treated these folks as prisoners of war and repatriated them on the grounds or at least on the promise Despite the denials that this wouldn't happen anymore and it keeps happening anyone This is your field not mine I mean, I'm I'm one of those people dr. Seuss was making fun of you know philosophy professor You know, I talk about abstractions and weird stuff and trolleys and all right and pushing people in front of them Preferably my colleague Martin when he makes bad jokes and so forth So what what but this is your field. What would you do? What would you recommend being done? What would be being discussed in the ward room at this point? Yes Okay, send special forces and we'll do the same thing exactly reciprocal to them You know, but this is dangerous work. They're lucky. They didn't get themselves blown up or killed and we have no Guarantees that if we sent our guys, they would be treated so well as we treated these Agents of a far alleged agents of a foreign government, but that would be a possibility Exactly a symmetrical reciprocal response any other thoughts How serious is this especially since no harm has been done and the agents involved in setting these Trap door devices or whatever it is these these these these bombs Are saying well, we're not going to set them off. We're just using them as a deterrent Now, obviously you see where I'm going with this but I'd like some clarity because really there are differences of opinion amongst those who argue about this and the pages of of Martin and Hendricks journal. I'm one of them. I Mean, I think I know what I'd do But I'm not sure that we know collectively and certainly would disagree on on what we think we should do Is this a serious enough cause For military action of some kind anybody Yes, yes, I think this case we can take a page from history and this is More scale Okay, so you all heard that that could be essentially Cuba missile missile crisis now taken into the 21st century that this is something like that planning nuclear weapons on soil 90 miles from the American coastline is seen as a hostile act even if the argument is It's all defensive. We're not going to use them. We're only going to fire him if you in the US Try to invade Cuba again or do anything else that really is is You know Defiable from our standpoint only then would we ever use these so they're a deterrent They're not there. We're not these are not offensive weapons and some argument like that's being made here We're putting these not just off your coast But inside your country on your infrastructure where people live and work and travel to work every day And they're threatening the power and the water and the food supply and the transportation system But we're not planning to to use them. We just want to deter you from military Interference and adventurism abroad in our own affairs So is this like the Cuban Missile Crisis does this call for something as dramatic and you remember Historically at least that was about as close as we've ever come to to fighting an all-out nuclear war it could easily have become one and We were certainly prepared to do that if that's what it took I mean that's an interesting case, but okay, so is this like that? Yes. No, how many think yes This is like the Cuban Missile Crisis. This is pretty serious. How many think I'm not so sure this is a big deal People what who cares if they put bombs on our bridges? Okay?  Soon I promise soon. Yes sir, if you're if you're leading us down this cyber threat, it's It is different What it is different. Oh I look at history. I think the more things change the more they say the same You're talking about the cyber and you're talking about information. Okay, I look at the same sovereignty issues That happened during the price of reformation even Gutenberg with his premium prep and I look even just a little bit further down history and see he the communist threat and then the You which hunt that occurred in our own country because of ideas. Okay, so What is a threat we're making a lot of assumptions here. Okay, okay? That's so you would be nervous making this analogous to the cyber case, which is the next case up there Is that right? You don't think it's a good analogy Well, it might not surprise you then to think that some of the contributors and readers of the Journal of Military Ethics Also, don't think this is a this isn't these two aren't closely alike They're different. So you think the first one though the real physical one is serious Okay, so the first one if it occurred would be serious But if we turned it into a cyber case, then you would want to back off No, I hear a no say some more No, I think a cyber attack depending how serious it is which they're starting to occur in more frequency We're gonna have to be a little bit more aggressive Battling back in that regard the first one definitely gets me agitated Okay, and I think you do have to have some type of Threat back to them of equal kind. Are you a Marine by any chance? Yes. Ah, thank you. Good. I Was I was I was gonna plead for some help and An expeditionary force to say come on guys if you know the first one that worries you the second one though Say that again. It's not clear. You're gonna have to do something, but you're not sure what?  Yeah, okay So if we would send special forces in the first case to do to them what they had just done to us We would send cyber weapons and trap doors and sabotage and oh by the way We do and we you know full well more than I do that we already do this stuff We're kind of at war now if you want to call that a war There's a constant state of low-intensity cyber conflict We all know this and we're doing it to them and they're doing it to us and so forth The question is what to make of it see and that's the thing that we were arguing about In the the Journal of Military is this serious and grave in the way in which the first case seems pretty serious in Grave a violation of sovereignty a threat to the life and well-being and Property of our of our citizens a direct action against which you know We would think we would be entitled to do something equivalent at least to the Cuban Missile Crisis and maybe something more an embargo Special forces sent to do that and what they've done to us and so forth and then The second piece of this as well if we put it into the cyber realm as I've done and I tried to make these look identical except obviously for the fact that in the second case the trap doors are not actual Dynamite and TNT and stuff. They are software programs that will end up doing exactly the same physical damage to those pieces of infrastructure as the dynamite and The grenades and the TNT or whatever the hell the gingers were putting up there So that when the smoke cleared in both cases There would be rubble if they went off There would be rubble where there had been bridges and there would be people who were on them who were killed as they collapsed There would be floods as the dams burst But the dams wouldn't burst because dynamite blew a hole in the dam They would burst because a software program caused an electro Turbine to you know do like I did at Sandia and just you know operate faster and faster till the whole thing blew up and exploded and that explosion Do I care whether it was a Exploding hydroelectric power generator or a piece of dynamite that blew the hole in the dam that killed I know a hundred thousand people and flooded half of the Southwest. Does that matter? No Okay, the effects are the same So whether I use a cyber weapon or a physical weapon whether I put the thing there by sending a ninja to Tie up the bomb as he would have to do on the bridge or the dam or whether I send it via my keyboard and and send a worm that Somehow infects by software that's running the power plant or whatever if the physical effects are the same It's the same Yes, no Sorry, I believe that the who did it matters So is it North Korea or is it China? Is it another is it another nation that we feel ha you should take action against and win decisively Or is it someone that we feel would drag us into a prolonged war and I think that that in and of itself would dictate What a response okay, so they're the same in terms of their effects But in both cases we would as just as we said we have to verify the stories of the ninjas Are they really from China really from North Korea? They say you aren't we would have to do the same thing in the cyber realm the problem of attribution and accountability We'd have to do our cyber forensics and figure out that the software that was planting the devices In the trap doors Getting prepared to sabotage our our infrastructure did in fact come from Shanghai units six one three eight four Whatever the hell it is and if we did know this You all know we've indicted five Members in u.s. Criminal Court five members of the People's Liberation Army in that Shanghai unit by name if they should ever travel to the United States They would be under arrest Now of course We don't expect them to oh yeah, it was me. I'm here to turn myself in We don't expect that to happen. We just wanted to address this question. We know you're doing it That's how you know and you can deny it all you want But we caught you red-handed your fingerprints digital fingerprints are all over the software you not just China not just PLH Shanghai unit six one three eight four whatever the heck it is not just that you Colonel fang have done this and you wrote the software We we know you did it and you're under arrest if you should ever come to the u.s Or if we never get hold of here, we're going to put you in jail put you on trial. Yes So I think there are two big overlying issues here first of all the effects are the same okay Not every cyber issue is going to blow up dams and rain fury So there are actually lower level cyber effects that may not be the same as bombing bridges The other piece that you have that's very different is the aspects of time and space The fact that you may have these trap doors off u.s. Soil or the fact that somebody can reach it from China almost Instantaneously, and you don't actually have to move people across the world I think these two issues are the bigger underlying pieces in the overall discussion Okay, thank you your Cadillac escalate is waiting outside the prize you For for beautifully segueing into the problem that yeah if this was as simple as it was Maybe we would have learned something the clear equivalent effects base kinetic scenarios At least and where attribution is not a question and we can figure it out We know it's the Chinese just like we knew it was the Russians putting the missiles and the On Cuba we know as the Chinese putting these trap doors in our in our software and they're going to do the same thing We've indicted them by name yada yada yada even so things begin to erode the analogy Like all analogies isn't precise and in a way a lot of what we do in international relations ethics law Just war theory is look for analogies that work Because we don't know how to think about this stuff This is a brand new domain You could compare it to how I suppose one of our Mutual friends another another brilliant philosopher by the name of cook But no relation to Martin just a good buddy James Cook who? Colonel James Cook out at the Air Force Academy has likened this kind of situation We're in now to what it was like at the dawn of the age of aviation You know we didn't have any rules nobody had ever flown before and pretty quickly just as here We get all kinds of stuff in the air and some of its government stuff and some of its private stuff You got Wright brothers flying around and then Wilbur opens a defense contracting industry and Dayton, Ohio And we're off to the races right and we didn't have any rules governing this so what did we do well? We said well, this is not unlike navigating on the ocean. We have all you Navy guys We have all these lights and patterns and you know rules of the road and stuff Couldn't we just take these and Jimmy them a little bit and make them work in the air? Which is what we did right and now we have Government planes and private planes and commercial aviation and military aviation and all kinds of stuff going on it Without confusion with no problems whatsoever, you know everything is smooth lot orderly and so forth well Maybe not but at least we know how to get around and deal with a lot of different kinds of phenomena and activities in the realm of aviation that we didn't know how to deal with in 1903 and Jim predicts Jim cook predicts. We're gonna do the same thing in the cyber realm Okay, I'm here. You're here. Let's do it Hey, there's the problem the doing of it. What are the comparative? You know, how do we draw the analogies? so I started out with two and I think we've beaten those two to death and We're not finished yet. We're sort of we saw some similarities We saw some differences and most of us sat on our hands. We weren't sure exactly what we should do in either case But we were sort of clear it sounds like many of you seem to say in the cyber case Whatever we would have done in the actual real-world case. We would dial down a little bit We would back off because things would be even more vague attribution would be vague Damage would be difficult harm to assess and so forth So we'd want to tread and then we can act at the speed of light rather than having to transform Transport our troops and project our power over 3,000 miles of sea space and in the air and so forth here You know since we could act quickly, but we don't know what we're doing. Maybe we better take a deep breath And keep our finger off the button And keep working on trying to understand this and keep yelling at the Chinese and see if we can work something out Let me just pause there questions comments so far so good. Yes Yes, sir. Just one more comment a lot of the effects we can get from cyber have been Noted and I agree that we can get kinetic effects But cyber also adds one more option that we don't get with physical bridges And that's at least the theoretical possibility of making our cyber bridges impenetrable Because these cyber hacks these worms these Viruses that infect our programs happen due to software flaws that allow data to make the program do something It was not designed to do But the program in any case is doing exactly what it was programmed to do It's a flaw in the programming right. Yeah, so at least in theory We can focus on making programs that can't be hacked that Be denied their service, you know, due to things that aren't up to the program's control But they don't have to be wide open sieves like we buy today That is an interesting observation and a really good one in that I have a colleague at postgraduate school who I used to remember I retired Um, but um, I had a colleague. I still have a colleague at postgraduate school. Who's a computer scientist and he says, you know these Cyber vulnerabilities in a way. They're not like the bridge vulnerabilities. I'm not going to go get the engineer and say Why did you build a bridge that went over water now the Chinese can blow it up and drown people? I mean No, maybe there is a flaw in the bridge and maybe they exploit the flaw But but presumably the flaw in the construction if any is not really what's an issue It's the dynamite that the ninja is attaching to it flaw or no flaw is going to blow it to kingdom come Whereas in the case of cyber You know, this was bill gates fault He hired all these computer software engineers paid him a munt had them all working and not really knowing what the hell they were doing And every vulnerability or at least most of the vulnerabilities are microsoft vulnerabilities are or software vulnerabilities And my computer science friend says a few idiots who like me who Do the computer programming if you'd done your job right there wouldn't be any cyber conflict because there'd be no vulnerabilities to exploit Well, I don't know if that's fair. I don't write code. I don't think I could I think it's very complicated Maybe this is just a problem of dealing in a realm that is so complex That nobody could ever Do it perfectly and somebody else would sooner or later be smart enough to figure out where they'd screwed up And that that's the world we built for ourselves a world of vulnerabilities and internet of things so I've got a app on my phone that can you know Turn my hot tub on at home I've got another app on my phone on the car.  We didn't do anything. We were innocent. We were the the the just warriors In the first scenario who are being unjustly attacked by the ninja people strapping bombs to our our infrastructure But we sort of set ourselves up for the cyber case and so does everybody else And the deeper we go into this the more stuff we do the more Programs and apps we write the more vulnerable we make ourselves to being attacked So maybe that means when we are attacked we can't be quite as indignant As I think My colleagues in the marine court at least we're ready to to go to do something about this, right? In the in the kinetic case we we know how to handle that, but maybe we can't be so indignant and so clear Uh in the cyber realm well the segue for which you earned the Cadillac Escalade that's out in the parking lot was to talk about something else that's going on It's even more vague now that really is the subject of what I wanted to discuss with you At least in that preceding case There was a close analogy wasn't there between um The sabotaging physical sabotaging of our infrastructure and the cyber sabotaging of it if the cyber sabotaging was meant to destroy it physically Now we've got a different kind of problem. We know these groups You all know anonymous. I think some of the others you might not know so well And in any case none of them are state agents Lulzak is a black hat organization of some kind that kind of takes great delight In exploiting the folder abilities you were just talking about they just they're very smart folks and they like to poke fun at banks and I think they went after sony pictures And I don't know who else have been their their targets But they they kind of do stuff to them to show I know how your stuff works and I can make it screw up anytime I want to And to prove it. I'll deface something or make it not operate Okay, cyber warriors for freedom. That was a much more political group in Azerbaijan I think I mean we're not sure where they are where they're but but the issues against which they were specifically protesting um Were had to do with freedom of expression and some film festival that was being held in Azerbaijan as far as I know Anybody heard of these groups before anyone Yeah, okay a couple a couple of you Uh, well, everybody's heard of anonymous, of course. They they make themselves known Kind of interesting. They're anonymous, but everybody knows who not who they are, but that they exist. Okay Well, yeah, what happens when the kind of things that that group does These are technically on that first line. Those are criminal actions, right? They deface public websites They attack banks and shut them down They might steal data or at least show you that they could if they wanted to but they don't Criminal acts But they're not carried out like The 35 russian kids who were stealing us all blind and stole 150 million dollars before the fbi Took the nsa software and caught them another story um but um These guys are not enriching themselves presumably at our expense They're committing acts of political protest and the term for this that we've developed is political activism We take it to computer hackers and we come up with the acronym hacktivist And that was the title of my talk hacktivism Excuse me, but it wasn't just hacktivism. It was state sponsored hacktivism Which seems to be very different for what was on that first slide Very different from the thing we're objecting and have indicted the five members of pla shanghai unit whatever it is 61398 there it is This seems to be demonstrations of disaffection and political protest carried out first initially By private groups like anonymous individuals or Groups of citizens. We don't know who they are But they tell us what they're mad about right And they do things that would be considered criminal acts Like defacing public property and trespassing and possibly even theft of of property With a political purpose in mind not for their own financial gain or sometimes Vandals just do this kind of stuff because they're alienated Computer geeks, right and they don't like anybody. They don't have any friends And so they sit there and mess everybody's facebook page up or something But this seems more serious than that Okay, so far so good Now we find that hey The russian federation did this if we go back and think about what happened in estonia In 2007 the famous much-analyzed cyber attack We could look at that and say well what that was mean the russian government denied any knowledge right And they said wait with this these were just patriots patriots upset with behavior of estonians who are moving russian statue from center of town to military cemetery And they are expressing their outrage. How can we possibly control? Well, I don't know And that's a question. Did you put them up to it? Mr. Putin, did you know about this? Do you approve of this? Did you encourage them? Did you give them money? Are they organized? Yeah, we don't know right? We have no idea So it looks like it's possible at least that the russian federation engaged and actually an article came out in the Wall street journal just a week ago I was thinking about this and coming here and what am I going to talk about and here Was the piece that said hacking trail leads to russia and experts say malware found at us firm where military secrets were kept The fire I folks, you know the security group found this and discovered that Not only was it the russians doing it But he said, you know, they're Much more dangerous than the chinese We got the five pla guys because they're not as good the china the russians are really the super duper cyber experts And this was a considerably more sophisticated set of attacks of this kind Than we've ever seen before on american banks and financial institutions and you name it Okay, but they're not taking anything They're not taking your money They're just keeping you from getting at it for a few hours They're shutting down trades and exchanges which could cost you something if you're investing your retirement funds as I did in the stock market And that's why I'm here now because I don't have any retirement funds And so I have to do little gigs like this to keep afloat But um, they're generally They're not doing any harm and the harm they do is reversible and put it all back We could stop the ddos attack The distributed denial of service we can Restart the frozen accounts that we've locked We can give you the password to the malware that we have, you know, installed on your computer and you can remove it after A time just to let you know that we can do this to you Or once our dispute with you is solved point is states Have been involved from fairly early on In doing a thing that otherwise we would think of as acts of political protest by individuals and groups of citizens Or groups of vigilantes. I don't know. I'm looking for the right way to think about what these things are doing What these people are and how we should think about them This group here the cyber fighters of is al-din al-qasam Is an interesting example. How many have you heard of the cyber fighters of is al-dim al-qasam? Yes, no New to you. Well, the is al-dim al-qasam was a Muslim cleric Who was an anti-colonial Fighter in the middle east of the 1920s 1930s About then and these cyber fighters this they've taken their name from this exemplary Muslim patriot Who tried to fight against colonial powers largely brit? Who are they fighting against? Well, they took credit for an enormous attack on the 11th anniversary of 9 11 on us financial institutions And this is one if you watch the nsa revelations taking place after Snowden revealed his You know that that he had stolen all this information and blown the whistle and then they let you in and so forth they showed you A system known as treasure map where you could see these attacks occurring all over the world I mean it was like something out of batman The dark night rises, you know if you remember the thing that That the police chief had in his office or something you could see all this kind of communications and nodes and networks all over the place Well, we actually have something like that Treasure map is the the program that keeps trap of these keeps track of this and this was an massive attack One of the biggest ever suffered And it was highly successful for a while then it went away And then this group tweeted that they had done this and they claimed what they were doing It was a political act. They were protesting The continued Availability of the film the innocence of muslims How many of you know of the film the innocence of muslims? Okay, this is the film that some american filmmaker made on his own very critical of his law I'm kind of portrays the prophet as a Well in a very very negative light And so the claim was we did this to you As an act of political protest Against your in the u.s. Showing this film. We want the government to take it down Stop for one thing. We can't do that right? I mean, I think a lot of people would like to take the innocence of muslims down innocence of Of islam the film down because it's offensive and it causes us trouble and it could get Some of our guys Killed in theater Out of the reaction of angry people who think that we're all in this together Defacing their religion and their their faith So this seems like something would like to do but guess what this is a democracy the government does not have that power Right So we can't do that So why ask? I mean you could protest but why ask us to take it down? We can't do that and then a Another funny thing was noticed that the tweet site the anonymous site where the twitter feed for the cyber warriors of Is al-Din al-Kazam Was announcing this was the turned out to be the same site when the fire I guys looked at it and the semantics security guys Looked at it That's the same thing that was used to announce the attacks on aramco in Saudi Arabia a few weeks earlier Huh all starting to make sense The banks that were attacked weren't just every financial institution in the us They were banks that were complying with the us economic embargo against Iran So put this all into the hopper What does it look like? Just detective work here. We've got attacks on banks that aren't aren't releasing funds to aram We've got attacks on aramco and the same tweet site used for this What's going on? Looks like state sponsored retaliation for Stuxnet and Operation olympic games and so forth Yeah, it looks like this is state sponsored. It's iranian. We don't know this But it sure looks like it just like it looked like it in these other cases Okay, if we look at it this way, I mean this is not anything we haven't seen before But now notice what we're doing. We're beginning to look at a kind of activity hacktivism Normally carried out by private citizens for political purposes We're discovering states are doing the same thing and they seem to be doing it as an act of war Or retaliation for what they regarded as acts of war with some justification and The traditional distinctions we make Then between war crime espionage all those things. It looks like these are really getting fuzzy eroding running into trouble and That if we if we look at the crime side at the top there crime and vandalism Those tend to be done by private individuals for personal gain or gangs or something War that's a collective state act to alter state policy and espionage is kind of a low intensity version Hacktivism right in the middle there And it now seems to be available and being used by states as well as individuals for political purposes In the same way claus witt said war was used for political purposes. We're trying to get people We're trying to punish them for for harming us. We're trying to humiliate them or we're trying to bend them to our will Sounds like war to me except it's not it's clearly not and This whole phenomenon Viewed in this way. This has begun to be something that we're paying attention to a colleague and At the university of warwick convened a large convention not too long ago to talk about About the rise of hacktivism generally and How we how we should think about that and at the same time tried to uh examine the way in which states are increasingly using this as a method of settling the quarrels that they have In lieu of presumably armed conflict state sponsored hacktivism Is a kind of a unique thing It doesn't fit into any of those little Spheres not precisely um So where does it fit and what should we do about it? And this is what to go back to title of my talk Colleagues and I have begun to call soft war in the analogy with soft power And if that's a right way to think about this it suggests a new kind of of method of conflict that sort of blends elements of vandalism hacktivism crime espionage And uses it as a state sponsored instrument of war But it isn't war it isn't equivalent to a use of force. It's much less destructive. It's much more nuisance oriented And it is not covered under the international law of armed conflict You have here one of the most brilliant international legal scholars in the world michael schmitt Who has done an incredible amount of work with colleagues all over the world trying to understand how Current international law water would not apply to to To cyber conflict But that's if it does something like stuxnet did or something like I portrayed on the first conflict scenario This I mean this is going to be a lot of work to try and get international law that doesn't say anything about espionage To cover this kind of thing So how are we to make of it and when we think of that as a technique of of combat used by states or groups To adjudicate the conflicts that they have with their adversaries It's not limited to cyber You know so far. We've only talked about cyber But there are other techniques available Economic techniques techniques that use international law There are media operations. There's there's disinformation and propaganda You put all of that in the tool chest and a lot of these aren't new It's just grouping them in this way and using them for this purpose Seems like it might constitute a whole new era of conflict That we're calling the era of soft war And it's in that context and with this I think it's time to wrap up It's in that context. I think we should look at the revelations of of snowden Because of course, there was none of this discussion When he revealed what he thought he knew about how nsa was violating american privacy By collecting doing all this metadata collection And I think I sent you all a read ahead that I did on this some time ago on the nsa management directive 424 this enterprise knowledge system Treasure map and all that stuff. I don't know if any of you had a chance to look at it But that I had some pretty good technical advice from the deputy director of the end of the cia at the time writing this So the the technical stuff is is better than it would have been if it had been on my own But the point that I tried to make there and that I'd make down here with regard to this is this is miscast As an invasion of privacy or any any even anti-terrorism This may be One of the things we need to examine if there is this new phenomenon of soft war How are we entitled to fight it? What are we entitled to do? What in particular are we entitled to do in the way of self defense? And even more particularly is it possible given the nature of soft war That some things would be permitted that wouldn't be permitted in hard or kinetic war Such as deliberate targeting of civilians and civilian infrastructure These these questions need to be examined another thing that might be permitted is What we're already engaged in and most of you know that what nsa was really doing Was uh was preemptive self defense They were trying to defend against acts of terrorism and crime and and even warfare Before they were committed not trying to track them down and retaliate after the fact Well preemptive war is not usually permitted under the Certainly in the laws of arm conflict or in the usem bellow at belem regulations that henrik was talking about before lunch Preemptive war is basically a no-no We tried one of those once this last decade and didn't go very well and you know, so In the kinetic sphere, we don't license preemptive war But it seems like in the soft war case we might be able to make A case for it It would still be the case that the wars fought with these means would only be fought for a good reason And that they would be we would demand that they inflict damage And that was kind of the argument we were having here in the in the room about how much damage has been suffered And how much are we willing to do in retaliation? That's the principle of proportionality but these two hard war principles that are very Very firmly entrenched that you tend to go only after military targets and not deliberately target civilians It seems hard to imagine how soft war would work without being allowed to loosen those boundaries ought we to tolerate that Certainly these should be if not a last resort a next to last resort We should try normal means of conflict resolution first and soft war Should be fought only after all those have been exhausted, but perhaps before You resort to kinetic conflict, which is what I think is the transformative feature here If we think about a new era of soft war involving but not limited to cyber As incorporating some of the insights we learn from conventional war about when it's to be fought and how it's to be fought And others recognize that they were there for a reason, but those reasons may not exist in the soft war case Then it's possible we Have begun to come into an era in which conflicts Very serious and grave ones can be adjudicated fought One side forced to do the will of the other in the klaus witzian sense without necessarily Doing irreparable harm and damage To lives and property and treasure That's the promise of this The problems are enormous and on those I invite your questions and comments now. Thank you very much Did I leave you any time? Georgia occurred me as you're talking this Seems to be about where the discussion of air power was between world war one and world war two You know you had the theorists like duet And in a slightly different way michel who thought that this would be a way to uh to avoid Frontline warfare that you would simply Either do or threaten enough damage to the adversary's economic system And morale that you would avoid having to actually fight the war right the difference is this might actually work out for it This might actually work as opposed to yeah As it turned out that theory of air power didn't work out very well So If it would actually work as long as we're good at it wouldn't this be good news I think it possibly could be good news. Yes. Yes master these techniques and I think also As with previous eras of war you come To some kind of consensus of practice with your adversaries about better and worse ways of fighting it That's very important and we don't know what those are now. We're busy experimenting and So far we haven't hurt anybody terribly badly knocked out a few Um nuclear centrifuges. I think is the only damage we've done of any great physical amount so far But a lot of tacking and counterattacking is going on at least in the cyber domain And I don't think it's clear to the people carrying it out exactly what the limits are What the ends and goals and purposes are and how well the practices are serving Them getting to those ends. Okay. Just one item of fact for the audience He met george mentioned michael schmitt our colleague here at the war college in the international law department He produced a really excellent manual with a bunch of colleagues called the tolling manual from from tolling estonia Which was the attempt to figure out what international law about all this would be At this point, it's just a bunch of people offering an opinion about what it ought to be So they've run it up the flagpole and we'll see whether anybody salutes or not So it has no no legal status Except that it's the opinion of considered opinion of a bunch of international law very well respected experts. Yeah, okay questions for the audience Please You say that this is uh new But for the soft power Nation states have been using economic sanctions for years. Yeah, this is no different Right by using that and it's a very low bar of entry with or for cybers. So it's much cheaper With that way. So it's not necessarily new The talent manual of course Brings open the discussion the global debate, but we don't have a common language For is we don't have an economy agreement on what's right. What's wrong? Internationally speaking. So that's part of the problem The other problem is that the governments don't own Cyber domain commercial enterprise right owns the cyber domain and the infrastructure So when you're talking about dollars and cents and profit Companies don't really want to listen to their governments because that's the bottom line So The other thing is you can't see this. This is you know people tend to you know virtual Virtual presence is actual absence. So they can't see it Unlike the example you gave with the ninjas. So they can't believe it But hysteria works. So we saw that it was in four cases of Ebola in the united states But people are going crazy about that. Right. So it's just a matter of educating the people and comparing cyber to Isn't more akin to like global warming in a in a way because the cyber domain is a man-made domain It's arguable that the Global warming is a man-made problem, but no one can agree on what to do to stop it A lot of really good questions and comments there. Let me parse some of them and try to respond quickly The point about the tolin manual that it doesn't have any, you know, authority or anything. Yeah, the one of the great Disappointments about this is that By and large, there's no prospect of any new international, you know, constructive international law on the topic of cyber conflict in particular Nobody, you know surprise surprise The world community is very much like the american community enough laws. We don't want any more laws First let's kill all the lawyers and so forth So the tolin manual got a resounding You know vote of approval at the united nations level from countries who weren't included in the process and so forth So, yeah, we don't know how to think about it and We're not making a lot of progress there The issue of whether software itself is new or not It's not that economic sanctions haven't been practiced and disinformation and propaganda and psych ops It's linking them all up with some other things that nobody ever had or would thought of at the time such as Lawfare the use of human shields by Hamas If they're volunteers then the israelis technically under the law of armed conflict can't shoot at them, right And so you've defended a target with people you're not supposed to do that But you're using the laws of war against You know as as themselves a kind of weapon Um Cyber it's linking them all up and the founding document. Maybe some of you know this or have read this is a A monograph that you can find online And it's called unrestricted warfare written by two pla kernels in 1998 99 And they essentially laid this whole strategy out I said we they didn't call it soft war But they said you know sort of this is we're gonna have to fight wars in new ways Because the americans are so strong They're conventional power so great They're Wimpy reliance on technology so overblown that they'll just blow the rest of us out of the water So we've got to find new and creative clever jiu-jitsu like ways of fighting and and they listed all of these things including cyber And so in a way the founding document is that one and then this is just giving a name to that doctrine What else uh conventional Uh commercial ownership of of the cyber domain in particular who and the side of the commercial entities Verizon and com they don't want to have to do anything You know, they're already mad that we found out that they were helping provide metadata to nsa They're not going to do anything more in the future true Which means that a it's hard not to target civilian targets if the civilians own the infrastructure If you're carrying out cyber conflict And so that rule against doing so which I thought made sense for a while, but now I think it sort of doesn't Or at least we need to work on it. I I don't know what to do about that But it makes the civilian targets available Because everything passes through them in the case of cyber I can't remember if there's many more things you raised that i'm not sure that i've addressed accurately. I'm sorry There was one back there. Yeah, yeah, please go ahead Hi, sir I'm a commander by climbing in I wanted to uh make some comments on the uh the aircraft analogy going back to uh pre-world war one and It was kind of three things. I think that are different with that and with cyber today And uh, the first one is kind of like an asymmetric problem The united states is much more reliant on cyber than uh, many of our possible adversaries are For example, north korea. You could cyber attack them back to the stone age and it would still be a day that ends in wine Yes, uh, they wouldn't really notice the difference too much. Whereas your average citizen would not suffer. Yes They're already busy suffering. So yeah, we definitely notice that. Yeah And likewise you could see the bombers going to the cities You could see the bombers coming back as much easier to attribute attacks to whichever nation had launched the attacks Whereas nowadays you can you can route Packets through proxies. You can make attacks appear to be coming from the united states itself Which is kind of a lawfare problem because we actually need warrants to do that investigation now You can't just do it as a military intelligence problem. Right, right I kind of forgot what the third one was but There's a lot of stuff here and it's all a mess But I think your point that you know, how much Mileage I'd put it this way. How much mileage can we get out of the analogy with aviation? Some not much. I mean, it's it's heartening only because it's a large area of public concern About which we knew nothing a century ago and now we've pretty much worked it out I think that was jim's point and he's we'll do it here too. We just need time But then my rejoinder was okay. Here we are. Let's do it and you see the doing of it is is is hard work If you see what mike and his colleagues did in the tolling manual, it's It makes the Talmud look like a simple document by comparison I mean they really had to do a lot of gymnastics to make existing legislation That was already fairly clear apply to all these cases and somewhat. Well, and it doesn't you know that's just you guys And so what we have to do in the larger arena to get this worked through I think we're still Years, if not decades away And what it will look like when we're done. I have no idea But I think we need to get on with it Okay So tonic manner it's honest not states navy in terms of analogies One thing that kind of struck me was maybe this is more akin to age of exploration british east india versus dutch east india company Where you have this confidence of Governments are wanting to attain new colonies at the same time leading up to these mercantile Interests to actually pave the way through it This mercantile interest sometimes getting into their own kind of armed conflicts with local tribes, but also with their european competitors You had a certain point in the history timeline that the british east india company gets actually gets nationalized And a lot of these companies same thing with with dutch east india company as well And it would progress to what they did in indonesia, but maybe that's kind of where it's going to go That's really yes that that that's another good place historically to look for some insights How did we deal with the private public military state sponsored versus? You know commercial sets of interests on the high seas at the beginning of this west valiant period that martin and his colleagues have been talking about How did that work? Can we learn some lessons there? I went when we think about military contracting and its issues I mean there were military contractors all the time in those days mild standish to quote one You know site one famous local figure was certainly I hired paid military contractor as were John smith in and virginia as the east india company paid British naval officers to crew and Command private Gunships to protect their trade cargoes and so forth. I mean this public private thing There are a lot of a lot of lessons we could learn from that period that I think would would help us What specifically they are until we get down to the hard work of rereading those documents and those histories and taking those Courses and so forth and and putting that to work That's still we still need to do that, but I think it is a rich resource. Yes Yes, sir 10 20 10 trend uh us navy Kind of want to revisit um I think how we phrase this going into the back into the situation of the cyber. It seems like we've chosen The work go through the the choice of words of hacktivism Yes, and as you mentioned kind of choice from political activism And I'm surprising that we chose to follow the path of a civilian type of way of civilian Activism civilian way so that we say that we can't do anything because it's we can't arrest We can't be in a actively do anything in the warfare world because it's It's more towards civilians. We can't take this to that action I'm surprised that we didn't take a path of that they are cyber aggressors When you take the path of cyber aggressor, uh, and I know it's a crossing the word people can say that I think when the world started with suicide bombers, right? I think for a while there back in the world We decided why did we choose suicide bombers? And then we try to go rephrase that to say, you know what they're homicide bombers Try to kind of change the dialogue, but it went too long And by I think if we choose the word cyber aggressors, uh, instead Doing the path of hack to this then it allows us to go and go down the path of either law enforcement or military kinetic actions I think those are the things just my opinion from seeing this where you go with the soft power We're choosing the passive approach instead of An active approach to say that as we walk down this path as we define this and as you said the rules of the road Starts to be defined. How do we do this? I think we have to we take a look at how we define The words so that we can be able to attack it because you see this problem I think this becomes part of hacktivism becomes a part of what we see with the irregular warfare Uh-huh. Yeah, I mean, you know the the guys down in quantanamo, right? We got to make a decision at one point Are they criminals terrorists? What are they asked? Yes, exactly once we made a decision By saying that they're cyber aggressors instead of hack to this we give them a path that we can actually take an action at What do you think on that? Well, thank you very much for those very very astute comments. I think the the some total of them suggests words matter Concepts matter they either clarify Or they obfuscate and confuse And if I heard you right, you're worried that using hacktivism with its political connotations And it's it is maybe not the right word to use in this case. If so, what is Your larger comments made me think of another very esteemed colleague who we've lost to retirement here at the war college William professor rubel nicknamed call sign Barney Barney rubel Who brilliantly outlined this kind of a process that we go through in terms of ied's and suicide bombers and so forth He said look, you know, there was once upon a time in the age of heroic warfare with big ships and guns and conventional armies and so forth and And and you know really great commanders and then we got into this sort of systemic Sorry systematic technological warfare where it really didn't matter if your commanders were all that good or not You just had such great Stuff and such great people together operating it that nobody this is the thing the chinese theorists were complaining about We can't stand up the americans anymore. They have mastered this new form of systematic warfare We we can't touch them nobody can stand up to them, but that does make conflict go away So what happens people learn new modes of conflict and I think he called the third phase systemic where they would Invent little things like, you know, you the robots come and you paint the the lens of the camera So they can't see you put an ied out there and blow up your your troop trains you Um you suicide bombers and so forth because those are the weapons available to you to pursue conflict And uh and now, you know, what happens next? Well, of course we come back with predators and cyber stuff and whatever and Due to them what they did to us and everybody's always off balance But I thought it was a very interesting evolutionary notion of how warfare goes And maybe we should get Barney to come back and talk about this because I think it's very useful And it helps us with the question How do we conceptualize what's going on and understand what initially is shocking And deeply frustrating to us when these cyber regressors or these suicide bombers or whatever do what they do Our initial reaction is like yours to the first scenario anger fear outrage But we need to think clear about what this is and how we Kind of respond to it and combat it And that still needs to be done. Okay. I know there are other hands out there But I want to give you adequate time in your seminars this afternoon. So we'll we'll quit for now Thank you very much George and please make your way to your seminar rooms


Actually, very easily, first, you need to have the very good Rails app, which I happen to have one. And as you can see, we're currently on Rails 4.0.2. And, yeah, so what you need to do is you can go to Jamfowl and say 5.0. And this is the most important step. You want to run the bundle update Rails. Now, as you can see, we are now on Rails 5.0 successfully upgraded to Rails 5.0. Alright, I was kidding. There's actually a, I don't know if you know this, but this is actually a Spongster talk, which means I'm required to sell you something, so I'm not sure why you're here. Anyway, I don't feel great while selling my little stuff, so I thought I would sell you other people's talk instead. That actually sounds like a very useful talk. I'm sure it's a lot more complicated than that to upgrade a big Rails app to Rails 5. So if you have to leave now, that is okay. I might get fired, but that's fine. So the other talk you're missing is called, it's dangerous to go home. It is in Room 164, which is just a pause from here, I believe. But I think the main takeaway for a talk is don't use Go. The other talk that you're missing is Ragnated and Rails. The title for the talk is a single code base for web and mobile, so I'm pretty sure the talk is actually about third-walling as far as... Room 160. And finally, the last talk that you're missing for this is enough people are Urius, and I had to look it up on Urbanitioner, I think, and it'll be sent for nobody likes Python. I'm just kidding, I promise I'll stop making jokes about religion. So I am actually Guffrey. You can find me in the inference of pink code. This is my colleague, Yehuda. You can find him on the internet. Why Katzi also has a baby, and his baby's Twitter account is why kittens. We're both Rails 14 alumni. We also make a JavaScript framework for EmberJS and Flima. Yehuda is also on the Rust4 team. We work for a company called Fuller. We are hiring a senior engineer, so if you're interested, please come talk to us. We actually have a product that I could sell you, but I didn't allocate enough time for it, so I'll just put it out there at Skylight and come to you. We'll be happy to sell you from there. I guess I'll tell you one feature. We worked on this thing this year called Grades, which compares your apps' performance to all other Skylight customers. So it basically gives you a sense of where you're at with your customers' expectations in 2017. So if you want to see that feature, or if you want to come to a booth, we'll show you that. So that's it for all the Skylight stuff, and now we're going to talk about something else. So last year I gave a talk called, I don't even know what it was called. You might have had the same name as this talk. Yes, I talked about a project that we're working on called Helix. Since I imagine not everyone here has been to that talk, here is giving you a version of that talk in one extra five minutes. Ten minutes. Let's say ten minutes. Okay, let's do ten minutes. We'll see. We spend most of the time working on Helix. The thing that we're showing you instead of the talk, so this is, you get to see the slide deck for the first time at the same time. Sorry, I also have sore throat, so I can't talk, but thankfully microphones work pretty well, so hopefully that will be okay. So as we discussed last year, everyone is here today because they like writing Ruby. Ruby's awesome, but we also know that Ruby is slow. People say Ruby's slow. Most of the time, the speed of Ruby doesn't matter, since the workloads that you're working with are IO bound workloads. You spend most of your time waiting for a response from a database or something like that, instead of doing heavy number crunching. But even though it usually doesn't matter most of the time you're waiting for a database, once in a while you end up with a CPU heavy workload, and the performance actually does matter. In Ruby, you can get the best of both worlds by using C extensions. For example, when you say require JSON in your Ruby file, you get a native gem on systems that support it and a pure Ruby version on systems that don't support it. The C version is very fast, and better yet, as a user, you can't tell the difference between the Ruby version and the C version. This suggests that one way to make Rails apps faster is to write fast versions of hot functionality in C and expose the implementation through the CAPI. And in fact, this is how Ruby itself made the date library and the path name library fast a few years ago, so that suggests let's do that. So a few years ago, Sam Saffron discovered that the blank question mark method was a hotspot for discourse, and he wrote a C library called Fast Blank that sped up the operations by 20 times. This is a pretty huge one, and it was only like 50 lines of C code. That's a pretty big deal, so you might ask, why don't we do it more? Why don't we write a lot more of Rails in C? In a nutshell, the problem with writing things in C is that it's C. C is annoying programming language to write in, but it's more importantly, it is also unsafe to write C code and it's risky. If you make a small mistake, your library can cause a seg fault and nobody likes seg faults. For the most part, people prefer to write to use slow code as opposed to the risk of crashing their Rails applications. Also, while C extensions are transparent to your users, or the user of the person writing the C extension, they are not transparent to the person maintaining the C extension. They significantly add burden on maintainers and contributors because C is such a painful programming language. So at Skylight, we sort of had the same kind of problem. The first version of our agent was written in pure Ruby and it was okay, but eventually we couldn't add some features that we really wanted to add, like the important one was tracking memory allocations without blowing all the budget. You don't want to install a performance monitoring tool and suddenly have your app do you super slow. That doesn't make any sense. So originally, we thought we would solve this problem by writing a C or C++ extension, but we had exactly the same problems that I discussed before. We had maintenance burden for our engineers. We really want everyone on the team, including junior engineers, to be able to write things across our entire code base and C is not a language like that. And also, if you make any mistakes, suddenly we're crashing our customers app and actually have many thousands of customers across many environments.  So eventually we decided let's try writing a bit of an agent in Rust and I did a couple weeks of a spiking experiment and it was so successful the first time I did it that we pulled more and more of the core functionality into Rust over time. So what is Rust? Just like C, Rust is a compiled and statically typed language that emits very fast code, but unlike C, Rust has an advanced type system and carefully designed features which are both fun, pleasant, enjoyable to use and guarantee runtime safety. One of the slogans is if it compiles, it doesn't crash. So it might sound crazy to hear about a programming language that's in the same performance league as C, but also offering you the kind of safety guarantees that you expect from Ruby, but it's really just the same kind of guarantee that languages like Ruby offer, right? If you write a program in Ruby, you don't have to worry like, maybe I make a mistake in my program seg faults and Rust offers a similar guarantee. The cool thing is that Rust figured out how to do it without a garbage collector using the ownership system, which you should go read about if you want to know more. As a side effect, the ownership system also provides concurrency without data races, so concurrency is built in very nicely. Now, in high-level languages like Ruby, there's a tension between writing or using abstractions and the performance of your program. When you decide to use really nice features like Symbol to Proc or like mapping over an array, you're paying a cost in overhead to get the sweet features. Most of the time this doesn't matter and Ruby programmers optimize for happiness in the 99% of cases where the extra overhead is worth the ergonomic improvement that you're getting, and that's a really good trade-off. I think that's why everyone's here. But sometimes it does matter, and in Ruby you end up writing very low-level, unedited matter code just to get performance in the case of where it starts to matter. In Rust, you don't have to worry largely about the cost of abstractions. That's because the compiler can see through all your code and magically make it fast and wave. For example, if you use map.map instead of a handcrafted loop, the Rust compiler is smart enough to see that you're really doing a loop to optimize it into a loop. And actually very often handcrafted, it's our high-level abstractions, can provide faster code in Rust than the handcrafted code because you're explaining your intent very clearly to the compiler. In loops, for example, if you use map, the compiler eliminates bounce checks to make it, because it knows, oh, I'm mapping over an array, I don't have to worry about checking all the time whether the thing I'm looking up is in the array because I'm mapping over an array. So if we go back to the original fast blank example, the one that Sam wrote in C, when we ported it to Rust, we ended up with a one-liner. It actually is a pretty nice one-liner. It looks pretty familiar to the programmers. But we ended up with roughly the same performance as the C version, but with a single line of code. And by allowing you to use high-level abstractions instead of without cost, small amounts of code can result in very fast but also very easy to write programs. Now, there's an asterisk here, which is that when we first did this, we got the unique code for fast blank as one line, but we didn't talk about the boilerplate. And last year we said, well, it sucks that you have to write all this boilerplate, so we announced last year a library called Helix, which allows you to write the same thing without all the boilerplate. This is what we showed last year. We've been writing Rust code in Ruby for a long time at Skylight, but historically there was just too much boilerplate to recommend this to regular people. There might be only a single line of Rust code to write fast blank, but there were only 50 lines of boilerplate to set it up, and we made Helix to eliminate the boilerplate and let you jump directly into writing classes and methods without having to write any of the code to wire it up. At a high level, like in the 90s, there was a division between scripting languages and systems languages. Scripting languages handled orchestrating I.O. bound tasks, and they delegated to serious tools written by serious programmers to do things like sorting, grepping, set off, all that stuff. Those things were delegated to do the heavy lifting. Actually, this kind of idea of scripting languages handling I.O. bound things worked pretty well for Rails, which is largely an I.O. bound problem. Most of the time you're just waiting for the database to give you something back, and there's not that much heavy computation going on. That division historically was like you write high-level scripting languages for the ergonomic pleasant to write, but then the serious programmers write in really baroque, old-school programming languages. But in the new era in 2017, we have system languages that started to adopt a lot of the things that are nice, that are ergonomic about scripting languages. And our goal with Helix is to allow you to write the Ruby code that you love without fearing that eventually it'll hit some CPU-bound wall that forces you to rewrite everything as a fleet of Go microservices. And so the idea is you can start with Ruby and you can move your CPU-bound code to Helix if it's appropriate. Now... So that was last year, that was my talk from last year, and we wanted to watch the whole thing in about five minutes so you can do that at home, but now we're on to new stuff. So last year we had a really good proof of concept. However, it was still too hard to use. Basically we're also like if in fact, we did generate the boiler code for you, but then there's more boiler code, boiler plate around how you set up and stuff like that, that it's hard to figure out. We're also missing some very basic features like we we don't support taking in bullions or a tonful. We don't have class methods. You can only have exactly one class in the macro. No borrowing and stuff like that. And then we don't really have exception support, so the type errors were just printed to your console. Basically nothing other than demo support. So this year we decided to focus on stopping all those problems and the last year we'll work on we work on we decided to focus on making it plausible for very restricted use cases and do that really, really well. So we decided to focus on the use case of dropping in some Rust code into your Rails app. Maybe you have some background job or whatever that's taking a while and would like to speed up that code. So that's the use case that we decided to focus on and we obviously we work on the missing features basically everything work now and the reason we decided to focus on the Rails scenario is because you control the end to end environment so you can just like it is not a big deal to have to install the Rust compiler on your part, like on your build servers or your production servers so you don't have to worry about pre-compiling and stuff. So it actually works like the code we have actually works also on Rails as well but we just decided to prioritize making the Rails experience nicer. So here is the demo. It is going to be an end to end example so I guess I will show you what we're building so what we're building here is a very simple Rails app that has a text field that you can type some text in there and then you can click a button to flip it upside down so the trick is we will implement the core functionality of flipping the text and Rust inside the Rails app so Rails app is going to do all the request handling, all the buttons and forms and stuff like that but then we're going to delegate to us for the very heavy operation of flipping text. And by the end of this we're actually going to deploy this to Kiroku so let's do it. Alright so we are building this from scratch so let's delete this and start over what could possibly go wrong and so let's start by generating a Rails app we're using the latest release candidate 510 RCT what could possibly go wrong. We're not going to need active record here so we're just going to skip that to make deploying to Kiroku a little bit easier so that's the Rails app now let's go and see the Rails app and then we'll just make sure everything is working fine so this is the Rails server and as you can see it is actually running so the next thing we'll do is we'll add the Helix Rails gem to the gem file so that's the Helix Rails and we're currently at version 050 as of like this morning so when we install it we're basically going to fetch your gems and that's it so we're pretty familiar so far then Helix Rails actually is a generator so we're going to use that to generate what we call crates which I'll explain in a moment so that's up and the the so this generated Helix in create slash text run form so this is simultaneously a gem, you can see that there's a gem spec and also it is a Rust create which is basically a Rust equivalent of a gem so there's a cargo.toml so the reason we did this is to encourage you to structure your Rust code as a self-contained library just like your other C extensions like a JSON gem is a library that do a limited amount of things so this is how we recommend you to set it up for now and the next step is you can see there's a lib directory for your Ruby code because there's a gem you can put whatever Ruby code in there there's also a source directory which is the Rust convention for Rust code you can see that the generator generated a text transform class with a single class method that prints the console so let's try that out we can do that by running rickrb in the create text transform directory so when you run rickrb it will automatically compile the Rust code for you and then put you into rb with access to your Rust code so you can type text transform.hello and as you can see it is indeed printing stuff to your console it is probably worth emphasizing that it might be not very obvious but we're actually building a native extension we're calling Rust code this everything here is implemented in Rust so that's pretty cool now that we have the role of borla played down let's actually implement the text transform library we are going to do a little bit of let's just try to SM test with our spectos very quickly and install now we have our spec I'll just cheat by pasting in the text I wrote earlier in the spec directory so we have a text transform spec and it's pretty simple basically we expect the text transform class to define a flip method that takes a string and it flips it so that's what we're implementing today so just to make sure we did everything correctly we'll run the test and as you can see it's failing because we didn't define text transform.flip so that's good we'll do that so we'll need to define a method called flip and basically this is like a Rust macro which is like a little DSL for defining Ruby classes in Rust so we'll type def flip so that's like the usual syntax we're used to for defining method and the way Rust distinguish between class and instance method is whether it takes a parameter called self in this case we're making a class method so there's no self we just take a text we can take a string and then we'll tell Rust that we are returning a string here it's fairly worth pointing out that these are actually Rust types all you need to do is you say oh this takes a Rust string and returns a Rust string and we'll figure out how to convert the Ruby string into Rust and then like convert your return Rust string into a Ruby string and if the user is passing a different type like if you're passing a number for example it would automatically raise a Ruby type error for you so basically all the things that you're used to and so I'm going to paste in the implementation here it looks a little bit long but it's basically just a large table right what you're really doing is you're taking a text sorry a string which we call text you're looping for each character you're calling .ref which reverses the characters and then you're mapping each character in the table and then at the end you join them back into a string so pretty familiar syntax pretty high level you might think that using all these high level features would make things very slow but again the compiler is basically magic so if you do .ref.map it doesn't actually make an array and then reverse the array and then map it and just figure out this is what you're going to do so we're just going to do the smart thing for you out of the box and it's probably going to be fascinating whatever smart things that you might try to do and like you notice how to allocate the right amount of size and output and how to look one byte at a time and all that stuff so what we did is we ran our spec again unfortunately the test is still failing it's still saying we didn't implement text transform.flip which we clearly did the problem is Rust is a compiled language so we actually need to recompile code after making changes that being said the Rust compiler is fairly fast so you're not going to spend a lot of time waiting for things to compile so to fix this problem we run rick build and if we run our spec again afterwards then it is going to work obviously it's a little bit annoying to have to remember to run rick build all the time so we're just going to make a rick test for it which you're probably going to do anyway so this is basically a standard rspec setup you have a rspec task the key here is to make rick build a dependency of rick spec just to show that it works I'm going to go add a new test for it it can flip table and basically if you give it a table it will flip the table if you give the table it will flip it back so now if we go run the test again it's not working as expected so now we can implement this again we'll go back to lib.rs and we'll paste in two special cases at the top and now we'll go back to the console and run rick spec remember we didn't actually run rick build but then it automatically noticed that we changed some files so we recompiled and then run the spec for it and now it's passing so that's now we have fully working, fully tested text transform library let's actually use it in Rails as you can see the generator already we'll map it to apps.gem file so we don't have to do anything special here so we'll start by adding a route a resource called flips and we'll so we'll go to rouserrb and then we'll do a resource of flips and then we'll map it to the root path and we only need the index and the create action in this case so we'll do that the next step is to add a so we'll go to app controllers and then we'll make flipscontroller.rb and then we'll paste some code but basically in the index action we default the string to either URL param or we default it to hello world and then in the create action we call the text transform.flip method that we implemented in Rust so finally we will make a template for this and so you go to views and then make a folder called flips and we'll make an index.html .erb for it it's just going to be a very very simple form that has a single text view and a button and the Rails defaults for all of these helpers worked out to be exactly what we wanted so that's very nice so now with everything in place we can test it out in the browser so we're going back to the app and run Rails S and so now if we refresh we have a flipper and you can see that it can flip X, you can flip so my god and you can also flip tables so that is it so as you can see with pretty minimal effort we were able to create a Ruby native extension written in Rust using Helix not have to worry about SecFox and it's like the code is still pretty high level pretty easy to work with and we even have a test for it so finally let's deploy our app to Heroku as promised as it turns out I actually have something to sell you so you need a Heroku account in the Heroku CLI but I already have those set up on my computer so we are just going to create a Heroku app and we'll call it Helix flipper because this is a Rust and Ruby app we have these built packs manually so first we will add the Rust build pack many things to Terence from Heroku for making this work and we'll then add the usual Ruby build pack for the Rails part of things and that's it so now as it is recommending we should from get push Heroku master to do it so so get push Heroku master so now you can see the Rust build pack is downloading the Rust compiler for you automatically and we're now into the Ruby part so this is just running bundle install and downloading all the Ruby dependencies and then now we're compiling the Rust code so this is downloading the Rust dependencies and it looks like that's it launching the Dino but now that's done we can go to the browser to see it in Helix flash flipper.heroku app.com you can try it on your phone if you want to so as you can see it works and now we have a Rails app running Rust code in production on the floppy internet yeah so back to you so I want to talk about how you might want to use Helix first of all you should take a breath to realize that that was pretty cool so I want to talk about what use cases Helix is good for so first of all in general Helix is good for problems that use heavy computation and simple inputs the boundary cost of crossing into Helix is still a little higher than we would like but for problems that do a non-trivial amount of work in Rust the cost of the boundary crossing pays off pretty quickly also things like data tables, file names JSON objects are all like simple inputs so you can get pretty far with the types that we already support in Helix think about it this way the Helix boundary is cheaper and supports more types than a background job so if you could have moved the work into a background job you can make it work in Helix as an example we built a demo that counts the number of words in a text file when we measure all the words in all the works of Shakespeare Ruby takes about 3 seconds to do it Rust does it in 30 milliseconds and this example takes advantage of Rayon which is a Rust library that lets you paralyze loops so here's the example basically using what Godfrey showed you before look at the inputs are both strings the return type is a 32 bit integer the string one of the strings is a file name and just note that .expect is a Rust method that raises a panic and that can get subverted into an exception in Ruby so what you can see is we open a file from the file name then we convert it into an iterator and then map over and count how many lines there are if you use the Rayon library in Rust which is just a library that you can get off the shelf if you change into it or into part it now it's paralyzed it works across however many cores you have on your computer so that's one of the ways that we get to 30 milliseconds is that we were able to use four cores or however many we use in that benchmark another really good reason to use Helix in general is if you want to use existing Rust libraries from your Ruby application one of the main reasons why this ends up being good and important is because Servo is a web browser written in Rust Firefox actually shares a lot of code with Servo so there's a lot of production quality libraries that already deal with the concept of web content turns out we're working on a web framework so things that deal with web content are very helpful so as an example I built a demo that inlines CSS into HTML like if you're building an email thing and you want to inline you have a CSS file you have an HTML file you want to inline it together and we were able to use Servo's CSS parser and Servo's HTML parser and only needed a bit of code to glue it all together which is actually pretty cool basically like here's an example so basically we're using the CSS parser from Servo then we're looping over all the rules that we got from the CSS parser and then we're looping over all the elements and inlining things with a style to attribute if we want to and so it's kind of like writing C bindings like if you're like oh I know there's a libxml library and I want to use it now I can write a C binding it's kind of like that except it's way easier to do it you can also use Helix in a request in a mail in a background job in action cable or in any part of Rails and since mailers in background jobs tend to be more CPU intensive don't discount those use cases I think those use cases are a really good fit for Helix it also means in general you might have moved some CPU intensive thing out of the request into a background job because it was just too expensive you might be able to move some of those back if it's good for you to put into the request as well I realize in the examples we showed we didn't actually show you all the features that we worked on last year we have a website that actually showed you all the things that some of the demos that I talked about are on the Helix website and like you can play with them in a Rails app some of the features that we worked on is you can have multiple classes now you can have public private classes you can have instance methods which somehow none of the examples use you can also have a struct in Helix for storing instance dates so it's like instance variables except you tell the compiler exactly what you will have so it can optimize the access a lot better but unfortunately with the RubyC API that's basically the data wrap struct API that we wrapped in the REST macro which is really cool unfortunately we don't have time for example to show you anyway I guess we'll close this off by telling you what doesn't work so a lot of things works already as you mentioned there's a lot of use cases that you can start playing around with it if you happen to have to write problems in your Rails app however as Helix is a pretty young project that works still to be done so this basically we're trying to give you a better sense of where we're at and maybe there are some opportunities for you to contribute back to if you happen to have one of those use cases that we don't support yet so we broke down the outstanding work in different use cases the first use case is a green food project which I considered done so basically you're developing a brand new feature or rewriting a feature inside your app as opposed to rewriting something or as opposed to implementing something in a library the difference is since it is in your app you have full control over the API so you can make adjustments in your API to work around the current limitations in Helix so you might use Helix for like a CPU bound everywhere from here in a request middle-life background job as you pointed out and basically the problems with a potential for parallelism is also a good fit as you already mentioned so we currently only support for the types, I think we only support strings, numbers, booleans, the basic types like that that sounds a little bit limiting but then if you think about it because HTTP requests and background jobs actually share the same constraint where you cannot put a Ruby object through HTTP request, you can marshal it and then send the bytes across you can do that in Helix too because you already are used to working with the string constraint in the HTTP request you can actually do a fair amount even with just strings, numbers and booleans so yeah, so that's the GreenTool project use case the next use case which we're currently working on which builds on top of the GreenTool project feature list is you're writing some code in a you're rewriting some code in a public library from Ruby to Rust so basically it's like how you have JSON calling calling pure and then you need to have API compatible version in a native extension that is it needs to be a high fidelity match because you cannot change the API so that's a little bit tricky because so the benchmark we're using for this, I don't mean in the performance sense but the example that we're using here to help ourselves understand how far along we are is exit support duration so it is a fairly simple class but because there are a lot of dynamic features in Ruby you end up having like there's one method that happens to take an optional argument and we happen to not support optional arguments yet so there are a lot of edge cases like that that we're still working on so this is maybe not quite there yet but it's probably the next thing to check off the list if this is what you're trying to do today though you can still accomplish a lot by mixing and matching Ruby and Rust you don't actually have to do literally everything in Rust as I show you there's a lib directory in the crates that you can put Ruby code in there and what you can do is perhaps do basically define a class in Rust have you're lifting in there and then you can define some sugar on top in the Ruby like you can reopen the class in Ruby and then you can take optional arguments or whatever and then you can normalize that and call back into Rust and that is not ideal but it works and the long-term goal is to make all of those work in Helix so some things that you will probably notice are missing are we don't support module yet we don't support optional arguments Rust arguments, keyword arguments like sometimes you want to take like a generic numeric like you don't want to care whether it's a float, an integer or a big num or complex, rational like so there's something, yeah so that's numeric and sometimes we overload in Ruby like the same parameter maybe one of many types we have plans to make all those work just still coming along but as I mentioned you can always normalize those differences in Ruby and call call back into Rust so that's that and then reopen is a little bit strange but a lot of echo support stuff reopen in core classes so it kind of works now but it's not amazing yet and we have some work to do there and this also is very easy to do a wrapping strategy, like a mix and match strategy so you can do a reopen in Ruby the key is you want to the parts that make sense to move in Rust is the algorithm have a lifting part so you can still do a lot of that in Rust and you can use those code in Ruby like we did in the Rails example I guess I'll just go through Rust very quickly because we're running out of time so shipping to production as you can see we actually kind of made that work with help from Terence like it actually works on Heroku and stuff the things I'm missing is like it works as long as you have to have a Rust compiler on the server but we don't have documentation for how to do it so if you're interested in figuring out you might want to contribute some documentation there and let's see binary distribution is interesting so if you are a library author and you want to use Helix you probably want to make sure that people can install your gem without having a Rust compiler on their computer so this is what we mean by binary distribution there are some other gems in the Ruby ecosystem like the thing that wraps libp8 does it basically and skylight we do it ourselves basically we have to make this work in a way that is automated because we need it ourselves we already have ways to make it work but we need to extract that into open source version you basically precompile the binary for all the major platforms there are like a handful of them and then people can just download when you gem install you can just download that binary and it works so that we still need to work on tooling to make it possible we know it is possible because so you could have said we actually do it in skylight and then there is some non-traditional use cases like mobile web assembly and Ruby and performance parity with C as you mentioned we are a little bit slower than C right now so we need to have some good benchmarks to figure out where the overheads are the long-term goal is we want to be on par with the equivalent C native extension that you would write but when we say a little bit slower than C Ruby is here so if you are moving code from Ruby into Rust and it is almost entirely the boundary cost that is more expensive Rust itself is very competitive with C so if you are treating it like a background job you don't have to worry about it all if you have a chatty API you should then you want us to fix this problem right so then finally there are some miscellaneous features and quality of live improvements we want to support more types we have the protocol down so it is quite easy to add more types we just haven't gotten around and you just have to decide what does it mean to convert a hash in Ruby to a hash map in Rust what is that we are quite reliant on the Rust macro system for the DSL so when you have syntax error in the macro the errors are quite brutal we are working on that if that is the kind of thing that you are interested in we should talk more and maybe you can help there too so that is basically it I guess I kind of ran out of time so here is the website for everything else that I didn't have time to cover usehelix.com you can go look at it and we are I think we have this setup in the skylight booth so if you want to come play with it or chat with us we are here today and tomorrow the website usehelix.com is a Rails app all the demos are written in Helix in the Rails app so if you go look at the repo for usehelix.com the source code for all the demos that we show today are in there and they are the same code that is running on the website a lot of you are probably looking for opportunities to contribute so we deliberately sprinkle up typos in the website the roadmap webpage is a more detailed description of what we talked about and the issues that everything is in ran out of time but this is the best slide thank you very much