UVU: Chuck Allison – DConf 2015

why D is very very good for me what is a wonk well there are three different definitions a student who spends much time studying and has little or no social life a grind a stupid boring or unattractive person and number three a person who studies a subject or issue in an excessively assiduous and thorough manner manner like a policy wonk I’ll let you decide which one applies by the time we’re done but it’s interesting that wonk is no backwards so I’m going to tell you a little bit about something I know about what I would like to do is talk about how we got to where we’re at and so let’s take a look at where we’re at language wise i’m going to go to tob calm right now okay so here’s where we’re at the Mayo be index job is number one c is number two and the c++ is number three it’s pretty much it’s those three on the top all the time have you noticed i don’t know how many of you keep track of that and i think we can kind of guess why languages are where they’re where they are any surprises here i think number 13 is a big surprise don’t you I probably shouldn’t I better be professional I’m not going to say anything about Pearl I just did did not yeah that’s too bad what is this last thing on the bottom abap isn’t buddy know what that is okay it’s in the top 20 what is it oh okay all right well of course to CD we have to go down to number thirty and that’s where we’re at we used to be higher but they change their ranking algorithm years ago Walter told us about that that’s okay we’re still ahead of scala and lua and air lang and F sharp and groovy and a number of other things but if you look down here you can see what languages have prevailed over the years c holds a pretty top spot doesn’t it java has done fairly well since 2000 c++ has done quite well for a long time so as you can c c++ has indeed been with us for a long time all right how do we get there well one of the advantages of being older than Walter is and I’m quite a bit older than Walter he’s old enough to be my very young younger brother is I have some perspective and so I wanted to share with you my perspective on how we got here and especially with C++ I’m doing in the spirit of something that may not be familiar with you to you I don’t know if all of you are familiar with the show called Saturday Night Live I don’t watch it anymore but I watched it 30 years ago and they had Garrett Morris play a character named Chico escuela who is a baseball player imported from a central american country he didn’t speak English very well but boy could he play baseball and whenever they would interview him about all he could say was baseball been berry berry good to me and then he would they would ask him more question and he would say baseball been very very good to me and so to give credit where it’s due I just want to say C++ has been very very good to me I have been using it for a long time here’s my shameless slide these are my books and so i’ll just get past these right away but perhaps you’ve heard of thinking in c++ as a co-author with bruce echo on that it’s a little out of date now I’d love to update it but I’m really thinking of thinking in D instead and I’m taking a sabbatical next spring and I’m going to be working on a book and computation theory but then I’m also going to start working on thinking and D and Bruce eckel said yes I may use the term so I thought that was nice ok so credit where credit is due c++ was adopted organically over time now what do I mean by that there is no single company that owns and hypes it right c++ just kind of grew the same way she did and so people started using it because they wanted to

know hype at any time and in my experience C++ is what took object-oriented programming to the masses because C the C compilers are everywhere and C++ was in the beginning of front end to a C compiler and so a but people could use C++ what I would like you to do is I want you to go to this URL would you please go to padlet calm right now on your device because this is how you’re going to contribute to the discussion Chuck underscore Allison / CPP underscore good I’m going to leave that up just for a second I’d like those of you with devices or computers to go and log on here because you’re going to contribute so again that’s padlet calm / Chuck underscore Allison / CPP underscore good and now i’m going to go there okay tell me what you like about c++ I’ll start it’s fast would we get okay you don’t like C++ at all you’ve never used it I mean up here we go easy C interoperability I’ve never liked c++ thank you okay you might as well be honest although it says c++ good what do you like about c++ so okay I’m going to get rid of you but that’s all right active community true powerful comprehensive oh that’s for sure nothing okay again you’re on the wrong slide here okay native compiled code all right that’s about it huh see source compatibility a lot of people don’t like that about c++ that’s one of the things that made Walter Doody am i right Walter yes indeed because it was the see compatibility that made c++ the monster that it is but good point makes d he look good okay there we go okay like the library’s being taught to many new students metaprogramming undefined behavior stl is good hey was stl innovative or what I mean you got to admit I was there and when Alex steppin off brought it to the c++ standards committee first in the fall of 93 and then in the spring of 94 / did somebody go to another page I don’t know what that means okay busto very good very good improving language well they are improving it consistency with a wink and a smile okay good well thank you now you’re going to go back to padlet two more times just so just be aware of that okay so there are reasons to like C++ now I want to tell you how it house C++ progressed and how Java came to be so popular and then howdy came to be around so this presentation is just my two cents which of course it’s called your two cents because basically it’s worthless but you’re here listening anyway okay a little prehistory and this is just me I began like some people with Fortran 1975 so that was my first they wasn’t my first programming experience my first programming experience was on a Wang calculator in 1970 but that you know was basically a programmable calculator with 77 possible instructions that is you can only write a program up to 77 lines and you did it on a single punched card with a little stylus and you punched him out by hand of course I started professionally with Fortran punch cards I caught on to see in 1984 with a very nice compiler called the mark william c compiler Walter did you ever hear that mark william c yeah that was it that was an excellent compiler and then Along Came this thing called data light see boy was it fast and boy did it generate lean code does anybody know who the developer of data like see was it was Walter Walter created data light see he’s got this thing about compilers don’t ask me why okay well in 1998 and 89 is when I jumped on the C++ bandwagon I was an early adopter of zyrtec C++ which was the first full standalone native

