Felly, Arm năm 11 neu rymddefnyddio eich мыslew o convertidiar ac yn y faniaf yw wneud. Rymddefnyddio yw y gweld eich methu eich rymdffyn nhw a'r adnod lli'u pryddennyngu fynd—bollach cyr o gael chefach yn amser, sai Refدي, er recognise hynny. board to support the sector's continued growth. Our development and skills agencies are actively engaging with the sector and key professional bodies to support development of the sector across Scotland, building on our established global reputation in the industry. In the programme for government, we committed funding of up to £250,000 to establish FinTech Scotland, an independent industry-led organisation backed by public, private and academic partners that will champion, nurture and grow Scotland's FinTech community. During the recent visit to Dublin by the Culture, Tourism, Europe and External Relations Committee, representatives from the British Irish Chamber of Commerce explained how financial services firms from the UK were already putting in place plans to move jobs to Dublin because of uncertainty with regard to the sector post Brexit. Given that the UK Government has still failed to produce a position paper on the sector for its negotiations on Brexit, does the Government believe that this is a danger to Scotland, as well as a missed opportunity that we are going to lose those jobs, but if we were still in the single market, we would be a well-placed place to attract them? I fully agree with the points made by Joan McAlpine. It is interesting that we are seeing some comments now in relation to the financial sector about passporting no longer being an option, something that was deemed by the sector to be absolutely critical to its continued ability to thrive in the context of a Brexit environment. Is the case, the UK Government should have produced a detailed proposal for the future relationship with the EU and the implications for the financial sector. We are seeing other countries in the EU quite happily being predators in relation to some of the businesses here in the UK. Of course, financial firms are already planning for the future, but in the absence of any certainty or any analysis done by the UK Government, they are having to base their arrangements on a worst-case scenario of a hard Brexit. So continued uncertainty over the UK Government's negotiating position, risk jobs and future investment in the financial services sector in Scotland and across the UK. That is not just the Scottish Government saying it. Every business organisation—I think that today it is the British chambers of commerce—every business organisation, every economic think-tank says it. The only people who do not say that are Scottish Conservatives. Dean Lockhart, based on the latest available figures, Scotland's finance and insurance trade with the rest of the UK represented 83 per cent of all of the sector's business in Scotland and was worth 20 times the value of Scotland's finance and insurance trade with the EU single market. Given that, what steps is the cabinet secretary taking to help the sector to protect in Scotland, protect and expand its market with the rest of the UK single market? Some of the things that I said in my response to Joan McAlpine's first question laid out some of the things that we are doing, but it is worth saying in relation, for example, to FISAB, the body of which I mentioned, which the First Minister jointly chairs with the industry in which Paul Wheelhouse and myself also attend. Many of those organisations are, as Dean Lockhart suggests, organisations that have a UK presence. There is a great deal being done, which is common to both areas, but there is also the question of the different perspective, the different demographic of the financial sector in Scotland. You have mentioned some of the funds that are looped after in Scotland, for example, global custody of funds. The asset management, especially the strength of that in the Scottish economy, has a different perspective from elements of the financial sector in London, but it is hugely important. It is also the second biggest one by some measures in the EU, even greater than Frankfurt. Of course, it is a case that there is substantial business. Nothing that I have said, or Paul Wheelhouse has said, suggests that we should do anything other than try to grow that business with the UK. We realise how important it is. It is not us who are looking to be isolationist and cut ourselves off from markets. We will continue to do the work that we can do to grow both our work and our business with the rest of the UK but also with the rest of the EU, which is why it is so vitally important that we stay in the single market. Trade hubs are expected to open. The Scottish Government has committed to establishing innovation investment hubs in Dublin, London, Brussels, Berlin and Paris as an integral part of wider work across the Scottish Government with its partners and businesses, in order to support trade, investment, innovation and intergovernmental relations. The newly established Berlin hub, located close to the Reichstag, is already operational and recently recruited its first member of staff from Scottish Development International. The early focus for the Berlin hub will be to identify early priorities, build networks and establish key relationships. Our operation in Brussels is in the process of transitioning into a hub from our existing presence in Brussels, where Scotland and Europa has been operating for over 25 years and the Scottish Government's EU office since 1999. That transition should be completed by summer and will include a representative of SDI. I thank the cabinet secretary for that answer. The 2016 SNP programme for government said that opening the Berlin and Brussels trade hubs was critical to Scotland's economy when they announced way back in October 2006. The 2017 programme for government even stated that the Berlin hub would be open in 2017. The cabinet secretary has outlined some processing that is on the way to getting the hubs open, but we have not seen action. We want to see action because it is important that the hubs are open. We want to see performance targets that currently do not exist for the hubs in Berlin and Paris, which are not yet functionally operational. Can the cabinet secretary give us some more detail over the hubs? Perhaps, if she listens to the detail that I have already provided, she just said that they are not functionally operational. My first answer said that the Berlin hub is already operational. I do not know how much more explicit I can be than that, so it is already operational. It is recruiting its first member of staff. Of course, it builds on the work that is already done by our presence in Düsseldorf. It builds on the work that was done when I visited Berlin last year. In relation to Brussels, of course, it is a transition arrangement because we have existing presence in Brussels as well, so we have built on that, which is a rational thing to do. I am perfectly willing to get into a discussion—I think that it is the first time that I have had the question asked by the Conservatives certainly in terms of performance measures for these hubs. I am perfectly willing to get into that discussion, but it is the case that we have done this. Of course, we have done it in the teeth of substantial opposition from some people, but this is important in the context of Brexit. The question that is never asked by the Conservatives is what will be the impact of Brexit on the economy in Scotland. The reason why we are doing this—building on our presence not just in the EU but in Canada and other parts of the world as well—is because, in part, of the challenge posed by Brexit—a challenge that at least one Conservative should acknowledge in this chamber. Presiding Officer, this week in an attempt to pacify the hard-line Brexit years in their own party, the Prime Minister ruled out membership of the customs union. I have already raised the importance of the customs union in this chamber for musicians in Scotland and elsewhere across the UK. Will the cabinet secretary say what impacts he thinks leaving the customs union will have on Scottish businesses and Scottish trade with European Union countries? We think, for example, that being outside the customs union will create barriers to trade for businesses in Scotland and indeed across the UK. We have consistently made the case that maintaining our membership both in the single market and the customs union is essential to the prosperity of Scottish firms and the Scottish economy. In Scotland's place in Europe, people's jobs and investment, which we published last month, demonstrated that Brexit will significantly weaken our economy. We have done analysis. We have published analysis. Apparently, the UK Government has done some analysis but does not want to publish it or tell anybody about it, yet we get a lecture from the Conservative benches about transparency. We have done the work. We have published the work. It is about time that the UK Government did the same. Question 3 has been withdrawn. Question 4, Willie Rennie. To ask the Scottish Government whether the Cooper North relief road will be funded through the Tay cities deal. The Scottish Government is committed to securing a city region deal for the Tay cities as soon as possible, and we are currently considering all proposals and fully exploring all financing and funding options. A proposal to accelerate the Cooper Northern bypass project is one of those that is put forward by the Tay cities, but it is not possible at this stage for me to confirm details of which projects may or may not be included as part of the final deal. Willie Rennie. Minister for that answer, the Tay cities deal aims to create a smarter and fairer region with innovation to create sustainable growth. I was surprised that the Cooper North relief road was put forward as part of the Tay cities deal, especially when the planning permission specified that the consortium of house builders should be building that road themselves. Why is the state even considering bailing out house builders to build a bypass, and will Willie Rennie rule it out if it comes before him? First of all, he asked why we are considering it. I think that I said in my first response that we are considering it because it is the project, the proposal that has come from the relevant local partners—in this case, the local authority. That is the basis of city deals. We, neither we nor the UK Government, decide the projects that come forward. We do, of course, decide which ones to support. That is perfectly legitimate, but we do not decide. The whole virtue of city deals is that they come from local partners. I do not know if what Willie Rennie is saying is that we should rule it out. Before we have come to a city deal, before we have come to a conclusion, we should rule it out at the very early stage because I think that I am writing to concluding that Willie Rennie does not like that. I do not know whether his concerns are related to the planning application, but if that is a concern for Willie Rennie, I would make the point that nothing that we agree in a city deal in any way takes away the need for local partners, especially local authorities, to follow whatever statutory processes are involved. I think that it is also worth saying for Willie Rennie's benefit. Of course, in relation to the application that he refers to, sometimes there are other ways to fund these things if that is what is desired. We established, I think, when I was housing minister back in 2011, a housing infrastructure loan fund to help with infrastructure-related developments, so I have asked the officials to make sure that they look at all options for any proposals coming forward from local authorities, which might unlock further development. However, the city deal will be concluded when the local partners and the UK Government are ready to conclude that deal. Alexander Stewart Thank you, Presiding Officer. The taste city deal is a fantastic opportunity to bring vital investment into the area and drive economic growth. Can the cabinet secretary provide an update on how talks are progressing and does he agree that this is an excellent example of benefits brought by co-operation between the UK and Scottish Government? I do sometimes wonder about that co-operation when I receive letters from—like the one that I received from the member and his colleagues this week—conservative members. We are trying to work very closely with the UK Government in relation to that. When I and Lord Duncan appeared before the Parliamentary Committee, the local government committee, that was the first time that ministers from both Governments had appeared before the Scottish Parliamentary Committee. If you look at the record from that meeting, you will see that there is a substantial degree of joint working. We are trying to do that. The idea of unraveling those deals in advance by making announcements, which the member asked me to do in the letter that he sent to me, would be disruptive to that joint working. However, yes, it is true that we value very much the fact that the local authorities and partners are the ones that come forward with proposals, and we and the UK Government jointly consider and announce at the same time which of those proposals we are able to take forward. I think that it is a very valuable process, but we should observe the interests of the different parties involved in it. To ask the Scottish Government what action it is taking to ensure that an increasing use of automation and artificial intelligence over the next decade will increase employment opportunities in Scotland. The Scottish Government recognises the importance of emerging technologies and how they will influence the future labour market. That is why I published our labour market strategy in August 2016 and why we established the strategic labour market group to provide advice in a range of matters, including automation and artificial intelligence. In Scotland, we have record levels of employment with a highly skilled workforce. We continue to encourage people to pursue science, technology, engineering and mathematics careers through careers advice and guidance at schools and in the developing Young Workforce programme. Through the Enterprise and Skills Strategic Board, we are working to ensure that the planning commission of our annual £2 billion investment skills is better co-ordinated and responsive. We continue to support businesses to take advantage of new technologies and advance their ability to integrate with that in digital. We are investing £48 million in the national manufacturing institute for Scotland and are providing support for innovation centres such as Sciences and Datalab. Almost a quarter of jobs in Dundee could be lost to automation by 2030, according to a recent report. At 64.1 per cent, Dundee is already well below the average employment rate, the lowest city of any in the UK. An extra 10,000 jobs are needed just to put Dundee on par with the rest of Britain. Will the minister tell us how he will create those 10,000 jobs and how many new jobs his Government has created in Dundee since coming to power? I recognise the report that the member has referred to. I recognise what it has said about the potential impact of increased utilisation of automation. Of course, there are other reports that provide different assessments. I recognise that there is a lot of good happening in Dundee right now. When I am there, I am very pleased to see the investment that is happening in regeneration, particularly at the waterfront, which is driving an increase in job growth. The report that Mr Bowman referred to highlights at Dundee shows one of the strongest growth rates of private sector jobs. Just a few moments ago, we heard from the Cabinet Secretary our commitment to ensure that the Tay cities regional deal has progressed as soon as possible. We are making every effort to ensure that Dundee continues to benefit by the efforts of this Government to ensure that people in Scotland have the chance to get into the labour market. Self-drive automated vehicles are a specific technology that will have a significant impact not only on employment profiles and opportunities for industrial innovation, but also on many other areas of public policy, including planning, housing, environmental energy and regulatory policy. As a parliamentary liaison officer for the economy, I take particular interest in this area. Can I therefore ask what work the Scottish Government plans to do to prepare Scotland for this specific and rapidly approaching technological revolution? I can assure Mr McKee that I take an interest in this matter as well. The critical thing for us to do is ensure that not only do we have a workforce that is adaptable and ready and responsive to changes in our economy and our labour market, as is likely to be the case through automation, but also that we stand ready to benefit by opportunities to ensure that we are not just the consumer of new products and new innovations, but we are also an invent and producer of them as well. That is why we are taking forward developing such the national manufacturing institute. I have referred to a moment ago and that is why we have supported innovation in Scotland by increased support for our research and development grant funding, increased by a total of £45 million over the next three years, and almost 70 per cent increase. Jackie Baillie Although I am sure that the minister joins with me in welcoming the opportunity presented by automation, there are understandable concerns about the potential job losses, something like 230,000 Scottish jobs that are identified by the city's outlook. What specific forward planning has the Scottish Government done beyond the list that it has read out? I think that we would be reassured if it was working with businesses specifically on this issue to mitigate the job losses, but also to create the high-skilled, highly-paid jobs for those who might be displaced. Ms Baillie can ask the cabinet secretary, but I will answer the question if she does not mind. I recognise the points that she has made. I hope that the answers are given thus far. It gives a sense of the importance in which we are attaching to this area. I have already referred to the fact that our labour market strategy explicitly recognises the challenges that automation can bring forward. That is why we have established the strategic labour market route. That includes many representatives from industry themselves. We will be willing to engage and discuss with anyone about their perspective on those matters. Of course, we also need to ensure that we have a workforce that is adaptable, flexible and ready to respond to some of the challenges and opportunities that we have ahead of us. That is the work that we take forward through a range of initiatives, such as the developing young workforce strategy that we have, such as the STEM strategy that we have laid out. We will continue that work. Stephen Hawking has said that the emergence of artificial intelligence could be, and I quote, the worst event in the history of our civilisation, were Professor Kevin Warwick of Coventry University attested network AI systems. Can it be just switched off when they go rogue? A particular problem in military applications where the AI is currently being developed? Will Tesla, car maker and space pioneer, Elon Musk, assert AI to be as big a threat to humanity as climate change or nuclear war? Those views may well be alarmist. However, can the minister explain what safeguards are being developed in relation to artificial intelligence here in Scotland? Far be it from me to disagree with Stephen Hawking, but I think that Mr Gibson is correct to say that those views may be somewhat alarmist, but I recognise that that is a particular concern. It is incumbent on us not only to consider the potential impact on the labour market but also to hear those concerns. That is something that we will do by working in conjunction with industry and academia to give us a full understanding of future technologies to ensure that we can make an informed judgment about the move towards the introduction of greater automation in the labour market and the introduction of artificial intelligence. To ask the Scottish Government what impact a hard Brexit will have on the Scottish economy. The Scottish Government published Scotland's Place in Europe, People Jobs and Investment, on 15 January. That assesses the implications for Scotland's economy if the UK exits the European Union. The analysis in that document indicates that a hard Brexit could lead to a loss of up to 8.5 per cent of GDP, or £12.7 billion in 2016 terms, in Scotland by 2030. That is equivalent to £2,300 per individual. Outside of the EU, continued membership of the European Single Market and Customs Union is the least-worse option for Scotland and the rest of the UK. As we move into the crucial second phase of the negotiations, it is time for the UK Government to start putting jobs and living standards first and to ensure that the UK position fully reflects all parts of the UK. I thank the cabinet secretary for that reply. What is the Scottish Government's reaction to Daning Street's statement, declaring that the UK is categorically leaving the customs union? On the one hand, it is the utter disrespect that shows to the devolved administrations who, by all convention, should have been involved in discussions around this before that kind of statement was made. However, being outside of the customs union will create barriers to trade for businesses across the UK, and that is why the Scottish Government has consistently made the case that maintaining our membership of both the European Single Market and the customs union is essential to the prosperity of Scottish firms and the Scottish economy. I thank Ash Denham for asking the question in the first place. It is a question that we will never hear from the Conservatives, nor from Richard Leonard, although we might hear it from Jackie Baillie on occasion. Thank you very much. That concludes our questions on economy jobs and fair work. We turn now to portfolio questions on finance and constitution. Question number one was withdrawn, so we go to question number two from Patrick Harvie. Can I ask the Scottish Government what would be involved in an EU continuity bill in the event that this Parliament does not give legislative consent to the EU withdrawal bill? All parties in this Parliament have agreed with the France and Constitutional Committee that the UK's EU withdrawal bill is incompatible with the devolution settlement in Scotland, and the committee's conclusion is that the Parliament should not give legislative consent to the bill as it is drafted. In those circumstances, the Government has a responsibility to prepare so that, on any scenario, there is a legislative framework in place for protecting Scotland's system of laws from the disruption of UK withdrawal from the EU. Michael Russell and Joe Fitzpatrick set out those plans in their letter to the Presiding Officer on 10 January. I note the Scottish Government's openness to the possibility that agreement can be reached on changes to the EU withdrawal bill. However, unlikely that prospect seems to be to me. Michael Russell, the minister responsible, has told the finance and constitution committee that a continuity bill has already been drafted and given to the Presiding Officer. It is clearly not possible for that to be published until the Presiding Officer has made a ruling. Surely, if we are to take seriously Mr Russell's commitment to maximum scrutiny, the Scottish Government is in a position to publish now at least a discussion paper on what the contents of such a bill would be, given that we are not going to be in a position to have any kind of meaningful public consultation on such a huge and far-reaching piece of legislation. I am sure that Mr Harvey will understand that the Government has to follow the arrangements that are put in place by Parliament for the proper consideration of bills by the Presiding Officer, and that is exactly what we have done in this circumstance. To help Mr Harvey in relation to the contents of the bill, I think that Mr Russell has set out very clearly in his committee appearances the provisions that would be necessary in a continuity bill, as I set out in my original answer, to provide a framework in place to protect the system of laws from disruption as a consequence of UK withdrawal from the European Union. We will consider the point that Mr Harvey has raised about any dialogue. Mr Russell has made clear to the committee that the Government wants to have the maximum scrutiny of the bill that is possible in the circumstances that prevail. However, we will have to consider that point in the context of the wider discussions that we have with the United Kingdom Government around the amendment to the EU withdrawal bill. I thank Patrick Harvey for bringing this matter to the attention of the chamber. I think that it is an exceptionally important one. Given that the United Kingdom Government has repeatedly committed to amend the European Union withdrawal bill to meet the concerns of the Scottish and Welsh Governments, concerns that the Scottish Conservatives have shared, and given that negotiations between the United Kingdom Government and the devolved administrations on the matter are proceeding and are making progress, does the cabinet secretary not agree with me that introducing a continuity bill into this Parliament at the moment would be unnecessary, premature and unwise? I encourage Mr Tomkins to reflect on the circumstances and scenario that I put to Parliament in my original answer to Mr Harvey. I said that, as things currently stand and Mr Tomkins is a signatory to this, the French and Constitution Committee have indicated that they could not give legislative consent to the EU withdrawal bill. I am party to the negotiations with the United Kingdom Government on the amendments to the bill and I have to say that I have a less optimistic assessment of where we are than Mr Tomkins has given to Parliament today. Mr Tomkins will know that I am very familiar with negotiations with the United Kingdom Government and I am very familiar with coming to agreements on those points and I am far from optimistic about where we are placed. In those circumstances, I think that the Government of Scotland has a duty to make the arrangements that we have made. We are not doing anything prematurely, we are doing things to ensure that we can protect a framework of stability around the legislation within Scotland if we are unable to give legislative consent to the bill and, as things stand just now, the Scottish Government remains unable to give legislative consent to the EU withdrawal bill. Bruce Crawford I am also grateful to Patrick Harvie for raising this question today. I wonder if the cabinet secretary would agree with me that the ball is currently in the court of the United Kingdom Government to respond in the way that the Welsh Government, the Scottish Government, and the Conservative Party and the Labour Party want it to respond. That is a clear issue to be resolved. Either you believe in the devolution settlement or you do not believe in the devolution settlement, and it is time that the UK Government expresses in a proper way that it believes in the settlement and where it stands. The very sharp issue that we confront is whether the EU withdrawal bill will be compatible with the devolved settlement. That is the hard test that has got to be resolved by the negotiations in which we are currently involved. That view has been expressed very powerfully in the House of Lords by Lord Hope, who I think has given a very clear assessment of the legislative difficulties that this Parliament would face in signing up to the EU withdrawal bill as it is currently constituted and has given to the United Kingdom Government a very clear direction as to what amendment has to be made to make the EU withdrawal bill compatible with the devolved settlement. I agree with Mr Crawford that that is the sharp issue that the UK Government has got to resolve. However much we may wish to get to a point of agreement, we cannot get to a point of agreement that jeopardises the integrity of the devolved settlement, which was legislated for in 1998 and subsequently amended and which has served this country well. Question 3, Liam Kerr. To ask the Scottish Government how much financial assistance has been granted to Scottish businesses and in what form, loan, guarantee, equity or other, under the Scottish growth scheme. Cabinet Secretary, Derek Mackay. Under the Scottish growth scheme, Scottish Enterprise continues to assist companies looking to secure investment from the Scottish European Growth Co-Investment programme. In the meantime, a total of £25.7 million in equity funding has been agreed and invested in 28 companies under the new and additional resources provided to the existing SME holding fund. We expect to utilise further European structural funds to expand and enhance the SME holding fund under the Scottish growth scheme in 2018. That will support microfinance, debt and equity investment. Liam Kerr. Thank you, cabinet secretary, for the answer. When the SNP Government unveiled the Scottish growth scheme 18 months ago, it was hailed as a £500 million vote of confidence in the Scottish economy to be made up of loans and guarantees. The scheme is now in the form of equity that is sold by business and only a fraction of the £500 million assistance that has been made available to business in Scotland. Can the cabinet secretary confirm when the balance of £500 million will be made available? That commitment and fairness will be spent over and supported over a number of years. I think that some of the deals will take time to conclude because some of it requires investor collaboration as well. It is not simply a case of people applying for a £500 million worth of support, although the commitment is absolutely still there. What we have been able to do, though, is to be quite adept and adapt some of the support around what is required around commercial financing. I have worked with the banks on this as well and the British Business Bank to ensure that what we can provide is additionality rather than substitute finance. In that regard, we have worked with other partners and the enterprise agency to ensure that there is a range of support so that we can absolutely deliver on that financial commitment. It will be a variety of measures from equity, loans and guarantees. I suppose that we had first envisaged more use of guarantees, but there seems to be more interest around other areas. That said, of course, we are progressing the plans around the Scottish National Investment Bank and other new measures to be able to support business. My colleague Keith Brown and his ministerial colleagues will enjoy the 64 per cent uplift in the economy portfolio in terms of spending and use of financial transactions as well. I say again that some of those deals will take some time to crystallise that there are other investors involved, but the support is there and we will work very hard to promote the range of schemes under that umbrella so that we can support our commercial and business community. To ask the Scottish Government what discussions the finance secretary has had with the Cabinet Secretary for Communities, Social Security and Equalities regarding how the 2018-19 budget can contribute to tackling child poverty. I meet all members of the cabinet regularly to discuss how best to use the budget to deliver the Scottish Government's priorities of tackling inequalities and creating a more prosperous and fairer Scotland. The draft budget sets out a number of measures to tackle child poverty, including establishing a £50 million tackling child poverty fund, £8 million to fund the baby box, investment of £233 million towards providing expanded childcare and supporting local authorities, including the attainment Scotland fund, as well as the commitment around attainment of over £750 million, or further housing investment, as well. The first delivery plan, under the Child Poverty Scotland act, will be published in April and will set out a range of actions in this parliamentary term to make progress towards ambitious targets to reduce child poverty. I thank the cabinet secretary for his response. Is the cabinet secretary aware that findings from the child poverty action group in Scotland tell us that raising child benefit by £5 a week would lift 30,000 children out of poverty, something that Scottish Labour supports? Since the Scottish Government has not included plans to specifically do this in the 2018-19 budget, how will the Scottish Government lift 30,000 children out of poverty? I thought that I was already able, in the first answer, to set out some of the actions that were taken. Further to that, there is another £100 million of welfare mitigation. I hear the point that is made around top-ups to child benefit. We have asked the Poverty and Inequality Commission to provide advice on this and the sustainability and suitability of using that power. As it stands right now, it is estimated to cost around £1.25 million every year. As we understand it, only £3 a every 10 would go to households in poverty if those proposals were implemented. That is exactly why we have asked for more information for that to be explored. I do not think that, with any credibility, a member of the Labour Party can talk about when on terms of budget, when you realise that the revenue-raising powers do not actually raise the revenue that is suggested. To ask the Scottish Government how many people in North Ayrshire will see their income tax rise increase in 2018-19. Scottish income tax data and forecasts are not produced for local authority areas. Overall, however, 70 per cent of Scottish taxpayers will pay less income tax in 2018-19 than they did this year for a given income. Nobody earning less than £33,000 will pay more than income tax next year. Jamie Greene In the absence of any answer, perhaps I can help the cabinet secretary out. Analysis of his tax plans showed that up to 24,000 hard-working people in North Ayrshire will see their income tax rise this year. Contrary to what the First Minister said last week, those are far from Scotland's richest and wealthiest. In fact, many will be deeply disappointed by that. Given that local SNP constituency members were elected in 2016 on a specific manifesto promise not to increase income tax, does the cabinet secretary and his colleagues owe people an apology for breaking that promise? We will be investing more in public services. We will be turning a Tory real-terms cut to resource budgets into growth, including for the health service. Jamie Greene is one of those politicians who consistently demands more money to be spent in his region, but also wants to raise less at the exact same time. Incidentally, the median salary in North Ayrshire is £23,352, which will show that, just like the rest of the country, a majority of Scottish taxpayers will pay less, not more, under the tax plans that I have put forward. Of course, some of the tax changes that we have made will invest in local government. Since North Ayrshire has been mentioned, it will benefit from the deal with the Greens to the tune of a overall nationwide to local government £170 million, and North Ayrshire's figure is £4.2 million extra, opposed by Jamie Greene. Ivan McKee. I was going to ask the cabinet secretary how many people in my constituency of Glasgow Proven will see their income tax reduced as a consequence of his budget, but clearly we don't have that data available at constituency level. However, I do expect that there will be far more winners than losers. Does the cabinet secretary agree that injecting cash into lower-income households will have a far greater impact on the economic multiplier effect as a consequence of those households having a higher propensity to consume, thus helping to grow the Scottish economy? Yes, I agree with that. SFC has provided evidence around that, as well as the modelling that we produced for the discussion paper last year. That is correct. Incidentally, the issue around data is not Scottish Governments doing, but it is HMRC that collects income tax in Scotland. If we want to see data enhancements, it will be for them to provide that either constituency or local authority analysis. James Kelly. Recent figures from the end-child poverty coalition report reveal that, in North Ayrshire, nearly 30 per cent of children are living in poverty. That figure has been as high as 36 per cent in the urban west ward. Does the cabinet secretary agree that those figures are unacceptable, rather than running off a list of excuses as to why she cannot take action on child benefit? She should not be seriously looking at how to use the powers of the Parliament in order to alleviate those concerning figures. I do not think that those levels of poverty are acceptable, which is why we are taking a range of actions to tackle that. We could do even more if we had welfare powers that we do not have. Labour was not particularly supportive in getting it over the decades that it had the opportunity to do so. Specifically, in relation to Labour's propositions, I say again that the alternative budget that is put forward by the Labour Party is totally incredible. It does not stack up, it does not raise revenue and it calls on us to use powers and mechanisms that are not currently in place. Let us unite around tackling poverty, but let us do it in an incredible way, which is exactly what this Government proposes to do. Question 6, Alex Cole-Hamilton. Do you ask the Scottish Government what its response is to the recent Guardian ICM survey, which suggests that 69 per cent of people in Scotland support a referendum on the final terms of Brexit? The Guardian ICM survey provides further evidence that most voters in Scotland want to remain in the European Union. The Scottish Government recognises the arguments in favour of a second EU referendum, although it is not currently government policy. The Scottish Government believes that it is vital that devolved administrations are involved in the negotiations by the United Kingdom with the European Union to ensure the interests of Scotland are protected. Alex Cole-Hamilton. I am grateful for that answer. For 18 months, I have heard this Government demand that a democratic will of nearly 70 per cent of the people of this country be recognised in the conduct of Brexit negotiations. Yet this Government is completely silent in representing the views of nearly 70 per cent of Scots who now support a referendum on the final terms of a Brexit deal. Does the cabinet secretary accept that for every day that goes by when his Government refuses to join calls for a referendum on the final deal, a day is lost in the efforts to offer the British people the opportunity to reverse one of the most calamitous decisions in the history of these islands? John Swinney. I agree with Mr Cole-Hamilton about the calamitous nature of the EU exit decision. What the Scottish Government is doing is working very hard to try to ensure that we are able to influence the decisions taken by the United Kingdom Government in this respect in their negotiating position. There are two important dimensions to that. The first has been the evidence and arguments that the Scottish Government has marshaled to support continued membership of the single market and the customs union. In my opinion, an answerable case has been made by the Scottish Government, which has been cast aside by the illogical decisions of the United Kingdom Government. Secondly, we have been trying to ensure that the UK Government fulfills the commitments that it made in the establishment of the joint ministerial committee on European negotiations and that the devolved Administrations would be actively involved in the negotiations of the UK position. That has not happened and indeed today UK ministers will be meeting to try to arrive at a final UK position and the devolved Administrations, not just the Scottish Government but the devolved Administrations as a whole, have not been involved in that process. If the UK Government wants to be taken seriously about the conduct of those negotiations, they should respect the agreements that they have signed up to themselves and ensure that the devolved Administrations are fully involved.


