Perl 6

Video in TIB AV-Portal: Perl 6

Formal Metadata

Perl 6
A Dynamic Language for Mortals
Alternative Title
Perl - Perl 6 For Mortals
Title of Series
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Release Date
Production Year

Content Metadata

Subject Area
Dynamical system Process (computing) Software Oval Personal digital assistant Multiplication sign Order (biology) Wave packet Element (mathematics) Formal language
Complex (psychology) Length Multiplication sign Execution unit File format Junction (traffic) Computer programming Computer Neuroinformatik Formal language Mathematics Physical system Exception handling Social class Mapping File format Infinity Parameter (computer programming) Hecke operator Special unitary group Type theory Category of being Oval Point (geometry) Implementation Link (knot theory) Image resolution Division (mathematics) Device driver Online help Mass Discrete element method Graph coloring Number Revision control Profil (magazine) Term (mathematics) Software Integer Nichtlineares Gleichungssystem Implementation Metropolitan area network Basis <Mathematik> Limit (category theory) Evolute Cartesian coordinate system System call Compiler Spring (hydrology) Number theory Software Personal digital assistant Calculation Negative number Integer
Point (geometry) Functional (mathematics) Game controller Serial port Divisor INTEGRAL Multiplication sign Division (mathematics) Shift operator Rule of inference Coprocessor Graph coloring Computer programming Formal language Number Power (physics) Neuroinformatik Fraction (mathematics) Estimator Goodness of fit Mathematics Profil (magazine) Software testing Error message Exception handling Social class Shift operator Rational number File format Floating point Interactive television Electronic mailing list System call Numeral (linguistics) Process (computing) Oval Universe (mathematics) Endliche Modelltheorie Quicksort
Dynamical system Fibonacci number Run time (program lifecycle phase) Java applet Interior (topology) Code Multiplication sign Sheaf (mathematics) 1 (number) Boom (sailing) Parameter (computer programming) Mereology Neuroinformatik Formal language Subset Different (Kate Ryan album) Negative number Arrow of time Endliche Modelltheorie Recursion Descriptive statistics Social class Constraint (mathematics) Fibonacci number Mapping Software developer Moment (mathematics) Sampling (statistics) Parameter (computer programming) Variable (mathematics) Sequence Element (mathematics) Electronic signature Type theory Category of being Wave Oval Order (biology) Typprüfung Right angle Quicksort Asynchronous Transfer Mode Functional (mathematics) Regulärer Ausdruck <Textverarbeitung> Constraint (mathematics) Typinferenz Spiral Least squares Infinity Number Term (mathematics) Integer Loop (music) Data type Boolean algebra Default (computer science) Multiplication Expression System call Subset Subject indexing Word Loop (music) Personal digital assistant Function (mathematics)
Dynamical system Fibonacci number Code State of matter Multiplication sign Workstation <Musikinstrument> 1 (number) Parameter (computer programming) Mathematical structure Computer programming Information technology consulting Formal language Subset Fluid statics Casting (performing arts) Mathematics Type theory Core dump Recursion Logic gate Multiplication Social class Area Constraint (mathematics) Fibonacci number Sound effect Bit Determinism Variable (mathematics) Type theory Process (computing) Oval Chain MiniDisc Curve fitting Writing Point (geometry) Slide rule Functional (mathematics) Revision control Cache (computing) String (computer science) Software testing Data structure Multiplication Focus (optics) Graph (mathematics) Database Line (geometry) Cartesian coordinate system Limit (category theory) System call Subset Cache (computing) Uniform resource locator Personal digital assistant Function (mathematics) Object (grammar)
Axiom of choice Java applet Range (statistics) Client (computing) Open set Information privacy Computer programming Neuroinformatik Inference Medical imaging Estimator Type theory Error message Social class Constraint (mathematics) Proper map Fibonacci number Keyboard shortcut Electronic mailing list Infinity Sound effect Hecke operator Median Bit Instance (computer science) Sequence Category of being Message passing Arithmetic mean Process (computing) Oval Order (biology) Quicksort Reading (process) Directed graph Point (geometry) Slide rule Computer file Control flow Online help Mass Infinity Regular graph Polarization (waves) Rule of inference Declarative programming Product (business) Lie group Form (programming) Default (computer science) Physical law Code Core dump Basis <Mathematik> Line (geometry) Multilateration Limit (category theory) Cartesian coordinate system Vector potential Word Algebraic closure Network topology Boom (sailing) Video game Iteration Code Multiplication sign Boom (sailing) Set (mathematics) Mereology Prime number Computer font Bookmark (World Wide Web) Formal language Subset Programmer (hardware) Mathematics CAN bus Typprüfung Area Logical constant Real number Point (geometry) Moment (mathematics) Variable (mathematics) Regulärer Ausdruck <Textverarbeitung> Open set Type theory Data mining Website Right angle Sinc function Game controller Functional (mathematics) Typinferenz Limit (category theory) Electronic mailing list Attribute grammar Power (physics) Revision control Prime ideal Natural number String (computer science) Operator (mathematics) Condition number Mobile Web Validity (statistics) Poisson-Klammer Java applet Planning Formal grammar Einbettung <Mathematik> Object (grammar)
Run time (program lifecycle phase) Open source Code Multiplication sign Range (statistics) Parameter (computer programming) Mereology Rule of inference Declarative programming Number Formal language 2 (number) Sequence Profil (magazine) Term (mathematics) Different (Kate Ryan album) Googol Operator (mathematics) Alphabet (computer science) Arrow of time Error message Stability theory Social class Exception handling Electric generator Constraint (mathematics) Fibonacci number Inheritance (object-oriented programming) Block (periodic table) File format Point (geometry) Moment (mathematics) Sound effect Hecke operator Line (geometry) Variable (mathematics) Sequence Demoscene Electronic signature Process (computing) Loop (music) Personal digital assistant Summierbarkeit Right angle Quicksort Figurate number Abstraction Geometry
the above works the 1st saying all apologize to you if you folks attacks before you know that generally I leave a lot of time at the end of talks for questions I don't have the time this time these order questions so the and I probably 1 actually only get to them but you can buy me in the hallway or the claim other folks know process news well of from like people who don't know me Callisto Domingos all the time and at all around the world . fr were based in France that's my company we do have a spokes software element news with Perl Wilson training and Pearl databases get and today stock is a dynamic language for mere mortals Perl 6 I with the UN winnings assistance of 1 manual surround many all you there it is actually a Python is so he looks down on all of us I just want to know that but thank you very much for your comments and help the so the if you wanted to learn how to
drive a car you might be innocent comedy no knowledge about them couple friends when were race car drivers and you can ask them about this and they could tell you what that spring does what that meant those with that thing does maintain all this stuff that Indians about fuel oil ratio than the gear ratio that outbreaks where I over that's a lot of all these things that by the time you're done you might be intimidated as heck by this is a donor in the car this is scary but the reality is most of us know we just get in a car and drive it's simple we don't have to look under the hood and I've heard 3 primary complaints about Perl 6 enabling the length of time and what about that be the version number can do much about that see the complexity that's interesting this lot very complex link is opposite to provide the plus that center the reality is most of what we do on a day-to-day basis it's pretty easy in Perl 6 and you'll understand some that entire were done but
1st basic math this is almost like a lightning talk before the actual talk something very frustrated because basic man can anyone solve for x locomotive uh you have so why do be the a different mapping appears primitive was value of X in this equation 1 what would the teacher had been at your on the the I would so since you cultural slow and the axis 3 . 5 we know that we know that that really doesn't think so the I can't to doesn't think so tickle doesn't think so the same it is a wonderful tools arbitrary calculator built into many systems and it says 3 so those one-to-one one-liners I wrote to demonstrate this issue in fact I run a 1 liner and see and I so there wrestling worrying about this but no sees type system oxydans warning the compiler gives us a warning because while % F in the format that a double than expected in into what's up with that we switch that OK finally get the 3 year the purpose of software is to help humans it is not to help computers I've actually argued people it'll all 3 is the correct answer because integer operand integer gives an integer no it is not as we know it does not so always keep in mind the thinking about stop some forgetting about what appear does not stop for thinking about the limitations that peer thing that will I need as a human over solve my problems and sometimes implementations are going to bite units frustrating licensee example that later but suffers there to help humans Britain and Israel so we'll profile actually have to write the answer in this case so you know 7 divided by 2 and it is rather gives you straight what is negative 7 divided by to give you if you know the answer don't call it out if you don't know the answer use your intuition what should it gives you the why minus 4 it so owner of the minus 3 further laughter but you know things minus 4 the your hands the on so you say the latest history so all you and minus 4 were wrong 1 none languages all say what Pearl we don't get it right profile and they say minus 4 minus 4 minus 4 minus 3 the the so a room a very smart intelligent people with a not difficult math problem were not able to reason what sort of so they would get so I This is a junction near the evolution of some some other so C said negative 3 except it's not that simple because of using CT 9 the wrong answer that you get is implementation-dependent of so you have a perfectly correct in program in c 89 ship about to someone else it will fail for them just because they have been using different compiler frustrating but what's going on 1st of all this is a difficult for anyone best the OK . 1 + . tail is point 3 minus point three is 0 at x equals 0 0 equals point 1 plus point to my . 3 forget about computers what your teachers in math class have said this is correct yeah was broke thing about this and that's a very small number and but it's that it's it's not a small number in 1 sense because the thing about in terms of MAP is infinite in number theory this infinite many numbers between 0 and 0 the In fact interest color of knowledge as many numbers between 0 and 0 is the arbiter between 18 quadrillion in 0 0 we know has special properties so 1 divided by 0 is 18 quadrillion that is an exceptional number that is not an exception or let's multiply mass of the sun my 0 that's 110 kilogrammes 110 trillion kilograms is legal Fermi would tell us roughly the size of Mount Everest yes
is all is suspected that Everest is nothing more than a floating-point error and other
languages tend not to do any better you know Ruby Python to but to call the 6 BCS Lee us right but considering the can figure out 7 divided by 3 4 of referring temporal 6 0 0 the if you're wondering what's going on the psych who is pull a rabbit out of a hat and so floating point numbers basically the way this is typically done in computers as they estimate the number that comes after the decimal point you have reciprocal powers of 2 which 1 if any added up the 1 0 0 1 etc. to estimate what that number should be to approximate what that number should be and as many things you can get exact i which is why . 1 plus . to minus point 3 10 quite add up to 0 and floating point math 406 6 gets right how does it news I talked about the engine working under the hood muscle time the stock I will look under the hood but this time Justice in peak of what's going on so here we got divide by 0 which is you know we get exception exactly what we want if you just take process the command prompt return Iraq indecipherable Perl 6 everything's not exceeding call methods on them there is the what method which says interact it's actually that is it's a rational number is a roll-call rational ways of like a color so it has a numerator 3 a denominator 10 a new node is a method of rational numbers which returns a list of the numerator denominator processor basically serialization says you know it's kind like data number sort of but it prints it out in a format that hopefully can be serializable what's interesting is that the bottom that's 3 will for use 7 is sort of pi but possesses survive because it applies in rational number but now letting the vagaries of floating-point mathematics choose how inexact that is you can see is how an exactly this so boring forget about that because most the time it is the Americans can work for you organizing cleanly the airs you see on StackOverflow why didn't this work y can make a perilous floating point of like and they divide these and you get the right answer all the little things like that not not all the time but Perl 6 tries really really hard to be a language for humans not for computers but setting a time of functions yes reciprocal too stupid functions of someone that really carried away with the idea of don't repeat yourself the this but the raising and horrible functions as 1 most common classes of errors We have be accordingly this today is that different pieces of the program have to talk to each other which means generally after past data back and forth and you can use test everything to death but if you know integration testing your test how things talk to 1 another year find offered by the but you can't test exactly how really talks to each other all the time because you have the path of the federal the totaling SVM good control over what you're actually getting in there so if you're not a profile you might wonder what the shift is and then you might really wonder what this dollar the score of 0 hours universe non-equal shift or you know why we have his parentheses that that's the so you can write you know something analogous to all those new rules we don't do that that's really embarrassing but for time of functions not everyone likes to Fibonacci
sequence as an example I call this the map to the real world you know really really does but I won't go into that of we often use the magic functions when we're talking uh teaching people recursion teaching people how basic functions work a they're very very easy to map to the mathematical description of what Fibonacci function the so it's very easy show that way it's easy show the elegance of occurs in with them I it's also very very easy to understand and it's very easy to describe them and what problems do you have with recursive functions you might forget the base cases very common problem that to human problem you might not melody your arguments well that's a very common problem that a human problem year might well the stack deep recursion that's a very common computer problem to have all sorts of failure modes which is incredibly simple thing can examine a simple function which is why I like user Fibonacci series this sample
so 0 1 you start with that and cilia 1 the 1 plus 1 is to add that the pen that 1 was 2 3 etc. This is the Fibonacci series which has a fascinating mathematical properties will go into right now 1 written by over galaxy is based upon the multi the spiral model so all it's neat stuff about that and to right at the base of punks and signature at the end of the lecture number I in this case for indexing from 0 so this section 9 so given and the 1 0 0 1 1 1 this is like Pearl blasting evaluated fresh whatever um last why the stigma expression value returns it whatever lasting evaluate returns the number of returns its value as we will see it back and here feared and minus 1 plus and minus 2 this almost exactly the mathematical definition of that number really simple really easy an aside from that simple signature right there that's how we write that can provide in fact that if you use of modern Perl alike 520 use the experimental signatures signatures bearable for most of us were born i is experimental signatures use that no the given when Sigmund there it would be almost exactly the same might actually be exactly the idea that the princess associated 8 works but now we have an infinite loop we remember the base cases of 1 0 and when 1 but 3 . 7 that's not gonna work because n minus 1 and minus 2 will never hear our base cases that's kind of important again infinite loop it means we have to have an integer for and how we do some profile the so this so it actually has about this actually is about this actually has about every single 1 of those binding of wave ways right that most of those ways are gonna have bodies and it's such a pain to do that many developers just they do what we do in dynamic languages we say we're going to hope we got the right data and most the time of work so when it doesn't work we have to figure out where that wrong it came from and we hope that it fails rather than just silently corrupting our data into paying so all those are actually body in different ways then there slapping into on the but it is an integer and now this becomes a runtime failure not cruel explain moment so adding the end is what we call gradual typing and Perl 6 there are are strictly optional you don't even know if you do when you put on there and it's nice that will be a one-time failure in Perl 6 except in this particular case so when 0 0 how does know what when zero-mean internally as I say what happens is it calls the dot what method on 0 so there's an intr which must have the value 0 so you can actually apply a subclass of and and I mentioned should still work and then for 1 it does the same thing called out what figured out an inte in which must have a value of 1 so it knows to call this 1 here here which text this because this is hardcoded it's got a call about 1 on 3 . 7 it's going significant parts we mentioned and this is actually compile-time feeling that code is not possible to run this code it'll make any sense you can't do it to process signal the this is what we call type inference for magical thing to magical thing but it's simple but it's still not there because now in call negative 3 so let us raise them in and because the minus 1 minus 2 and a base cases so we get a subset of constraint tactic failed for parameter and then natively so what is this where start bastards using example of the whenever class now like to read that generally as whatever I it and where whatever I got really it was there you can't pass it on a negative value because you'll get constraint type but you know this is a should kind a clunky here and elsewhere where I got a greater than equal 0 what have multiple parameters being passed the stub that's very frustrating they put out a subset subset nonnegative it of in where where I got rid of 0 really equal 0 and then we just close nonnegative and In other words basically declared own type on the fly with an easier to read syntax and use the reunion does this look like rocket science to anyone this this look to anyone in this room like a so my meaningly complicated that is just not apply but the I the the is that I'm I ramping up but honestly processes in new language a sister language to provide the way the shogunate sister language to Java I mean that in terms of also quality that's really not hard you do have to learn how to read a new language but that's simple and then we get a constraint so signatures of for popular dynamic languages although scholars dynamic things that this you know mainly retirement Ruby by the end of the forever you get maybe depending on language 1 through 4 optional entirely optional basic ones using the variable default if you passing through all had vol. 3 named variables super colored in front of that and then you call it by name no name arrow value order to know the syntax that which all to right now so gradual typing we sub a billionaire there's gonna be a boolean value type enrolled boom you pass in a room and then sub-constraint strange name where where we got cars greater than 0 so the last 2 generally are available on the popular dynamic languages but they're really easy and process and optional the Lasso I really like the last 1 that this particular
constraint subset nonempty string of string where what area have been 0 I hate hate hate all the time expecting to get a string then I have to check to see if the string here I was writing my own type of but my own type on the fly saying this but I mean empty string and I just declared the I don't have to write a class I would have to jump through the hoops I don't have to remember to check anymore so I actually have data in this string and this is a common problem across many programming languages not just just you know the dynamic and I know Dynamic Static rather loose but there with an so I also think the I like this I think will be the most popular subset declared in Perl 6 some variant of this makes her getting nonempty strings but I like this 1 subset 1st name of string were 0 less than what we got cars less 256 sub 1st name what that I suspect we got popular in orange were you need to match your types directly to the constraints the database will allow so if you have my SQL and you're not in strict motor better and it has this nasty habit of truncating your data there were approach will protect you the the I love my SQL puny consulting on that is a license to print money I swear to but it's school you start hitting Fibonacci numbers in the twenties and on not optically like 25 but this really slows down to the point where becomes unusable because were blowing the stack with deep recursion I'm not gonna walk through the recursion graph I I assume Austria familiar with if not I apologize but basically we keep recalculating the same values over over 1 of the ways to deal with that is we catch values so if a state variable will return values in between some call so we just have this cast state variable unless cast and exists this column exists is an adverb profit again the language uplands tax must cast and exists when 0 0 1 1 1 cached and is blocked and overturned cast value the that's not Suharto here but if you start having a larger recursive functions that gets to be a limit annoying having built through the instrument everything they handle caching of but every recursive function be rewritten as an iterative function if you if you want to get the caching but now we started loser mathematical beauty of what we have in them and that's now you can just let them say all that work you know have fewer desk check or Edmonton tests to say it is actually doing what I wanted to do because of the structure anymore because remember now is a mathematical structure that you had and this is the body of the recursive sub was never really well together varies in of all of you wanna keep that so the sloppiness castrate on there it will handle the caching for you you don't want to pure function 0 given this value is guaranteed to return the same value every time doesn't have side effects are you probably won't wanna do that without a get customer method because the get customer might the customer might mutate in the meantime or anything which changes have 1 disk IO but this here for per just left is cast on the it's an example Perl 6 taking a very common problem that we face all the time and is building and language to say here's a feature for you that you can use can't find it cut yourself with I and it yeah so fertilizer is everyone with me so far that yeah but this was not a hard sell most the basic under showing you have no sense of so if a lot folks know the writing of a tax base and the more PG and Perl and characters can travel to other areas of space station they could some of the space station think of other stars we a wormhole dump gates and this is my character fell to method we're start moving into a little bit 0 0 from a hominid time more than 15 the yeah they're all crime doing better than I thought great so this is actually my dispatching for notification is a stationary a travel stationary if location is a station well this is kind of a simplified version but that comment my king of and that is verbatim from my code this is as I add more location types that you can go to you know having a bigger if else if chain very frustrating so I could do this I guess laughter role or are locations if enough of Apollo there I slept wall locations ification those location a location travel to character this is unfortunate because now I'm using object verb subject syntaxes of subject verb object which makes this harder to actually understand so I might say location traveled to character when you have to can torture yourself on method names it has a code smell and this case a code smells I don't think location should know that characters uncoupling them too tightly location should know don't have knowing about characters traveling in an undetermined character knowledge to fire the characters do not Half of application they're traveling to to so what the characters have a knowledge and reduce the coupling and Perl 6 I would just in this ultimate the travel to stationary stations star very simple many programming that have that here were dispatching on Perl 6 will say what types of arguments we have so that it will dispatch for your accordingly makes code much simpler and you don't have to worry about missing the case of you know you can travel location because we invited high process will blow up for by way here's the not and the correctness of multi subs we 0 that 1 focus of this I should add is castrate nearby ones that on the slide so more than 1 way to do it obviously return types that's
another 1 very useful so some further returns bold what are some other sub return in looking at this code you cannot tell it is not possible to tell just 1 line of code but where you know looking at this return type is this is it this returned anything other than a ball this is gonna blow up so here's a s a flu yes yeses desired behavior if we tried to
return a string type failed for return values but that's pretty easy working during functions all the time what most common classes of errors passing data around much easier to constrain the values in at the right thing so for that some other sub you know if you went and you Inspector that a yes some of the sub does indeed returnable as I was guaranteed and some other overcomes along later size in this condition and in return a string median error message your code mobile as expected to protect you from having bad data and of course you can use a subset T defined earlier some food returns nonnegative integers you have very complicated pipes you declaring on the fly adjust to certain all over the place to make sure that you're not getting that data passed around you have to keep writing that validation code all over the place or as I usually see most my clients they just the right knowledge encoded in the hope of words back now where I talked about methods a little bit no related classes and some classes are where it's really restrained fruit times because some syntax rules that are again the language of but it's really impressive what you can do with them and the choice point class regular controversial for those of moral programming this is not going to show you Oh programming is designed to show you some features of Perl 6 so just keep that in mind last point has dollar point x this 0 point is kind of that's a secondary character of the punctuation mark is called the twiddle the prospects and the point just can't help to remember because recall methods with points it that's an atom you like class so point x 0 Our has dollar point y equals 0 the equals 0 is a default value if you know pass that and then constructed and the polar point X this is what the instant value this is the instance variable you're going have here string overloading methods string and return in brackets below point x star . y my point . new x y say point x 5 c . 1 3 as a point in there in quotes for the string overloading i . 3 OK so that you know dollar point that extra punctuation work might look look estrangement very early doesn't look too difficult I would think this is an immutable . object you can declare it you cannot change maybe changes here's the point where to start with a little funky the so remember the colon in some other variable means that this is a named variable so you know like 3 but will be using Somerset method down here and equals the dollar point y means we'll pass it in the the fall value the down here we did not pass so it's been retained or point x so we'll pass in x to the set method which can retain whatever value was so we use that to set either x or y what the heck is that dollar point but now are being x being line wrote 6 likes to make a lot of things immutable there's a lot of benefits to this other 1 stated this concordant right now but basically if you want to change these by default these are read-only attribute so you can expose them people very then you cannot change them to change them using internal form which has the pain like Danger Will Robinson danger you're changing the internals of this but now you can do this so basically the set method will let you set X and or Y and it's point down here we see 517 this actually work appropriately so the syntax taken that to get used to it it's really not hard once you understand what's actually going on but you can initially set Y Tu Fu so we only know about gradual typing in Perl 6 so Jessica why is a real if you want to now he tries at life through boom law no short relegation it works as you expect it to work but I'm not kind those regret getting ready that set method because the reality is the Cartesian plane axle y-values community of infinite values depending upon what the computer connects the support the and now since we know it can be any real value whatsoever while people said that the real values that is a point that y equals 17 . 3 it works but we note expose the attributes were downloaded type-safety there were so some languages don't they recommend you don't expose you values but remember you are subsets to get much much finer grained control over what you allow so it's easier to expose them if you want to again is a perfect example a showing some the power of what we have here so I might say that's so I can only be from negative tend to turn so subset point of real where negative 10 listening to whatever got classical 10 has quite limited and now I said that a negative 70 point with a deficit of 17 . 3 again blows up as we expect Tom Bradley building all this stuff up so will get to the conclusion just a moment they would have any questions at this point I think that the time for of on a site that means it's really right now my apology the problem glossed over there too fast at tributes in Perl 6 by default a read only for safety and there also ugliness some form of privacy that here where deliberately saying it's really right so you can go ahead and try and set the value even though we set the value of little value and then we got the defaults of equal 0 that was the fall so it makes sense why should appoint objects starts at the origin so we can now simply say equals died dollar that x is required all about right wise required this actually closure is not evaluated at the time this equals so this will only be evaluated if you didn't pass a value for x and y so know we made is required you cannot instantiate an invalid object and we can't send it to an invalid value but you're going native 10 out that 10 that that's a range operator Perl 6 a smart enough to realize such that point will the real where negative tend to 10 means the same thing as that version so that's another way a constraint or you if I 1 it kind of silly here I could drop the of real estate negative 10 . 0 to 10 . 0 I didn't say subset going limit of what Pearl let's have a point 0 it's a bargain constancy uses those to figure out what time we have like inference yes the yes that's I worry tested it does effectively behave the way we want to and that was something I was hoping to not going to discuss the differences between appeal in rat here so the reality by probably would not do this I'm just trying to show people some of what's available on this and I would probably be a little more was and use the of real until I start feeling more comfortable what's going on out of all trying get your question after estimate how how my doing for time actually but it was question on
no sometimes they're forced to compile time but this is it's Pearl too late mining language but there are times when pearl can detect where something cannot work if you have a hard-coded constant you know 3 . 7 and you try and pass it to a function which only accept in it will notice at compile-time and correct me if I'm wrong but my understanding of the possible plans of doing more with type inference in the future but the concerns are making it so we have human-readable error messages correct on this problem and you have I the yes so so yes are being cautious about it and because it is problematic but the power of the potential is there that so so I had to show the native 10 10 the so here I notice that here and getting the string method like this string overloading so I'm saying this because they say . Pearl and ii the serialised version . new x 5 lies and went to no it's not just for a moment and think about what we have here ignoring the class declaration I have 3 lines of code they're actually pretty easy lines of code to read I declared basically a new type with constraints on the fly I declare the tree attributes for the class I made the mutable and made the required they have to have the default values does this work really hard to read I been given the fact that it's a brand new language that is not brought up by this look hard to read 3 lines of code here is an corporal 5 that's effectively the same thing In corporal 5 those 3 lines of code but we know we don't use corporal 5 objects anymore so there is this so Moses still little more people out there C + + there's Java His Python 3 what and it had no that that that would really was out on that 1 that so by country and generally the type so there's a class of their to stimulate that others JavaScript's really my favorite was go had a sink the font size in order to get this effect on the down slide because go and it may be 1 of language but falling in this this form of look at that the this that is very powerful very expressive and it's simple it's really not that hard it's in a language is like if you don't know how to speak french you're going have trouble speaking french I speak french but not fluently so K is less struggle when I read it but I'm getting better that's what happened with the new program with but nothing showing is hard and what a heart most painful classes of problems of having data on the great so it's simpler process so national example yeah so free data because it is more correct it's safer you can actually enforce constraints easily but how your passing data to and from functions all the time how this part reason instantly while a static languages use your loosely but there's a lot of tacit they optimal right because they know they don't have to test what happens if that function worker receives a string of sediment and because it's not allowed to so there's lot declares that he to make in there fewer have correct so process it really is lot there's there's no question about that a lot of people know about that but is largely profile so the plus + so so so many others but as the common features that we often need on a day-to-day basis including people down the baked in the language they're there for you as proper 0 0 I wish I could embedding of a lot more but we only have so much time of it actually is easier to read most of those examples once you understand what's going on they're not hard at all as image it's safer very powerful but also to resources you know here just a few of them so I was amazed were hitting on freenode tying a profit of how helpful they in saying this is what's actually going on these are the things you can do it was just a wonderful experience I thought I was going to bind them too much like no no looked thought I do have all the slides I did with the real fast or I did a couple questions Bundesländer questions 1 of the and every time I ask that question people always slides you fools I so this this apartment since scare people this is an efficient lazy list of word again all prime numbers from 1 to whatever basically infinity there assigned this constant primes we nuclear constant is going to be amenable to sail primes up to 10 we get all prime number the 1st 10 prime numbers and process Treasury Hartmarx makes royalists related of all sorts of benefits that make surrealist lazy when appropriate but if we don't have in in the can in some of the dot they call them on the topic dollar underscore sold that's what's happening with this and the 1st 10 grams are calculated the rest will not be calculated unless needed so if you're iterating over the infinite Mr. primes until you're looking for a prime it fits a property you can declare like this and then a little break out we need it so lazy was severing anybody you know concept you have that very that civil inference can hardly no and drop that if you want to I this compound grammar of Muslim so is a problem but this actually happened me when I was a junior programmers kind of embarrassing so you know writing a simple filter the and that we just Warpaint lateral file matching stuff so the junior programmer like me that idiot rights will be fine file 1 zip through their works great and then hits that 45 gigabyte file in production and it bombs can anyone tell me why preach what what is the definitely and yes this slips 1st of all it in so in Perl 6 my final equals open file there's other ways you can write this being Pearl but this is lazy you can go ahead and read that huge file because automatically lazy so many times a distinction between while and for kind of goes away so Perl 5 for reason this which automatically flatten while areas here just mass lazy it's a line of flying SmartNet whatever a regular expression or you know we can write it will more compact we just filter directly by more about rest line and say the line so lazy lists there's a wonderful thing the Fibonacci numbers you start earlier that this property people so now we have 3 dots and set it to that the sequence
generators thing 6 sequence operator is that all range operator to sequence operator and knows how to generate a sequence of numbers will explain what the heck this means in just a moment I thing for matches up them again lately calculate the matching sequence you know how to hack is that whatever we got plus where we got that that that would be needed so sequence operator is aerobatic sequence if we have 2 numbers there that is because it's an Air Mac sequence and it will be on the figure lazy we calculate that say the 1st 10 numbers in the serum alphabetic sequence 0 2 4 6 like a joint no so that's pretty simple so this is kind of makes sense 0 2 really generate a sequence of to whatever we happen in need rule and strange or works this lazy so it will calculate that up to infinity but if you have different numbers of fraud is a geometric sequence from process will figure out what you need the so 2 4 8 that that that 2 up to where we need we say a sequence up to the 1st 10 numbers 2 4 8 blow up to 1024 anyone recognize that geometrically yeah comes in handy sometimes the that was awful but sometimes sequences we need more that you are a little more complicated than this so the we can do something like this we have this arrow what is this arrow we have AB a plus B sequence generator so this is actually this a pointy block this starts the of the here the parameters the sums gonna take a plus B so it knows of the 1st 1st 2 things had before in list on be added together to generate the next item and then you'd have the 1 1 and together generate next item which is the to the other 1 the 2 added together generate next item this is you generate a complex sequence if it has you know this regular format you might notice is pointy block is that what we saw after of 4 declaration that's exact same syntax and what you have in the for Perl reuse that syntax a lot so get used to say saw on the for a rainy error 0 you know the argument of taking up there the blocks of the for loop that's the same thing signature after where we need but we can simplify that in this case is generates an anonymous from fly and whatever got where we got is the 1st and 2nd arguments but to whatever where 0 1 and the other makes 1 the 1 1 added together makes to the 1 2 and the other blow up that is how that infinite the Fibonacci sequence is generated very simply and this is sort of stuff a scare people scared me when I 1st saw it took me a while on sales and like all that's actually not hard as part of a language where the learning now as we dive into it more which we can today we know with me so this is some the stuff it kind of scares people when they see the process until is talking about In Stefan allele is talking about line profile and stuff like that that what kind of scary there's some folks but what did they it is wonderful stuff the data which actually using most of the time or steady abstract way behind the scenes for the simple fact that missing but yes and I know this is the right thing so I hope that back up like that so you say well people who use CSS anywhere in the room and that the language of the uh and and there at the time that's the what do you mean by how stable the runtime stable in that I cannot comment on that I'm talking more about the you sent back yeah what else what do you think of and if you need to run for a year I problem when you prefer yes the this of the what is it was fun of the those are the don't hurt traits which you can apply to things which can modify their behavior and it does little strange and say class stock is minimal and the term is is overloaded there it might be a trade that might be a parent class um so that's 1 thing we'll have history but traits or something a slap on some you can modify how the behavior is an effect you can open source code which is written in article and QP which will report dance but harder to understand that you can actually read them other implemented right this what is it like that of the but 0 it's not a QP I apologize that is higher or thank you I don't have time for another question they yes this constraint to rules will variables I what you and on and on and of the the that the so but every successive 1 has to be greater than the prior 1 yeah that that shouldn't be a problem because right there I had the star plus star I'm assuming I can contribute but you know start less than a a star for a constraint and then modified on fly but or what I'm going back to the where constraints that that shouldn't be hard I don't know the exact syntax of throwing the exception on the but that shouldn't be hard the this is the the I know what a scrubbing and so on the reason is probably of and that 1 minute left so I think that there was an easy question again insecticide unless you have 55 seconds left on the formed on yes I had did that in 1 and you can import I just called a real on the column of it was I you and if you use the the of the of the of the the work and you know you know of the world and of the world is really really want to know and what have OK thank you but