compiler in C++ for ms-dos do you all know who wrote vortex C++ Walter indeed and I wrote five chapters of the original releases of turbo c++ and borland c++ back during that time yes if I were to go back and look at that I would be I would not recommend it to you those were early days but hey you know at least I was involved and then I had the opportunity of joining the c++ standards committee and this is where I really learned how things work when a language is done by consensus through worldwide entities instead of being sponsored by a single company it takes time the first technical meeting I was there martes 1991 and Nashua New Hampshire and I spent 10 active years on the c++ standards committee I got to know very many people very well including who’s the first picture of BR Nestor strep the inventor a designer and original implementer of C++ how many people know who that second the guy in the second picture is anybody no don’t say it out loud must be Walter hahaha yeah you’ve changed how you’ve changed over the years no well let me just tell you if BR Nast rooster up is Batman andrew koenig is Robin in the c++ world and there’s no doubt about it it was BR it was the BR nuh & Andy show for a long long time anyway it was a great experience and I actually designed and implemented this bit set part of the standard library actually I proposed to classes bit set and bit strings so we can have a bit vector that grows and shrinks and that kind of thing but what did they do they said well wait a minute we’ve got the they did accept it into the language but then stl came along and they said well why don’t we just make it a specialization of vector and so thus was born vector bull I do not take credit for vector bull because that wasn’t my idea and so finally we fixed that problem Jeremy seek took my code and boost ified it and now on boost you can give dynamic bit set and that’s what I had in mind in the beginning so don’t blame me for vector bull well actually they wouldn’t have done vector Boyle if I hadn’t done bit string but still don’t blame me okay and then in 1991 I had this opportunity to meet a very interesting fellow named Walter bright and he totally forgot that he gave this talk but I still have the paper copy so C++ world I took some pictures here for you he gave a talk defensive programming and see in C++ he was at symantec at the time they had blocked the zyrtec C++ compiler and here’s his second page you can’t read that and you got my notes on there here’s his topics what is defensive programming programming under the assumption that anything can happen variables contain invalid values co preggers co programmers are out to get you comments lie unspecified behavior is pathological and correct behavior must be demonstrated so I very very much enjoyed that talk opened my eyes to quite a few things so I was nice to meet him and from 1992 to 2003 I was involved with the C C++ users journal out of curiosity out of show of hands who used to read this journal one two three four five six seven eight is Andre here did you raise your hand I know you wrote for it okay well i had a column called crow capsules that my first book came out of and then I was a consulting editor for a while and then I was the senior editor in the last three years and yes Walter Bryant wrote for us on drew Andre Alexander SQ wrote for us interesting how these guys keep well dr. Dobbs bought the c++ users journal and and it kind of went away in 2003 and I was actually talking to Walter at a software development conference now I’ve got to ask how many remember SD software development just Andre on Walter nobody else just undrained Walter and me oh that’s too bad in a way and so we decided you know we’ve got to do something so that we can have a continuing C++ experience like we’ve had with the journal and so I’d like you to take a look at the names of the people on the advisory board we finally came up with the c++ source as

