Hello, my name means, I don't know, we'll see, my name is Victor, hello, hello, so my name is Victor, I'm
20 years old, I was born in Bulgaria, where I lived for most of my life, now after that I lived
for theories in Dublin, Ireland, and now I'm a secondary student at TU Delft, today I wanted
to tell you something about my recent last year's Google Summer of Code Project, where the
goal was to migrate the Lua package manager from the dynamically typed Lua to statically
typed dialect of Lua called Deal, and basically go over the benefits of that, as well
as how planning happened and how the reality of everything worked, as you're going to see
that it was not as straightforward as a dimension, then how I tackle different problems during that,
and at the end what my work flow was, and then what happened at the end, so without
certain, I wanted to start with what Google Summer of Code is, so Google Summer of Code does probably
know it's a platform where big open source organizations can put projects with their contributors,
so that people who are new to open source development can get a feel what is like to work
on open source, and not only on small projects, but large and active projects, so my
so the idea is that it's a kind of like a windman situation where the person gets experience
while the organization gets a new feature, or a new implementation, or a new basically a new
feature, so my thing on that is that if you haven't tried it and contributing to open source
to something you are passionate about, definitely give it a go, it was really once in a lifetime
opportunity for me, now without any more blubbing, let's go to the actual benefit of the migration,
so the main benefit was obviously to introduce types to the lower works codebase,
to hopefully make it clearer, more understandable, and more maintainable for the future,
the second benefit, which was also a really nice other benefit, was a new improved to the
teal language, which was a good idea for this project as it was a large project, large scale project,
and allowed for encompassed edge cases, which teal, we saw that did not know how to handle,
but now it can, so without let me show you an example, so here on the left we have a code,
which I took from the manifest writer, manifest fire writer, yes, and it's an example
I picked, because first of all I want you to think about what the type of storage is,
and it's not written there, it's underlined there, and you can probably figure out from the code,
like that's why I picked this example, it was not the most difficult one, or the most simplest one,
but I believe that it's manageable to be figured out just from the code itself,
so I hope you guessed it, it's actually a map from a string to an array of strings,
where here you can see the string, it works, oh this works, okay, so here you can see that
the storage takes an item name, the name of the item that you want to insert, and
are an array of combinations between names and versions, so as you can hopefully see now,
the second example, if someone were to try to make an improvement on that specific method now,
they can just look at the types and easier go through the code, not spending their time
trying to decode what exactly the code does, now I don't know how many times, so let's move on with
what planning was, so this was my initial proposal back in April last year, it's small,
I know the idea is not to read it, it's there if you want to read it, but that's not the go,
I want to just point some places where planning, planning magic happened, anyway, so
first I wanted to see that here, I forgot that I had exams, so this was not a week, I was
able to work on, and so that's low the project, then my plan pre-planned vacation was actually
not this week, but actually this one, which may seem not important, however, I what I figured is
that it's really important for those changes to be, or for your schedule and for when you're
available, it was really important to communicate that with your mentor, as for me or for our case,
it almost caused the project to not be finished, so don't undermine that, now another thing is,
I want to mention is the last week, I put a buffer week, which in turn is the thing that saved
the project, so the mistake was the thing that almost failed it, and then the buffer week was the
thing that saved it, now as to my delusions at the start, you can probably see how I had the image
in my head that by week five I was going to be done with 20% of the project, and by week six I was
going to be done with 80% of the project, and by week seven I was going to be done, which was not what
happened, now let's go with actually how I approach the problem, so my approach to the problem
as there were many files interacting with each other was to create a dependency graph, so a dependency
graph where the root files were the core files of the project, which did not interact with anything
outside of it, so the interactives within each other, but once they were all figured out,
these two dos of foundation have already translated code, then I moved out layer by layer until
the leaves, which were the mostly the files handling the commands of the CLI, so pretty up the
list, then however, of course it was not a straightforward as with most things, and we had a
few exceptions, first of which were the external dependencies, the external dependencies are in
Lua, and so you have to provide some sort of definitions to TIO, so it can handle them,
this however, it's a really nice feature of TIO, which provides definition files, which I used,
however, as we wanted to improve TIO, I was on the development branch of TIO, rather than the
release branch of TIO, which created a few changes which also had to be taken care of.
Now the next thing were also files that after some decisions and considerations, we decided that
were not in the scope of the project, so that they would not be converted, meaning that they would
also need their own definition files. And the third thing are the cyclic dependencies,
cyclic dependencies are handled by Lua, however, they are not a good practice, and we wanted to get
rid of them, so that also happened by refactoring methods from one file to another to hopefully minimize
the cyclic dependencies. Here I also wanted to add a quick note on challenging parts, which I encountered
during my actual conversion, which was when I was stuck and a method that I could not figure out,
instead of stopping, a solution was to continue working to down the file or to a different
file so that I do not get blocked and mark that part where, which I did not understand, is a question.
That led to two huge improvements, one of which was that I could be more efficient with my work,
and the second one was that the meetings with my mentor had more of a agenda to them,
which made them more structured, and we could go over more blockages in them. Now, I want to talk
about the dependency, the development workflow about it, so how I did testing, so after I completed
the file, how I was testing them. In this case, I had to start when I converted the file,
I could run the already existing workflow on GitHub, on GitHub actions, which took about seven minutes,
which was fine because I could continue to the next file, and only go back if it failed.
However, at some point in the project, I managed to magically break up the project,
so seven minutes per iteration was not a good idea. So then, after some filling around, I managed
to set up the built environment locally, which brought down the runtime from minutes to seconds,
which was a huge improvement, and as a note, more of the story is in best more time
in testing, as it is really important for your workflow. Another thing is bunching, branching,
we had two options for it, one of which was one was incremental releases, so every
comment I had would go on to a branch, which then would get merged, which was the straightforward
solution, however, another solution we had was a one big release at the end, which kind of means
after all the code was converted, moving it to a new clean branch, where there were two benefits
to it. One was that each file only had one entry, even if it was edited multiple times throughout the
course, and the second was that Git Blame continued to work, so on the newly generated
Lua code from the Tio code. Okay, so Git Blame, the Git Blame history was saved because of the
new commits that only added the new files one at a time. Hopefully that makes sense. Now, I also wanted
to talk a little bit about how everything was brought together, so after the new clean branch,
we had, so after the new clean branch, we wanted to wait a bit for community feedback,
which also gave us time to release the new version of Tio, the development version of Tio,
which was, which the code was dependent on, so at the end it worked out nicely as we could
address feedback from the community as well as have the new version of Tio, and then we merged it,
that's it. So to recap, I hope this presentation, although quick,
helped to gain some valuable insights, which I wanted to share as they really helped me for this
project, and who definitely, I would definitely use in the future and taking to consideration.
So hopefully now, can you do? This slide is for related links, which are on the
first them the presentation page, on below in the resources, as well on the presentation slides,
which are also there, and if you have any further questions, as I don't think we have much time,
maybe, you'll have much time, so you can either talk to me outside after the presentation,
or on one of those two links here. Thank you, Victor, that's awesome.
I think, it's also a really nice, we get students to speak, you know, from the Geeks Summer of Code.
We've also, as a theme of the day, we're going to replace all words with Geeks, so we'll have Geeks Emax.
So let's have questions.
Sorry, repeat, Aydberg.
It was made short, a minute before the last one fight.
So the question was, if I had to change anything about the signature or just add the
types, in most cases, I could get away with just the types, however, with the cyclic
dependencies, for example, I had to refactor code around to deal with those, which men
in this signature sometimes.
In fact, it reminded me of what?
Yes, that was the go.
Any more questions?
I don't think if we have time.
For more questions, but.
Okay, sure.
One more question.
Anyway.
Okay.
What goal is off the cyclic when moving something right from the stack of each
type language?
Is the binding fixed issues?
Did you find any interesting issues in the world?
We actually did, but they're quite lengthy, so we cannot go into much detail.
But one of which was the hash, the hash table was interestingly implemented in
which we then had to change how deal dealt with it.
And another good one was some code that was redundant, which we managed to remove in the process.
So yes, that was something we'd do nice.
Now I'm going to leave it to the next person, so we don't.
Oh, we have time.
Okay.
Sorry.
I cannot.
Yeah.
Did they leave myself in the work?
No, I did not.
I was not smart enough to do that.
No.
Maybe a different project, you know.
Any more questions?
I'm letting you stop me because I don't know.
Okay.
Yeah.
Five minutes to complete the talk and then you're five minutes for questions.
Okay.
Good.
So any questions?
Yes.
So the idea, the way to language works is by writing the types and then compiling it back to
Lua.
So everything is still running from Lua.
However, most of it was written from TL.
So compiled from TL.