Okay, now let's talk about something that I think is more interesting, something that we're actually doing in Bangalore here. My team is placed here in Bangalore. Engineering work. That's what I'm going to be talking about today. So all of this work is actually happening here in Bangalore. So I work on something called Alasio Marketplace. This is being engineered here in Bangalore. And Marketplace looks a bit like this. There's a website you can go on and download plugins, extensions, add-ons for Jiro Confluence, Bitpocket, and so on. So if you want to extend Jiro Confluence in some sort of way, if you're using it, which chances are pretty high that I've talked to a lot of people here so far and a lot of people are using Jiro Confluence, if you want to extend it in some way, you can go on to Alasio Marketplace and find maybe some sort of extension that works for you to extend it in something that you want to, in some way that you want to extend it in. So the way that this is all created is, sorry, I'll talk about the agenda first. So we're going to talk a little bit about something called Nix. Nix is a particular tool that we use, but I wanted you to focus more on the ideas. Then we're going to talk about how functional programming relates to the idea of packaging and building software. Then we'll talk about the idea of functional programming, how it relates to operating systems. And then I'll show you some two examples that we have, which is development shells that we use inside of Marketplace and then Docker images, which is how we actually deploy Alasio Marketplace. We use Nix to build Docker images and we deploy like that. So if you're interested in how you can build Docker images without ever looking at a Docker file ever again, stay until the end. Okay, so Nix is the particular tool that we use and Nix has got a lot of problems. I'm not going to be here defending and defending a lot of the decisions that were used in the process of making Nix, but the ideas I think are really important. The ideas give us a lot of benefits. I'll talk about some of the benefits. I want you to focus more on these ideas. Yes, you might see some weird syntax. You might not like parts of it. That's fine. I want you to focus more on the ideas than the implementation that we're using. Okay, so in the 12th century, we're going back quite a bit in time, there was the idea of a function. There's some argument about if this was the 12th century, 13th century, 14th century, it doesn't matter. A long time ago, functions were created and one of the properties of functions is that if you give a function the same input, you'll always get the same output. So if I've got a function that is plus one and I call that function with, for example, 10, I'll always get 11. There's no day in the year where I call that function and I give it a 10 and I'm gonna get it back at 13. It's never gonna happen. So the functions have the property, that same input always have the same output. And so there was a guy called Ilco Dostra who was doing some research and at the time, he was interested in the idea of applying functional programming to building some software that he had to build. And so that was back in 2004, he created this idea of NICS, which was an application of the idea of taking functions and applying it to build. Then we'll talk about how that looks in a minute. Four years later, he actually evolved that idea of NICS. So Father, he was able to build a Linux-based operating system on that idea. So within four years, he got it. It wasn't a very advanced operating system, but he progressed the idea fast enough that he was able to get an operating system built on top of that. And then I think in 2014, late 2014, I actually started using the NICS package manager. So I was using it on Mac OS. I was using the NICS package manager and I was installing packages and using it as a replacement for Homebrew. About a year later, I actually switched over to using NICS OS. The operating system was usable enough that I actually just completely switched over it. And in fact, this presentation is being displayed from NICS OS at the moment. I am running this NICS OS operating system. Okay, sorry. So support, so everyone, first thing I want to mention, NICS, is the first question is always about support. Can I run NICS today? What can I use it with? So NICS, when we talk about NICS, there's actually many things that people refer to. There's the NICS programming language. They use the NICS programming language to specify builds and packages for your software. And then there's the NICS package manager. And this can get pretty confusing pretty quickly because you talk about NICS, you might be talking about any part of this. So the package manager runs on Linux. That's primarily where people use NICS. But there is, a lot of people do use it on Mac OS as well. And it's pretty good support for a lot of packages on Mac OS. Not every package, like NICS, has definitely got more packages, but Mac OS has got quite a few packages as well. I was definitely reusing it as a replacement for Homebrew back in 2014. So I'm sure it's probably good enough to replace Homebrew with today. On top of that, sorry, there's also a WSL, which allows you to run Linux executables on Windows. I've played around with this and it's actually pretty impressive. You can actually use NICS to build Windows executable files. So windows.exe files using NICS. So if you're interested in building Windows software, I don't think this has been explored very much. I've explored it very quickly, but it could be explored a lot more and I think there'll be some really cool stuff. So if you're interested, if you use Windows and you're interested in these ideas, come talk to me, I'm happy to talk more about that. And then there's NICS OS, which is the operating system that builds on top of the package manager, which builds on top of the programming language. It makes an operating system out of these ideas. And then on top of that, we have something called NICS Ops. So NICS Ops is built on top of NICS OS, which is built on top of the NICS package manager, which is built on top of the programming language. So you can see at each level, we kind of build on top of the previous idea. And there's a lot more tools around NICS, but these are the kind of the top four kind of popular NICS tools that are around. Okay, so if you use any of these at the moment, so if you have some sort of minor configuration, this is, so there's a guy called Steve Trugo who came up with the idea of a divergent convergent and congruent configuration. So if you are doing any type of divergent configuration, that is you've got a system and you just run manual scripts on it or you install Debian packages, or you're doing anything manually on a system, you can think about using NICS to automate that. If you have some sort of convergent configuration being a puppet, ansible, chef, something like that, you can also see NICS is a bit of a replacement for that. And we've started going into the idea of like immutable infrastructure, like using Docker images and deploying using Docker images, using Kubernetes and things like that. You can use NICS as a replacement for those ideas as well. This is the last one here is actually GUIX, which is a fork of NICS, and it just replaces parts of NICS. So if you don't like the particular programming languages, we're gonna use the NICS programming language, if you don't like that and you like Scheme, GUIX replaces the NICS programming language with Scheme. So just really quickly, this is divergent configuration, you have some sort of current state, which I've represented as a dotted line, as the current state, and then at the bottom we've got the intended state. And so state, the intended state might change over time, we might have new requirements come in, so we've got an updated specification, and so we're trying to get a system to be along this solid line at the bottom. But what usually happens in a divergent system is if you're doing manual sort of management, as you're running scripts, you might not know the actual state of the system, and it's eventually diverging from the intended state. And so people go on there, they'll make us some sort of file, that file might not ever get deleted, when it should have been deleted. People go on there, they modify slash ETC, and they put some sort of configuration in there. So eventually your system starts to diverge, and especially when you have more than one system, if you have more than one computer that's running, these, that you're trying to get to be consistent to try and be this intended design, eventually over time, they diverge. They start becoming very different. So I've been here. A lot of tools come up, so Puppet and Chef and so on, have come up to try and make it so that you can take some sort of existing state, so I've represented them as a dotted line here, so some sort of existing state, and you can try and get it to converge towards some sort of intended state. And so over time, if you give it sufficient time, eventually you can kind of say that you want this package to be absent, and so now on all your systems, you know that package is not installed. So it's the ability of saying that you don't want certain state, and you do want this state. And so you can apply this to different systems, and you can try and get towards a state, but it's always trying to take a current state, a current unknown state into a known state. What we've started moving towards with Docker images and Kubernetes and so on is this idea of convergent configuration, sorry, congruent configuration. So with congruent configuration, your state should always be what you intended to be. So you fully specify what your state is, and you might notice that there's a tiny gap here of kind of like the actual state and the intended state, and that's because we can allow things like we can say that we have all of this state known, except the mount directory. So we can still have mounts that have state in them that we don't know, but at least we know everything else about the system. So we can say that we know everything about this system except this part. That's the idea of congruent configuration. And that's what NICS applies, not only to system configuration, but also to packages and everything. We always say that we know what the output is going to be of our system, which I think is kind of the important thing here. So we're always saying that we know, we always can reproduce the state of a system. Okay, and so this idea actually applies to a lot more than what Puppet and Chef and Ansible kind of apply to. This thing applies to everything. We can use this next thing to basically do any type of system configuration that we need so we can do virtual machines, we can do, what else we've got up there? We've got cross compiling, GUIs, people use this for testing GUIs, people use it for CI. Actually, my team uses it for CI as well. You can build Debian packages, you can build app images, all of these different systems you can use just one tool, which I think is really, really incredible. Now, my team uses NICS for continuous integration. So we use it to kind of give us all of our CI tools. We also use it for two other things. I'm going to talk about development shells. So local developers, people when they're trying to develop our system, we use these development shells, which is supplied using NICS, and also we deploy all of our infrastructure using Docker images that are built using NICS. All of Marketplace, we use NICS for development shells, CI and Docker images. Now I'm just going to talk about the last two, but I'm going to first talk about how all of this works. So we can think about package management using the idea of how can we apply functions to the idea of package management. So you can think of a package as something that takes some sort of build input. And so that build input will be the source code, other dependencies that it needs, and some sort of configuration. So you can combine all those together and say that's the input that we need to be able to build a package. Then you've got some sort of build steps, and those are the steps that you need to take that input into some sort of output, and the output's going to be some sort of artifact. So some sort of build artifact that might be a demo package, or it could be just some sort of binary that you want or so on. So you've got the idea of build input, some sort of steps, and then some sort of build output. So that's how we can represent this as a function. Here's a graph of what we see as package management, right? We've got a package D that depends on package B, which depends on package A or something like that. So you've just got like a tree of packages. So we can represent these things using just an expression language. So next we've got this thing called expression language or a programming language, but some people have a bit of a problem calling it a programming language because it's not very advanced, but it's enough to kind of just give you the idea of functions and values. So some people call it just an expression language, the next expression language. And we can represent these build inputs and these steps using this expression language. This is just a programming language, just things that allow you to write some sort of expression. So once we've got this, then we can represent build inputs, the build inputs to our program. So these build inputs being source code and configuration and dependencies. We can represent all of those just values in our program. And we can represent the build states as just values as well, but these values can be produced using different functions. So here's one example. We're going to call, this is an example of the next expression language. And this is the part where Nick starts showing some of its problems and that's fine. If you want to replace parts of Nick's, I'm happy for that. But I want you to focus more on the ideas. The idea here is that we're calling a function called make derivation, mkderivation. And we're giving it some values. We're giving it a name and we're giving it a build command. And that build command is just a shell script. So we're saying we're making a package, derivation here you can think of as a package. We're making a package. It has this name and here's how to actually execute and build that package. So it's echoing hello world into some sort of out file. Okay. Now we can actually refactor this. So there's something called GNU Hello. So it's a hello world application. GNU actually publishes this. You can download it from the internet. So we can actually say that this is an input to our program. And so hello is not defined here, it's defined in some other file. But it is just again just another derivation that tells you how to build GNU Hello. Or we can use any now an expression instead of echoing hello world directly we can use this hello program and echo it into out. So now we're just using another value. So we've got this idea of functions. So we just got this other function here which is hello and we can bring that into scope and use it. We can refactor it once again. There's this other next function called run command. And it does basically the same thing as this. So make derivation and run command. Do very similar things. Run command says I'm going to run just a shell script. So we don't have to say before previously we had to say build command equals something. Run command kind of factors out that duplication. We see this over and over again. We see this build command equals, build command equals, build command equals. So we can just use this function called run command which does exactly that. So we are able to use functions to reduce duplication in our package management and our configuration and our build input and so on. So we can start using functions to minimize the amount of code that we have to write which I think is really cool. Something that's very difficult to do when you start using YAML, you'll often find duplication, duplication, duplication. When Nix you can just factor that out into a function which I think is really, really cool. Okay, so I keep using this word derivation. You can think of it as something like a package. But a derivation is kind of like the actual serialized output that represents the build. So previously we had the idea of functions. We've got a function that calls another function which calls another function. Once you evaluate that all down, you'll get a data structure. And that data structure represents, so that data structure's called a derivation and that represents your whole build. There's everything that you need to be able to build that pit of software.  So it's a tree of the package that you're trying to build and then all of its parents are the other derivations that you need which will be the build inputs which will be the dependencies basically. It'll be the source code that you need and also the dependencies that you need. So all of this gets compiled down to a tree and it gets serialized to disk as a .drv file and there's a program called Knicks instantiate that takes the expressions. So something like this that we've written. It'll take this expression and if you Knicks instantiate it, it'll compile it down to a .drv file, put it on your hard drive for you to be able to build. So it's a serialized representation of your whole build. Okay, so this is calling Knicks instantiate on the Knicks file. So this is the Knicks expression. Now we've got a .drv file. And notice how it's SN8i, I've actually truncated that. It's a lot longer, it's like a 32 character hash and that hash is of the derivation file. So we actually have content addressable derivation files. So if you were to instantiate this twice, you'd actually get the exact same file as an output. So it's all content address. And inside of this file, it'll have, it's basically a JSON file. It's not actually on disk, but basically a JSON file. You can represent it as JSON. There's actually like a code format that represents it as JSON for you. And it has outputs. And these outputs are gonna be what, where the artifact is gonna go. And it also has this input derivation. So these are other derivations that it's going to refer to. So in this case, we're going to refer to, oh sorry, this is input sources. This is gonna refer to the default builder. A default builder is just like a thing in Knicks where it brings in like a heap-ish helper. A lot of Knicks builds happen very similarly. So this is just kind of like a lot of helper functions that we use, a lot of helper bash functions that we use. Now, here's the input derivations. And these are the dependencies that we have. So we depend on bash, we depend on the standard environment for Linux, and we depend on the hello derivation. So the hello program. So to build this artifact, which is just gonna be piping hello, hello program throughout, we need to depend on hello. These are just the dependencies. Here we have x86 to 64 Linux that's what I've instantiated this Knicks expression on. And so because I've run it on a Linux machine, it says that it's going to be able to be built on a Linux machine. It's got a few other things in there. It's got the builder, which is gonna be bash, we're gonna be running bash, and we're gonna run it with default builder. These are just, you know, we're just gonna run bash. We're just running a shell script, right? And then we have here just a lot of different environment variables that get put on things. So when the bash runs with the default builder, it's going to use a little of these environment variables primarily it's gonna use the build command, it's gonna run that build command, and it's gonna pipe it out into a file and run out on our program. So this is gonna be building an artifact. So now that we've got the kind of full definition of a build as a file on the system, we can do something called realization, and realization gives you an output. I know this is all bizarre terminology, instantiation and realization, and this is maybe some of the problems with Knicks. But we're going from, the idea here is that we're just going from this serialized build on disk to actually running it and building it. Now realization is actually not called building because realization can happen in a few different ways. You can build just the software, and in our case, we will just build the software. But there's potential that because everything's content-addressed, right? And we have this content-addressed hash of the derivation. We could also realize it by going off to the internet and saying, hey, do you have an output for this derivation? Do you have this file available for us? And then we could just download it. So caching just comes for free. It's absolutely for free. So caching just happens, which I think is super, super cool. We just get it for free. No magic involved. Just content-addressable files. Yes, and we've got a different notion of purity. So the idea of purity we had before is that in the Knicks expression language, everything is just an expression. All functions will always return the same output. So if you call make derivation and you give it a heap of steps, you'll always get the same derivation as an output. So if you give it the same steps, you'll always get the same derivation. That's just always true. So that's the Knicks expression language. It's got the idea of purity because the same input always gives the same output. They're always functions. Now there's another notion of purity, which is that if we go to realize a derivation, realizing it twice, the same derivation, realizing the same derivation twice, should always give the same build artifact, byte for byte copy of the same artifact. So if I was to run my build at the moment, which is gonna pipe hello world into a file, running that twice, I should always get exactly byte for byte, the same file, which would just be hello world. Now in theory, it's possible for us to kind of violate this. Knicks provides some tools to try and make it possible that builds are reproducible, but you can still use call out to date, for example. You can call out to date, pipe that into a file. Knicks is not going to stop you from doing that. It's just gonna provide some tools to help you to stop from doing that, but it's not going to prevent you. Now in theory, you're able to put in the dates and so on into build artifacts. But in practice, the Debian project and Knicks have kind of gotten together and they've made like this reproducible builds.org. They've put a lot of effort into making it so that all packages have reproducible builds. So pretty much all the packages that you get by default in Knicks have reproducible builds and Knicks actually provides tooling for you to run the same build like 20 times and verify that they are byte for byte the same every single time. So there are some tools provided by Knicks and in practice, this is actually pretty good. And in practice, our last year marketplace, because we're using this tool, we are byte for byte reproducible. We can take the same build and do it twice and have exactly the same output. Okay, so this is how to realize you call Knicks Store and you can say realize. There's actually commands that do basically instantiation and the realizing together. I'm just showing you kind of the underlying concepts of how Knicks works. You've got the idea of realization of a derivation which will give you an actual artifact. So we can cut that file and we got Hello World. That's how to do Hello World and Knicks. I'm sorry, it was a bit complicated, I know, but there are easy ways to do it. I'm just showing you kind of how it works underlying. Cool, so now let's talk about how to apply the idea of functions. So we've got the idea of functions to packages, right? We've got the idea of functions being same inputs, same output. And to packages, same input is the same source code, same, there's two levels. So let's start with the expression language. With the expression language, same values that you provide to functions should always return the same value. So with the next expression language, calling make derivation with the same thing will always give you the same output and will always serialize the same file on disk. That's cool. Second level is that when you go and realize the derivation, so once you've got this fill definition in your system on your disk and you try and realize it twice, it should always get byte for byte, the same artifact as an output. So those are two levels of functions there. So now we can apply that same idea to operating systems. How can we think about functions, sorry, operating systems as function? I'll show you, this is a partial, partial configuration of my system. So this is what I'm running right now. This is only a part of it, there's a lot more. But for example, I have Docker enabled, I've got OpenSSH enabled, and I've got a Brian user, I've got a UID for that Brian user. Now there's a lot more on there, I've got things like, I've got Xmonad, which is a window manager that I use. I've got a HIPAA different system packages and still like WGET and things like that. There's a lot of other configuration in there. I've got firewall rules, firewall rules are all defined using this. So I'm using this NICS programming language to fully specify my operating system, which I think is pretty cool. So we can think about operating systems as functions in the way that we specify the operating system as just kind of like a data structure, and then we use functions in a data structure. When we have configurations, when we go and use NICS OS, we can say, build this operating system for me, like build the configuration for me and it'll get registered as something called a profile. Now those profiles then get put into something called a derivation whenever you say, I want to boot from this build of, like so the profile contains things like the kernel, the packages, the ETC configuration, the path environment variable, things like that. So once we have a profile, we can register as a generation on our system. Once we register as a generation, it kind of gets put onto your grub bootloader and I'll show that in a second. But one thing we can do is after we keep changing configuration, if we change it maybe like 50 times over a month, I can say garbage collector ones I'm not using anymore. So we'll go back through history and say, I don't actually use that configuration anymore and get garbage collected. But until then, what they will do is show up in your grub bootloader. So for example, when I boot up, here's an example, I have generation 24, so anything before 24 has been garbage collected already, but everything from 24 to 33 is still around. So for anybody here who's screwed around with Linux graphics cards before, you're probably familiar with having a system that doesn't boot. It's very frustrating having a system that doesn't boot. And so what you can do with NICS is everything gets registered as a generation. So you can go back to a previous generation. So if I make a change in my NICS OS configuration and it no longer boots, I can go back to the previous version. So this has saved me a lot of times. I've changed configuration, I've changed IP table rules or something like that. I can always go back to the previous one and try again. Really useful. Okay, now to what Marketplace actually uses NICS for. I personally use NICS OS, but what does Marketplace 10 use NICS for? One thing is development shells. So here is that I don't have Python in sort of my system. There's no Python actually on this system. What I use is something called NICS shell and you can open up a batch shell with a particular package installed. In this example, in the top one here, I'm saying NICS shell-P Python, which means give me a batch shell but put Python on the path for me. So any bit of software that I wanna use, I can just open up a NICS shell and start using it. I don't have to install it. I don't have to go and do an apt update or anything like that. I can just do a NICS shell-P, put in the bit of package that I would actually want and I can start using it straight away. Then what you can do is write a shell.NICS file and all of Marketplace's projects have a shell.NICS file and you can go into that directory and type in NICS-shell with no arguments and I'll just open up a shell with all of the dependencies that you have for your package installed. So for us, we have like Node.js, Java, things like that. And then the team actually uses something called Durand which automatically, as soon as you go into a directory, it'll run that NICS shell and give you just a shell with all the dependencies involved. So you can just change between directories and have all your dependencies in scope, which I think is super-super cool. So you could have one thing that has like Node.js 8 and over here you can have Node.js 10. Change between the directories and just silently, it'll just switch between the versions of Node.js. This is an example of a shell. So you can say make derivation. You give it some build inputs. So for example, Node.js, what's this, 0, 8? Node.js 8, Yarn, Git, you know, we've got all of these things that we need when we go to build our software. Last line is interesting, we're calling the function called optionals and we're saying if it is Linux, we also want Firefox, because in our CI system, sorry, in our CI system, we also have like a UI test and that UI test uses Firefox. So we've optionally included Firefox and Linux. Okay, we'll finish up with one last example. Docker using Node Docker files. We don't use any Docker files on my team, but we do use Docker. We have an internal platform as a service inside of Alasium. The internal platform as a service takes Docker files and then spins up AWS instances, puts the Docker image on that EC2 instance and then runs it for us. So we give, we push some Docker images up to a remote registry and then we let the platform as a service take control of everything else. But we don't use any Docker files in the process there. We actually don't even use the Docker daemon at all. So Docker files look a bit like this. You say from, for example, Alpine, install a package, here we're gonna install Calse. Then we're gonna have, we're gonna actually run the Calse, if when we go to run the Docker image, we're gonna run Calse and then we're gonna expose port 8080. I'm just gonna put the port 8080 in there for some example, it's not actually used in this example. I've got some questions about this. What version of Alpine is this using? Latest? What version of Calse is it? Latest? What version of, so Calse is built on Pearl. What version of Pearl is it using? Whatever comes with Alpine, right? And what version of Lib C is it using? So these are the questions that I ask, right? And if security comes to my team and they say, what version of Lib C are you on? We've just found a vulnerability in Lib C. What version are you on? I have to go into the Docker image and have a look, right? Sucks, I've had to do this. So instead, with Nix, right, everything is reproducible. We know what version of Lib C is going to be there. We know what version of Alpine we're running on. Everything has to be fully specified. And this, I think, is a really big benefit in terms of security. We know exactly what version of everything is without even building it. We don't have to go and look at the build, at the artifact. So here's an example of a Docker image built using Nix, and there's no Docker involved at all. There's no Docker files involved. So here we have, so notice how it's not imperative either. It's not kind of saying, do this and then do this and then do this, and then finally we get a Docker image as an output. We're saying, we're having a declarative way of specifying the Docker image. So here we're saying, build the image. Give me Cal State as the content on that Docker image. And we're going to build it on top of Alpine. Now I've not specified either Cal State or Alpine in this file that I'm showing you. They're coming from a different file, but each of these is fully specified as well. Cal State has to say that it's version 3.2.1 or something like that. There's no possibility for it to say that it is Cal State, you know, the latest version of Cal State. It can't say that it has to say exactly what version it is. And the same thing with Alpine. In fact, Alpine, when you say from image, you actually have to give it a sharp 256 hash of the base image that you're going to be using. So it's fully specified. We know exactly what version of Alpine is going to be coming in. Okay, and then we're just going to leave, these are two of the things from the Docker file. We're saying which, what command it is and what expose it is. We're not doing it in an imperative way. We're not saying the line by line, what we want. We're saying, these are the actual, this is the actual configuration that we want. That's how to build Docker images without Docker files. The way that this works is that it, build image goes off and it actually supports the Docker specification for images. It supports the container format. So it actually knows that you need like a table and then that table contains all the files and then it needs a JSON descriptor. That JSON descriptor then has the expose ports command and also the base image that's going to be built on top of. So Nix actually understands like someone, this is not a built-in part of Nix. Someone has written Nix code that understands the Docker format and then builds Docker format images using Nix. So no Docker is involved at all in doing this but we are able to deploy two Docker. Cool. So the idea here is the idea of functional infrastructure by applying the idea of functions. So functions taking same input to same output. The idea that I'm trying to show is the idea of taking this idea, this same input to same output and applying it to packages, applying it to the language that we use to write these packages and then applying it to offering systems. And my team takes out, gets really good benefits for deploying a lasting marketplace. We've got byte for byte reproducible builds. If I build on my system today and I build on my co-worker system in a year from now, I can build byte for byte, exactly the same thing. Which I think is super, super impressive. And yes, we know, so CI and dev exactly the same system. So when I go and deploy something on CI, I go through CI and I'm doing something on development, and now I've got exactly the same versions every single time. No different. And finally, we've got no inversions for everything. So if someone comes to me and says, what version of curl is on your system? I can look, I can tell them without even going and building the software. I can just look at the code and see everything. Or I can instantiate and get a derivation, which is the build definition, right? I can go and say, here's the build definition. Does this tree contain curl 1.3 in it? Answer the question. Cool. Thank you. I actually didn't see you pin a version in any of the code slides that you showed me. So where exactly does the pinning happen? That's a really good question. Pinning. You know, I'm gonna actually just show you, I'm gonna jump to next packages and I'll show you a package. I have no idea what this package is, but in here it will say, the version is 1.9. And here's the chart 256 of the... Oh, I'm sorry. I'm very sorry. So supposedly there's a package called Galaxis. Supposedly this is a package and it has a version 1.9. So we're specifying the version. And here's the chart 256 of the source code. And this is like, this is pinned in the next packages at the moment. And I can refer to exactly which version of next packages I want. Or I could just copy and paste this file into my project or whatever I want. So pinning happens through this. This question, hello. This question is related to the same question which he asked. So the Docker file which we saw earlier, it didn't have the version, right? So are you referring to this version only? That it would take the version from this file? So there's a question around, are you talking about this file? Yeah. So yes, we haven't specified here exactly what version we're talking about, but we're referring to something called Alpine. These are variables, right? These are declarations that are made somewhere else. So somewhere else, there is a declaration of Alpine. And in that declaration of Alpine, it does say exactly which chart 256 of Alpine that we want. And there will also be CalCa. So I could find the CalCa in next packages and say this is exactly the version of CalCa that's specified. So yes, not here we haven't specified it, but in another file that this file refers to, we have fully specified it. Okay. I have a question, Brian. So for somebody who's learning next expressions, what type of editor support is available? Syntax highlighting or, you know? Yeah. Errors and. I use Emacs. I use Emacs which works well. But outside of Emacs is VS Code support. You're gonna have like learning, Nix is a very difficult process. And so Syntax is very minor part of it. The rest of it is very difficult. But yeah, VS Code, Nix. I think VS Code, Emacs and VM all have pretty good support. Any other questions? Is one. Other than the DSL, is there like any first class language support for, like is it extendable with some kind of a language? There is, yes. There is work on extending it with Haskell, which might not be the direction you wanna go in, but I'm very excited for that.