the name for it this is still online the last article that was written was 2008 by scott Meyers but if you look at the advisory board do you see any names you know call him out if you know him Jim Killeen Neal Harrison Neal Harrison is a professor here after 24 years at Bell Labs any other names you recognize you just can’t get rid of Walter bright you know for some reason but Andre Alexandra skew is also there because the names are in alphabetical order he comes in number two we are now I’ve heard of him yep heard of him Matthew Wilson from Australia herbs Sutter right Howard hen it’s the originator of our value references and move semantics which we don’t need in D which is pretty nice ok ok well what I would like to do to segue us into D is I’m going to click here and I’m going to go to the c++ source and I’m going to bring you one of the articles editorials that I wrote because i’m going to do a little quoting here i’m talking about c++ and I’m finding it a little complex now I really shouldn’t say that because I’ve been involved at this point in C++ for well from nineteen eighty nine to two thousand eight so that’s nineteen years right well scott Meyers was once asked what he disliked about C++ and here’s what he said I’d like to answer this question with complexity complexity complexity those are the three things but naming the same thing three times as cheating and still I think that C++ as greatest weakness is complexity for almost every rule in C++ there are exceptions and often there are exceptions to the exceptions for example Const objects can’t be modified unless you cast away their constant asst in which case they can unless they were originally defined to be constant which case the attempted modifications yield undefined behavior as another example names and base classes are visible in derived classes unless the base class is instantiated from a template in which case they’re not unless the derived class has employed a using declaration for them in which case they are well these things happen and please don’t get me wrong c++ has been very very good to me and so I am NOT well I know it looks like I’m I’m telling the truth okay that’s what I’m doing c++ did have see compatibility as the primary goal early on and I actually I actually asked pierna once I asked him what would you have done in designing a language if c compiler compatibility were not an issue and he says that’s not a fair question I don’t want to I don’t want to answer that and he didn’t because at the time see compatibility was important not only to the survival of C++ but it was also important because of the legacy code base as you know well I just want to give you a little example of something that is a little frustrating especially when we’re teaching programming so here’s a little class called box it’s a it’s a template class it’s very simple all it does is hold a value I’ve got a constructor here that will take a value of the product in platte parameter type and I’ll just hold it at this point so when we’re teaching students how to use templates very early in their freshman year we’ll do simple things like this to start and now let’s suppose we asked them to do a stream operator so we can print out what the value the box object is holding well you know what they’re going to do they’re going to say okay fine I’m going to do what I do with other classes i’m going to introduce an output operator as a friend in the class and as is my habit i will there have it i’m speaking for the students i will define the body of it outside of the class nothing wrong with that so you know that this is what you do with non template classes if you want to and you would think that this was this also works for template classes but there’s a minor problem here and we get an error warning friend declaration declares a non template function okay and that’s true because the friend declaration says I’m a function to find elsewhere the friend declaration just says I’m giving you access to what’s

