 Proste za delaj. Čekaj za invitacij. To je moja pravda, da... Prejdeš mi, da je dobro? Na mikri? Prejdeš mi? So, na pravom mojsela in svojim organizacijom nevorilim organizacijom, nevorilim organizacijom. Prejdeš mi, da je pravda prezentovati ljubov, na površtnih mene. ... ... ... ... ... ... ... ...but I'm here to present the language. So, in this agenda I will talk about the motivation, which will let me hear. It's just a side project and about the design, the decisions, what's under the hood. And I will make a small demo that the language is actually capable of doing something useful. Because many languages start with Fibonacci or doing some temperature calculations. I have this also in my language. So, as I said about the name of the language, so in this picture you can see that all the letters from A to Z were already taken. There are many names of ex-girlfriends, I think, like Lisa or Lily, so that was also I couldn't use. And there are many names of famous scientists and some cute animals, so that I thought that, well, never also will fit as well, so that's the name. So, it's a hobby project, a creativity escape. I also am learning a little bit about programming languages, it interests me a lot. I think that many people who work in IT or computer science, they also are interested in this, because this is the primary tool for doing things. And in the background you can see, this is a translation of the Dragon book, which I was reading, and that was one of the first books, which gives you some very theoretical background. Then there are two books, which led me to extend the language. There was a talk about types, so we have also a book about types. And there is a book, which was very useful to start doing actually the design or the language, not using the Dragon book, but rather to start writing through a machine. And this is a perfect code, there are some clean codes, so those are the things, which you also should look after, not to create some mess, but some maintaining code, which can be extended. So, the design decisions, those are, this is, first I began the language as a functional programming language, there is a chapter in a book, how to make a functional programming language. And then I decided it should be called by value, it should be statically typed, because I want to have the compiler to correct my code, and besides such code is faster. I knew that many functional programming languages are ML based, maybe you know OCaml, which is very hard to read, so I then thought, if everything is doing from scratch, then maybe I can have some C-like syntax. And then we have reference models, so everything is reference, basically we have box values, how the values in memory are represented, so every flow or integer or string is kept inside the memory as a separate object. And it's syndically scoped. So, under the hood what helped me a lot was actually not to come up with something completely new, but I read the book, which I mentioned before, and then there I found the Maurer machine. I suppose it is the basis for the OCaml language in its virtual machine. I also needed Margen Swib Gerbic collector, because how the objects are created, how the first class functions are being returned from different functions, so not to have so-called spaghetti stack, I needed the Gerbic collector, which also kind of simplifies things. As minimalities matters. And tail rates optimization, when we have a functional programming language, then we don't have loops, but using tail recursion we can change loops into functions. Then there are some other things like hash maps, trees, linked list, and everything is written in C using our old friends, Bison and Flex. So this is kind of the basis for many, many compilers when they are in the initial step. So that's how a typical code looks like in never language. So here we have static types. It means that the function calc returns a function from within a, it returns a first class function. This is its type, that it takes a float parameter, returns a float, and it converts Fahrenheit degrees into Celsius. So we get a function and then we call it with some parameter and then get a value. So that was the first part, which was written. And, oh, okay. So those, the language, how it was developed, I decided to first begin from invoking functions, because many programming languages have loops, or ifs, conditionals, or some other control structures, but this seemed to be not very interesting to me, because it's very well written, and all the function invocations are written in a textbook at the end of it. So I decided to begin from the end, because the beginning was not very interesting, and actually I think that was a wise decision, because this way I had some kind of structure, how the program will look in the later on, some framework I could extend. So everything was expression, also functions are expressions, we have some simple operators and we have only one type, and that was the beginning, so to execute some expressions. Then I thought, oh, maybe having these controls is not enough, so I added a type integer, so I could add a new operator, I could do some Boolean expressions, like and or not. And later on I thought that, oh, maybe we should add something more, so let's go back to some controls, and I added some arithmetic functions, and also assert function, and that was also I think a good decision, because this led me to write programs, which were validating themselves. So when I would write something in the never program language, do an assert, and then I knew that if this program works, then this asset will pass, and that I can create a large test suite of many tests to validate if what I'm doing is proper and if I'm extending the language in a proper way. So then I got back to types, so matrices again as to do something more, and those were conformant arrays. Conformant arrays mean that when you pass a function, an array to a function, then you will get its dimension as an argument of a function, as such solution is in the Pascal programming language. I also overloaded operators. Then I thought, oh, maybe let's go and add some more control flow, so I added four while loops, and also variables. So at this point it's also interesting, because I was trying to write some dynamic programming language. Maybe you know the dynamic programming problem to solve, and it was cutting rot. You maybe know that you should get a maximum value in cutting the rot, and there are some values we should remember. But without side effects it was very tedious to write such a program. So I thought, oh, let's do some assignments. It was to be functional programming language, but maybe if someone doesn't want to use assignments, he or she will have functional programming language, but if we can change something that we can do more easily, call some interesting problems. Then I added types and exceptions, and that's it. So that's how the programming language was progressing. Could you tell more about the exceptions, why you decided to implement this model of exceptions? Well, I also was thinking how to handle with some runtime errors. The question was why I decided to add exceptions, not some optionals or some other form of error handling. So that's because if we had a division by zero, then the virtual machine would stop, but I didn't want to do that, because I would like to have the programmer to have a chance to handle the situation in his or her way. So I thought that maybe there is something like exceptions, and I can learn how to do exception handling. I learned that exception handlers are being searched by binary search in the code, so that was really surprising technique, which I also found somewhere, and that's how I added that. Here you can specify only the name of the exception, there are different exceptions, like array of bounds or some others. So how much time do I have? Five minutes, and then questions. Okay, so here I have an example of a neural network. So briefly I wanted also to make some example of some more advanced program, so this is backward-forward propagation of the supervised learning of a natural network. We have a perceptron, we have some input values and some output value. Okay, and so, and also some neural networks are recently a hot topic again. So basically we want to set those values to such variables, to such values, so the error, error, which is written by the perceptron, is as low as possible. So basically we need some function, which gives values from zero to one. We wanted to have a randomized function. Here we have a seed, and then we return our original congruential generator, which gives us subsequent pseudo-numbers. Then we wanted to define our own multiplication. We can multiply our rise in another language, but we want to have some other form of multiplication, so here it is. So this is kind of element by element multiplication. So those are the input values, we have four out of eight possible values, and then expected outcome, which should give us the neural network. As you can see, the output is the middle value, and the left and right column should be discarded. So then we begin with some random values. For all input values, as those are operations on all elements of an array, we get some output, which is the s, then we use something, and then we have output of our network, but we want to improve it, so we use something like called, in the back propagation, this is gradient descent method, here we have the sigmoid, it's derivative, so we move towards minimum of the function, so we calculate the error, then do some multiplications and correct the coefficients of the network. So all those operations or matrix are done in some convenient way, so you need to write how to multiply some matrices, everything is executed by the virtual machine, so matrices are first class, and in some many learning cycles we repeat the forward-backward propagation to have those coefficient low, and here are the results, those values are involved, are the input values, which the network has never ever seen, but it gives us proper results, except for one value where it's undecided, instead of saying that it should be zero, it gives us 50, value 50, which is kind of unexpected value, undecided value, so that was the longer example, and in the future I want to extend on types, add some operations on lists, use some externals and improve runtime, actually records and list comprehension and foreign function interface have been added since I wrote this presentation, so I think that I will now focus on some type inference, I think this is what Lua people want to do, and basically that's it, so to summarize, creating programming languages is a fun, can teach you a lot, although it comes at the price, and I think at the end is a satisfactory to see something that it's running and that it's being executed as you expected, so thank you very much for your attention and for invitation, and if you want to check the language and of course I like to, if someone starts me on the GitHub, so thank you a lot for your time, thank you very much, if you have any questions, and if I have time, then I have t-shirts for the best questions, for six best questions, a question, no, no, it's by reference, so you get only kind of a pointer, a reference, so only a reference is passed to that value, it's still in the memory, it's not being copied. No, you can modify them by the assignments, so if you have a reference to a variable or indexed an arid, then you can modify it with assignment, yes, yes, yes. Uh-huh, yeah. Well, I think that it's your choice if you prefer to do this this way from some academic point of view or if you would like to learn how tail recursion works or if you'd like to try to write your function in the tail recursive way, then here you go, you can try this, and if you are, and loops are syntactic sugar over tail recursion, so you can do tail loops instead. Another question? Yes. No, not yet, but this, I thought that using foreign function interface could use some libraries to do such optimizations, but it's not ready yet. Thank you. Yeah. It's 25,000 lines of code right now. 25,000. Yeah, it's virtual machine type checker and scanner parser. Okay, thank you. So, yeah.