inside the class the box class and yet i’m using a template parameter as the second argument the second parameter in the output operator well the problem is i can’t do that because this is not this is not a template and it actually gives you a little hint of what to do and this is actually from Ganu gives you a very nice output message you don’t typically get this nice message with other compilers it says you need to add bracket bracket after the function name oh no that’s interesting so here is the way you correct that what you have to do is you have to forward declare the box class so that it exists and then you can do a forward declaration of the output operator as a template function and then when you go inside notice that we have four left angle brackets in one right angle bracket in the friend declaration for the output operator and that’s because you need to use the two brackets there to show that this is a function template and now it works isn’t that great now i can define its body outside our freshman found that a little confusing now of course there’s a workaround all you have to do is do it java style and define the body right inside the class and everything just works but that function is not a template function for every instantiation of the class you get a different non template function very interesting ok well this is at the point where I brought up a quote from Dykstra I absolutely failed to see how we can keep our growing programs firmly within our intellectual grip when by its sheer baroque pneus the programming language our basic tool mind you already escapes our intellectual control so down here in reference six I say no it’s not reference six its reference seven I see some promise in walter brights d programming language it’s not a C++ replacement but it makes the C++ developer feel at home while providing support for systems programming exported templates on and on and on all right well that’s what happened in 2008 and actually that was 2005 when that article was all right so where are we now now I want to at the end here before I get into some code talk about software development i mentioned this conference having been there i watched as java emerged c++ was the language to know and the language to learn I had a lot invested in it then I noticed a Java came along and as I observed people speaking about java at the software development conference it was always as an a replacement for c++ in other words C++ is too hard to use let’s use Java it has garbage collection you don’t have to worry about about memory management of course we’ve already heard about that and we shouldn’t manage memory anyway right of course the portability of the vm was very important and also the fact that the internet was just or the web was just becoming important but the biggest thing that drove people crazy was they had trouble with pointers now I’ll have to admit our freshmen have trouble with pointers to now I have four students here hello Russell did you guys ever have there on the front row did you ever have problems with pointers okay Andrew says yes Travis says yeah Eric doesn’t want to admit it and Russell says in a little bit did any of you ever have problems with pointers only a few of you okay all right what everybody else is lying that’s right yeah okay i should say well to me this is one reason why java succeeded although it was a confluence of other events as well it was a perfect perfect timing so in 2004 at the software development conference now look at the speakers again this time I’ve put bullets by the ones that we’re talking about here Walter bride gave his first presentation on D now Walter do you remember the medium that you used at that presentation I was there everyone complained about it may I share with them what the medium was an overhead projector with blank transparencies which he wrote on with a pen but he since went back

compiled a PDF for that and this is what that is now what I’d like to do is I’d like to go down to near the end here and I have a couple of things highlighted that I want to just share with you as Walter was making his case for the D language they’re highlighted in yellow so here we go there’s no need for multiple warning levels in D addy puzzle book a lint program well that’s changed a bug of the month or a world’s leading expert on preprocessor token concatenation there’s no need to convert C code to D new functionality can be written in D and linked into the existing see object core d locks down many undefined or implementation defined behaviors of C and C++ thereby making code more predictable and portable any lists what some of those are of course we take a lot of those for granted now and then finally d starts with ensuring that no variables or object members get left uninitialized next and most important are designed by contract and unit testing the answer isn’t to force programmers to write test and verification code it’s to make it easy to do it and manage it easy enough to tip the balance and make adding such as much a matter of course as adding comments with the difference that the test and verify code actually run d compilers can potentially generate better code than equivalent C C++ code because okay well we’ll we’ll end right there so I just wanted to share with you at this point that over the years we’ve had C++ adopted organically everybody loved it no one was forced to use it they use it because it worked for them but Java also worked for many people too but for those of us who for whom Java was not the solution we still held down to C++ but this idea of see compatibility and growing complexity left us wanting and so that is where D comes in so now I’d like you to go back to pad that if you would because what I’m going to do is spend the rest of my time talking about why D is Betty Betty good for me I want you to take a moment and tell me why tea is very good for you so padlet calm Chuck underscore Allison d underscore good let’s go there wow we’re already there that’s great let me make this bigger not PHP okay mmm that’s something uh okay I know who said this it feels like taking a bath yes it’s clean best modeling power in town understandable templates oh isn’t the syntax for templates delightful indeed yeah fast compiler which one no I didn’t mean a big Python that compiles CTF e slices universal calling syntax unit test range oh yes easy to add inline assembler ranges and algorithms easy powerful boyss is going fast what’s that well I feel sorry for those that can’t see all these things that are coming up here yo dawg i herd you liek code so i wrote code that writes code so you can get okay got rid of that one huh yeah it kind of reminds me of the famous functional programming mantra why write a function when you can write a function that generates a function yeah sure okay scriptable yes very good unit tests next to your code already i think we’re converging here to consensus okay well you all right you pretty much covered almost everything I’ve got so good that’ll make the rest of this a little easier okay well allow me to tell you ID is very very good for me I like all of you developers love the following it’s not java it compiles to native code it’s not C sharp it has garbage collection but I don’t have to use it the module system to me it feels just like Python which was the best module system I’d ever known and it’s just so so easy to use slices associative array static if of course we’ve already mentioned Universal function called syntax compile time function evaluation what about mix ends and they have their issues but boy can you do great stuff with mix-ins then unit tests contract programming let me just show you some

examples here here’s an example of an associative array I just like clean things like this so what I have here on line 5 can you see that back there Walter okay sorry for using you as a guinea pig but is I’m just this is going to be a cross-reference program i’m going to give it the gettysburg address that’s what the what i’m reading in from standard input and it’s going to list alphabetically and at this point just for simplicity I did not separate uppercase and lowercase and it will tell you what line the word appears on all of the lines and how many times on that line it occurs so for example let me just scroll down a little bit you can see online 28 that the the word we capitalized occurs twice on line 5 and 0 occurs on many lines twice on line 5 as well I find us incredibly readable and concise program to get the job done I have an associative array here that associate associates a string with another associative array which associates an aunt with an end the line number with the occurrence count and so it’s easy just to read all the words in line by line split them and I can just add to my associative array on line 8 what line number it is in and of course i’m adding 1 because i want the line numbers to start at one and not 0 and it automatically creates it as you know and puts it in there and then it’s it’s really easy to it out so I like all of you really appreciate associative arrays how about you FCS it’s so nice that Universal function called syntax gives us the nice pipelining ability to say do this and take that result and pass it on to this and take that result and pass it under this so line 12 is how a functional programmer would have to do what I have on lines 5 through 9 which I find much more readable so we’ll take this set of values and we will change them all to multiplying them by 10 then we’ll divide them by 3 and then we will filter out those that are odd we’ll just keep those that are even and then we will pass the result to write line and so we get that good stuff other cool language features slices of course so I’ve got just short little examples here that I give to students here’s one that will test to see if a stream as a palindrome so all I have to do is check to see if the first and last characters are the same and if they are I will go into the next and the next the next and the next by using slices I all I do is get a different view I don’t get a copy and so it’s a very efficient use of memory and that does the job comment excuse me oh oh yes Unicode hat okay well I’m just trying to show slices here okay are a wise operations so I have a little function to create the to calculate the dot product of two arrays and so I will create a result which is the same length as each of those so I’m on lines eight and nine now and then i will use the bracket operators to do the component by component wise multiplication of elements in the two different vectors and then i’ll call reduce here to add them all up and that returns the dot product and then in the main you can see how those things are done so array wise operations very nice i also teach a class in matlab so this is a little bit of something that you can do indeed that’s similar to that lazy evaluation this is another privilege i have of being a senior person hopefully i won’t have any senior moments for the rest of the talk here but there’s this thing called jensen’s device has anyone ever heard of Jensen’s device okay well who cares okay fine it’s something that came with algal many years ago but basically it’s kind of a pass by name in a very interesting way so just to show you what it does look at line 17 see I have this vector this array with the numbers 1 2 & 3 now I have this function sum and I’m going to pass the actual index variable

because it needs to be used locally in some and so what’s happening is I’m passing I by reference and I’m passing the expression in the fourth parameter of my call to write line as a lazy expression that returns a real and this allows me to call my some function many different ways and yet I’m computing the sum of different computations so the first time I call it I’m just computing the sum of the elements the next time I’m computing the sum of the squares of the elements then the sum of the cubes then the sum of each element x index number etc etc so that’s a very interesting feature and I I get the answers that I would expect so there’s the sum of the elements the sum of the squares to some of the cubes interesting obviously not so interesting that you wanted to say something about it let’s talk about using delegates as decorators and line for their I have a function called incalls and all it does is it wraps a function in another function a delegate and will keep track of how many times that function is called and every time you call this a rapper it will it will return when you when you when you actually call it it will return how many times it has been called so let’s take a look at this you can see what I do is I gret I get the function as an alias parameter an alias template parameter and the type of what it is I’m assuming the function takes something of type T and then I’m going to calculate it but then at the same time I’m going to return what the count is and so the purpose of this is just to see how many times the function was called could have used traits right Oh exactly oh yes right matter of fact I have an example coming up later that does that right yeah ah there you go okay so could you scope exit right good anyway I like delegates because I can I can use them as rappers and of course that’s that’s what we do in functional programming here’s a concept that I appreciate from Python of course it’s not a new concept with them and that’s the idea of a bound method so you can you can connect as a delegate an object and a particular method to call on that object and use that entity and pass it into some other services a call back so I just have this simple function called service it wants something that it can call and it’s going to call it and return its value well how do I do that well I’ll just take an instance of some object that has a method on it and so in line 9 i’m creating a clase with the with fun and then in line 10 is where I’m binding the object to the method so this is called a bound method and now I have this thing which is a method that will be called on behalf of some object later when i use it and I pass it to service in line 11 so another very nice feature and then of course share it is nice it does actually work sometimes and you can actually understand it but here I’m also showing atomic op what i’m doing here is i’m just spawning a couple of threads that will print out either dessert topping or floor wax where does that come from oh who cares Saturday Night Live okay it’s a dessert topping and a floor wax okay anyway every time I print something out i want to be able to print out which element it was like as this number one number two number three and so I have to increment a counter so I have this shared thing locally or globally here at the module level and then I can use the atomic op in the function and it will not then it’ll be thread-safe alright so things we like in the language let’s talk about the library Python very nice language is called they say that Python comes with batteries included because of its wonderful library and it is a very wonderful library well I would like to mention that d comes with the nuclear reactor included because it’s library is still growing of course and perhaps there are quite as many components as Python because python has a at least it well I was going to say a ten year head start it’s about true I think nonetheless oh

the powerful things in the D standard library in Phobos I love scoped here just for fun i’m going to do the curiously returning recurring template pattern where i can have a template which i have in the form of counted here this template has a static counter and a function to get that count which will count how many objects of a particular type were instantiated so it has a default constructor that increments in a destructive the decrements the count and then i’m creating in line 13 a class so that will automatically use this functionality that it derives from my template so that this particular class will always be i can always find out how many objects there are at the moment and of course it’s curious because in line 13 i’m defining a class by inheriting from my template which instantiates the class perhaps you’ve all seen this idea before so to some people it looks a little circular anyway what I want to do is I want to be able to show how many elements there are at any time and so in the beginning when I print out get count on line 16 there aren’t any now i’m going to create one on line 18 when i print it out i’ve got one but at the end of the scope i want it to go away so i had to use scoped to make sure that the destructors would be called so i have my option to get deterministic to scrub destruction very easily in d partial function evaluation also known as currying being a functional programming guy I kind of like it unfortunately at the moment you can only supply one parameter at a time one argument at a time for those of us functional programmers we want to be able to suppose I have a function that takes four arguments well I might want to be able to pass two and then get back a delegate waiting for the last two and I can’t do that right now with partial I want to be able to do that but I can do them one at a time so in line 6 i’m going to say CF is a delegate that is holding on to the first parameter for F F takes three parameters which is going to be a one and now i’m going to call it and give it the the last two in line seven so of course when i plug in 1 2 3 to my simple function i get seven but what i can do now is I can take that CF variable which has the first variable one from line 6 and I can put that into its own separate entity I’ll call it CF 2 and now and I’m going to give it the second argument and then find the inline 10 i’ll give it the third documents so we functional programmers appreciate that we would appreciate it even more if partial would take an arbitrary number of arguments so that we can not be hamstrung by that discriminated unions with algebraic discriminated union is something that I’m used to using I love it it’s just a variant which is bounded which is set you just tell at what types it can have and so here my my type 12 can hold either an int or a couple of two int’s so now I can have an array of those things and i can add something that has one int or something that has a couple of two int’s and i can just use that and print it out and so how do i actually do computation on that i use visit in line 15 so visit will is a method of algebraic and it just takes the delegates detect to match just like receive does with message passing and so if the current element happens to be an int it’ll just return it if it happens to be at uppal it’ll return its product so that when my some function will sum all of these things up it actually will give the sum of all the elements except if they were tuples it will add the product into the running some so algebraic very nice feature memo wise well you know I’m a mathematician and I’m a professor so I am obliged to use Fibonacci numbers you have to do that and so I do it and so the first function their line 3 fib it just does it by the usual recursive method the second one uses memo eyes which as you know what it does is it’ll keep an association of all previous arguments that have been called so that instead of reevaluating it it’ll just look it up in its cache and return the value that it previously did and

then just for fun because you’re going to see some timing results here I also did a tail recursive version without memorized and then the traditional iterative version and I timed all of these things and so the in line 53 the the bare-bones version used how many is that 80 million clock ticks the memorized version cut that down to 26,000 forming of course if I made a tail recursive it’s even better and the recursive the iterative version is the best memorize is very handy when you need it fibers now I realize that fibers were created and are typically used in the context of threading but for me fibers are also generators a form of co routine which I use all the time in Python and so I don’t have to use threads to use fibers so here what I’m going to do is I’m going to create a fib an infinite fibonacci stream it’s going to just every time you call call it it’s going to yield the next Fibonacci number for you and I actually have added a function here so that you can stop it whenever you want to and have actually have the fiber destroyed or terminated so all I have to do is do what I would normally do with the Fibonacci computation but i will just yield it every time and so here’s a here i’m just going to print out all of the Fibonacci numbers that are less than 100 and so a printout 011 all the way through 89 and when I call stop on the fiber I can assert that my fiber has been terminated but of course you should be saying well now Chuck why are you using fibers for something this simple fibers really aren’t necessary to use for a simple case like this why don’t you use ranges instead and I couldn’t agree more and so here I’m going to create an infinite Fibonacci stream but i’m going to use ranges instead it’ll never be empty in this case because it’s infinite and I’ll just hold on to the current number and compute the next one for next time in pop front and so now I can do the same thing as I did before I can print out all other things that I want to do so I’ll just I’ll just call pop front and and i will call core of course call front to get what i need and then call pop front to advance now I want to just also show some the other things that we functional programmers like until so i can create this i can reuse this range and i’ll say give me everything until the current element is greater than 100 and this will do the same thing it will give me all of the are you saying no oh you’re not okay i thought you were seeking your head no at me so this will give me the same thing as my loop but i happen to know that there are 12 of them so another way is to just call take and then i can get all of the things that i wanted as well okay this will be our last padlet exercise please go to padlet calm / Chuck underscore Allison /d underscore tools and here I really would like your input because this is the one area where I think it’s been difficult for me to keep up what are the nice tools and resources that we have well obviously our DMD love that deal on org is wonderful the tutorials the documentation all of the information dub is a delight package manager and builder I just tried out vibe d last week and I must say that was a great way to do web apps now how many of heard of xamarin studio on okay good how many have heard of mono d okay it’s the same thing alright so xamarin just so xamarin is a very nice ide for d by the way I don’t have time to show it to you I was going to and then also we have of course the books we have andre’s book which I’m sure he’ll update sometime soon we have Ali’s online book and then we have Adams d cookbook which is delightful let’s go to padlet now and see where you’re telling us ok what are the nice tools we have now I don’t know what all of these are what’s dbm o version manager very nice very nice

okay visual d is nice the standard library emacs oh god it’s a wonderful tool I was kind of hoping you’d have more d specific ones live d parse GDC and LDC my brain and IRC now you go d fix which we’ve heard about today now I haven’t heard of d unit what’s that is is that just like in unit stuff it’s just a unit testing framework because that what it is okay good Walter and Andre I totally agree thank you okay well I think that’s a great place to end because we’ve heard a lot about Walter and Andre I just got rid of I just got rid of my presentation and I have one last slide so let me go there what did you say o our Andre tools or resources that’s a good question why would you rather be yes okay very good all right well so there you have it that’s just my two cents y yd has worked for me the timing was good the losing of the see compatibility constraints was good and of course just the design was good now i just wanted to mention that there’s more to come I have a student Eric who’s been sitting here the whole time he’s giving the last talk in the conference and I’d like to encourage you to be sure you’re here for his 330 talk tomorrow he’s going to be talking about his experiences where he decided to switch to D in the middle of the semester when he was learning d and one of my other classes to write his virtual machine with embedded assembler and then his compiler as well and so he’s going to show you all of his adventures and what a good experience that was thank you very much you