Created
August 13, 2023 18:55
-
-
Save Schwusch/ba8f4b8b8f53a64ba44b2550832f6a3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hello everyone, the submarine podcast is with you, its presenter Egor Tolstoy, this is | |
me and Ekaterina Petrova, hello everyone, if you turned on this episode, you already know | |
what it is about by the way. I don’t know why, in general, every time in eyeliners we | |
try to guess some kind of riddle for those who are listening, as if they didn’t see the title of | |
the release, it seems to me that we ourselves are trying to warm up a little just to tune | |
in to normal questions, and this is the time where we are dragging time with our | |
eyeliners, as we are now just trying to get into the flow maybe maybe but in short it | |
doesn't matter today a new episode in the category of your favorite episodes this is | |
not food episodes it's a category on. these are issues about programming languages and | |
today we will talk about dart, not to be confused with dark, we also wrote about dark, but | |
today we write about dart and not to be confused with flater, we are talking about dart, not | |
about flatter, because when we asked people to ask questions in the chat, they started | |
asking questions. only about darts and visiting us Slava Egorov is a developer of | |
the DartLit team of the native compiler and as Slava says himself and the Shvets and the | |
reaper and the Nadudei and the Greek I understand what you are talking about hello | |
glory hello good time of the day please tell us a little about yourself because how are you In | |
general, this is often brought into the development of compilers very much. an | |
interesting story, this is a difficult question in general, I got into the development of | |
compilers a long time ago because I was interested in scripting programming languages, I | |
was developing my own multiuser dungeon if people remember such words and we built in | |
such a Lua scripting language and it became interesting to me how it all works inside I am | |
very became interested, plunged and I was lucky that I lived in Novosibirsk then. there is a | |
very good place there, it was more precisely called excel, I went to work there during my | |
student years and from there I actually got into compilers and joined okay after that you | |
immediately went to work on dart or managed to work on something else besides | |
excelsior after excelsior I went working on a veto is such a javascript engine inside the | |
chrome node and other things that use javascript inside are quite common. now I worked | |
on it for 2 years and then the people who created the engine v they decided that it was | |
enough for us to deal with this weight javascript is a dead end branch of evolution and | |
decided to make their own programming language called dart and I actually from those times | |
2 years after I started working on darts, that is, I was already darting when darts first | |
appeared in the earliest of them. in life and gradually began to work more and more on larger | |
and larger parts of the project and expand my scope, I ended up where I now found | |
myself pancake, but you can immediately ask a question, maybe it will be somewhere | |
ahead when we discuss history, so you can park it, but how you already mentioned that | |
javascript is a dead end branch and for Veit it was decided by the people who are involved | |
in this decided to create a new programming language, of course, every time we have a lot | |
of cool engineers and a lot of resources, why take it. some well-known already existing | |
solutions need to be cut all of their own, why didn’t they try something else, I don’t know | |
whether it was technically possible to replace Javascript and the fact that, well, in general, | |
in order to solve the problems that it delivered instead of developing a new | |
language, but maybe this question can be I don’t know how to park it, but in order not to | |
forget it, I’ll just forget it, otherwise if Yegor doesn’t mind, I can basically tell you | |
about it, let’s really, yes, let’s really tell, I’ve already asked, let’s talk about. history and just | |
change the sequence a little bit I’m fine okay then the main thing for me then is to | |
understand that programmers who create their own programming languages usually | |
programming, which is of course in retrospect. it turned out that knowing how to | |
develop virtual machines and knowing how to develop programming | |
languages are two different things, well, people learn from their mistakes on their own, | |
therefore, of course, for such people, creating their own programming language instead | |
of treating something there, fixing it somehow, patching is the path they choose simply | |
because they have such a drive inside to do something new instead of fixing the old | |
one, which is why the dart programming language appeared and of course if we | |
Let's look at those years when. only this whole story appeared that Lars had work on | |
skom behind him work on java, echoes of this are visible in the design of the | |
programming language that he created because the first versions of Dart are zero and the | |
first version they were more like such a smalllt with Java syntax than the dart we have | |
today is dart version 2 and dart version 3 which just came out recently. they are quite | |
different from what Lars conceived and created 10-12 years ago, in my opinion, this | |
answers the question that Katya actually asked because she wanted to, I understood, | |
and I’ll try to continue then Katya’s question, you explained why you started making | |
your own language, but every new one a language is usually started to be done in order to | |
eliminate some fundamental shortcomings of other languages, which at that moment | |
are fundamental. shortcomings and what I wanted well, as I said, people worked as a script | |
on the web javascript is used quite strongly more and more lines of code in applications | |
applications are becoming more and more monstrous they are difficult to develop difficult | |
to maintain if you look at some kind of gmail or look at all these large applications that exist | |
on ve, let's say google docs and so on, then Vast had a problem that such applications. | |
write and offer different solutions to this problem, for example, if you look at what | |
google used again 10 12 15 years ago, he used closure this and javascript, which has | |
type annotations written in the comments that some third-party compiler checks and makes | |
sure that you don’t assign a dog to a cat there and don’t put the car into the plane there and | |
do everything as the types promise in the program but write. such javascript is not very nice | |
because you have something in there | |
programmers with a strong sense that they know how to do everything right, and in fact, the | |
people who created veid, they belong to this category of people, in fact, if you look at their | |
biography, vede for them was not the first, not the second, maybe not even the third virtual. | |
the machine they worked on the chief programmer vieta who actually started this project | |
Larsback is a Danish programmer who has a very long track record of working | |
on virtual machines. in the nineties, I worked on a virtual machine for small talk in a startup | |
in Silicon Valley or in Silicon Valley, I don’t know how you prefer this startup, at one time | |
such a company bought sun microsystems and used the developments that they | |
did there in order to create a jvm and a hotspot compiler which actually pulls out all the | |
interprises today, without which everything died a long time ago in the nineties, so | |
he worked after that on other different things. worked on a startup where he created a | |
smalllt machine for small internet of things devices, although at the time when he was | |
working on it, there wasn’t even such a term, and then when google decided to make his | |
own browser, he was invited to work on veit and he made veit and understandable | |
the case is such a person he has a strong opinion about how to do everything right and | |
that's why he decided that he knows how to do languages | |
impossible to predict correctly because for quite a long time there were no solutions similar on the market, | |
that is, there were some developments but not like typescript Another problem was that I think Lars did not | |
really understand that web programmers who would offer something that is not javascript they instead to rush at | |
you screaming super victory they will run away from you and boo. here to shout that this is the second | |
coming of the flash, which everyone is simply afraid of shivering, and or there to compare it with the advent of | |
activ x, which everyone hates just until the face turns blue, such strong hatred in people got into the bones right | |
here, this could have been foreseen, but they didn’t foresee thought that people will not look | |
of course, teams inside google and some teams outside of google, though some of these teams are trying | |
to get off dart now, for example, we all know such a uraik team that used dart quite heavily there, I don’t know | |
about five or six years ago, and now they are trying to get off hello to Evgeny Kot, who will definitely listen to this | |
issue I know yes hello to Evgeny Katu yes I just wanted to | |
comment me super amazing easy while i heard the story that | |
making comments makes it difficult to read difficult to support again, a third-party compiler needs to use tyscript at | |
that time did not exist yet, and therefore the idea arose why not make a programming language in which it would | |
not be necessary to write something in the comments that would support type annotations out of the box, | |
but at the same time, it would be quite close in spirit to javascript, that is, it would be dynamically typed all the | |
same. so that you can quickly prototype something on it so that people do not have the difficulty of switching | |
from javascript to such a programming language, of course, it was planned to initially support it natively in the | |
browser so that you can directly write an html page and write it in the script instead of the dart vascript and everything | |
would work without additional compilers just instantly you have an edit refresh cycle that's so | |
short when you're editing and all of a sudden you see how the behavior has changed. your web | |
page and this language would simultaneously meet two categories of people who want to subtype very quickly and | |
write very quickly something that works and also large enterprise teams who can when their application gets | |
bigger and bigger after the initial stage of prototyping they can start writing types inside there code and | |
some kind of tooling will check that these types are all correct and so on, that is, the Darth philosophy | |
of the first versions of o. was that we offer a more scalable programming system for the web, which, well, has | |
such more sane semantics, better tooling, as it were, everything works with. out of the box and you don’t need | |
any strange tools to use some types of writing in the comments and so on You already mentioned that it | |
turned out that writing languages is not the same as writing a virtual machine What in the end with this vision | |
went wrong as it collided with reality as there was a release Well, a lot of things happened at the same time, some | |
of these things of course could have been foreseen from the beginning and some of them could not, for example, | |
the fact that somewhere in a secret laboratory. in the basement people saw typÿcriipt but this | |
look at how it looks outwardly, they will look into the essence of what it is in the soul, sorry, but in the soul. and | |
for the good of people, but people only looked, as it were, outwardly it’s like a flash, so you need to quickly | |
quickly run to twitter and write that this is all very bad and that it should die, and that’s why a large population of | |
web programmers, as it were, did not decide to switch to dart, a small part of people who actually saw the benefit | |
of what the dart offered, they moved and began to use it. and that includes | |
only after you released the first version and then some teams became interested, that | |
is, was there any. initially from someone, honestly I don’t remember, at that time I was | |
a peasant who was told that we have a programming language for which we | |
need to make a virtual machine, here’s a c ++ code base for you, let’s imatyga and | |
matyk in this dig holes from here to sunset and I I was doing this, and all sorts of such | |
high-level conversations about the fact that there is a customer, but there is some kind | |
of vp of engineering there. grind with him and decide that he will transfer to our programming | |
language, I didn’t participate in such things then for me it was only the beginning of my | |
ascent up the career ladder, so let’s say I like that remark. yes, and a slight smile, well, | |
now I’m somehow more involved in such discussions and in solving such issues, I’m not | |
only sitting there, writing c ++ code or debugging something in the debugger, I write | |
documents, discuss all sorts of things with people, but it gradually happened so dart | |
is not written on a dart | |
well, a syntex tree builds all that it is written in Dart and a lot of tools are written in Dart, | |
but the core that Dart actually executes converts to machine code, this is written in C + | |
+, this is written because it happened so historically or because it makes no sense, let's | |
say rewrite to rat because it still won’t win in performance, and in some other | |
moments it historically developed if there was an opportunity, I would. I also | |
rewrote most of the kernel from pluses to dart, so let's say if we look at what happened in | |
the java world where the grail appeared there and all that stuff that turns out that the | |
kernel is still some | |
understandable dart. was supposed to solve all the shortcomings of the vascript and at | |
the same time, well, one of the largest in the form of dynamic typing, and nevertheless, | |
in the first version, yes, there was dynamic typing anyway, it’s so strange to me, but you | |
explained it, well, this is probably not a question, you explained that the idea was to it | |
was easy to switch from one language to another, yes, because no one would have | |
switched at all. It’s like a too different paradigm. In short, the idea is clear, but even | |
retrospectively now, looking and seeing that static typing nevertheless appeared, in | |
general, okay. it’s just that I couldn’t keep silent it’s just like watching a series you | |
can’t watch TV shows in general on netflix you can watch how programming languages | |
\u200b\u200bdispersed and what mistakes they made and watch popcorn actually I want to | |
comment on one thing here dynamic typing it appears in different forms and in fact, the | |
people who developed dart initially believed that dynamic typing in the form in which | |
javascript has it when we can not only put different things in variables, but we can take an | |
object. and start adding some properties to it there remove these properties there is a | |
prototype chain into which you can cram your methods there and so on they thought | |
that such dynamic typing is too dynamic and you need to be a little more static about just | |
such things as what we have here a class and it has methods and you can’t just take the | |
method and delete or add it to the class, but the fact that we can put different things in a | |
variable is more or less normal, so dynamic typing remains. but they made it | |
more sane, actually fixed this javascript problem, and not just completely removed the | |
dynamic typing, okay, but how much the needs of some commands inside Google at that | |
time were taken into account when developing the first version, that is, were the | |
commands conditionally such customers of the language for the sake of solving the | |
problems of which it was written or adoption has begun | |
we are finishing the release of parts of dart are written on dart the virtual machine is written | |
on. pluses, basically Dart has how to say the parser that actually parses it | |
plus, but at the same time a lot of compiler infrastructure for the jet, and so on, it moved | |
to the actual Java and it’s written in Java, okay, the first version of Dart came out, it turned | |
out that the developers take it wrong. I would like to, but some kind of adoption all the | |
same begins and teams start using it what happened next happened a lot of different | |
things we tried to get dart built into chrome itself, more precisely into chromium, that is, into | |
the open source codebase from which chrome itself is built so that people | |
can use dark directly in the browser without converting to javascript or without using our | |
custom build we called darp. that is, we had a special build of Chromium with a dort | |
virtual machine inside that people used when writing applications for debugging so that | |
they had a very fast development cycle when they just edited the code and saw how it | |
works without compiling We tried to embed it, tried it, but then Gradually, the opposition | |
from the main team of Chrome, it grew and grew, and it became clear that it was not our | |
destiny to be in Chrome. and it was around 2014-2015 when, well, it became quite | |
obvious that this would not happen, we began to look for where to go after that, what | |
would we do and there were many different experiments, but suddenly something | |
happened that we did not expect within the Chrome team itself there was a small group | |
very senior engineers who worked there from the very beginning were | |
engaged in the actual rendering. and there is a layout engine inside chrome and they | |
asked such an interesting question if we take the web and throw out backward | |
compatibility from it, how fast can we make such a kind of cropped browser that, instead | |
of executing the web, we know that the web has very deep historical roots, so if cut off all | |
these roots and create, as it were, a bright web of the future, how fast the browser is and | |
how lightweight the browser will turn out. and so they took scissors there, an ax saw, | |
and began to cut and chop, chop, chop, eventually cut off javascript, cut off html | |
instead of javascript, put dart in, which was a big surprise for us and it turned out to | |
be a flatter, it wasn’t called a flatter then, it was called sky, it was just such an experiment, | |
but something happened very interesting and this flatter project since 2015 has just | |
taken off along an exponential curve and we are through it. got the same interest in darts | |
that we didn’t get, it’s just that it’s so interesting on the web and you don’t know what | |
you’re saying that you didn’t expect why they made a decision, well, in the sense it’s | |
clear that in any case there was talk at the company level, it’s not like it was a secret, and | |
even more so well, there was this story with Chrome, but it’s just hard for me to imagine | |
that you didn’t even know what kind of solution they were preparing, well, in the | |
sense of how different it is, well, it’s not transparent how large the scale of the company is, | |
so it’s more correct to say, well, again Someone may have known what they were doing. | |
they, according to their own statements, looked at 20 different programming | |
languages, including non-kotlin java javascript typescript and I don’t even know how carp | |
all kinds of programming languages made a big such spreadsheet in which they wrote all | |
their comments about the pros and cons of each programming language of | |
course that the fact that they are a team inside Google and we are a team inside Google, | |
she somehow entered this spreadsheet. that it is possible to somehow work as partners on | |
this project, but we worked until the very end, that is, we worked, we knew that they | |
were considering us as a candidate, but we did not know until the very end what they | |
would choose. us because, well, competence is quite so tough, they really looked at all | |
possible aspects, how understandable the code is | |
the other initial one is very interesting, well, as always happens, many needs are covered, but the main | |
engine really was so that during development it was possible to compile quickly and modularly | |
incrementally, what later the code became more, as it were, of better quality due to the fact that | |
everything is now statically typed, this is, as it were, a nice bonus second order effects were of course | |
people who said we love static typing the more the better they then celebrated what a change it was by | |
then everything. the original designers of the language they already jumped off the actual design | |
because they realized that their idea of how | |
will they be able to write code in the style they want to code in, and so on, and so they chose dart in | |
the end and of course we opened a bottle of champagne there was nothing like that | |
because we didn’t even understand at that moment how much it would take off and so this rise was | |
quite a big surprise, and for us, I think for them, too, that people. they really became very interested | |
in flatter and it turns out the second version of Dart is major, it was already dictated by the needs | |
of flatter rather yes, well, this is also a complicated story, because by that time quite a lot of | |
lines of code had already been written inside Google on Dort, measured in millions and it was used | |
quite heavily in such an important division of Google called ads which actually sells ads they make | |
frontends on it. they still do it if you order advertising there through adwords and so on, all these web | |
applications are written in Dart and it’s a lot of Dart as I said already millions of lines of code and they | |
came to us with all sorts of problems, for example, when it became clear that we weren’t we don't embed | |
dart into the browser they came and said, okay, you don't paste it into the browser what will happen | |
to dartium well it was clear to us that dartium doesn't really make sense to support. then they | |
didn’t say anything, but how are we going to debug because if we have to sit through the | |
compilation step and wait until everything is compiled, then it’s a long time and we began to look at | |
possible approaches to solving this problem and it became clear to us that the approach of compiling | |
Dart to javascript which we've been using before, it won't be scalable for their use because Darart | |
was compiled as if it were a closed world, which is it. when the entire application is input to the | |
compiler, he sits there for a long time looking at this application, trying to understand how all possible | |
types flow through the program, what variables take what values, and then it gives out the most | |
optimized code, but it takes quite a long time, and in development I want to you edited one file, clicked | |
on the button and your page was updated and you could see what had changed so that you | |
could test something there very quickly. then you need to do what is called modular incremental | |
compilation, making such a compilation for a language with dynamic typing is quite | |
difficult because the code will be very poor quality if you have a lot of poor quality | |
code, then the browser will explode, we tried this, let's say safari if you apply a completely | |
unoptimized application to it from here of these million lines of code safari just exploded there | |
5-6 years ago, it had out of memory and so on. and then we decided what we need to do optimizations | |
and what we need to optimize for optimization we need static types and therefore tar2 it’s rather not | |
flatter needs, but rather covers internal web developers, and then they didn’t need debugging, wow, | |
this is an unexpected fact because what i like | |
since, well, when, too, there, before the hint, I refreshed something in my memory, I think | |
such a thing, but they added typing all the same, and now it turns out that there was a need. everyone | |
the language looks they don’t match where the language is going they decided that we’ll go do something else | |
and other people continued people who continued they are more understanding of static typing, that is, let’s say the | |
lead of the language development team has such a strong Haskul background and it’s clear that the person with a | |
husky background. he understands static typing quite well, okay, there was something else in the second dart from | |
a serious one, in addition to adding static typing, there were various improvements, that is, 2.0 is just such a | |
transition to a new type system, generics were added for methods that used to be generics only for classes | |
because again, the developers who developed dart initially believed that generics were generally a complex | |
feature that got burned on java. cardards there with all this and thought that well, here’s a sheet of something there, | |
this is a useful feature that should be given to people when functions with denaric parameters already begin | |
there. It’s already difficult to understand people don’t need to give them such features. Of course, when we | |
switch to static typing without generic methods, it becomes difficult because it seems like there are generics and | |
there are no generic methods, so we added this and so it seems like nothing else in 2.0 was particularly | |
thorough changing the foundation of the house because they realized that if you make big changes in the | |
language, you need to have it. a structure that allows the team that develops the language to make such changes | |
quickly before dart 2 for each sub-command inside dart that did some kind of tooling or there virtual machine or | |
compiler in javascript they all wrote their own parser for the dart language and this was possible | |
because the language was very simple, but with the transition to the second version, when static typing | |
appeared there, the typing type system. it became difficult for everyone to repeat the same work for everyone | |
because, well, this is not a trivial work and there was a need to have what is called a common frontend, we | |
actually called this project and made it common frontend which is written in Darth, you give it the source code as | |
input and it produces an abstract syntax tree that all other backends then use for their needs there, let's | |
say you want to compile it into native code, give it. a virtual machine or a native compiler wants to compile | |
javascript, give it to the compiler in javascript, and I would say that of the infrastructural changes that | |
occurred in dart 2, this was the most important because it later allowed the language to develop much | |
faster than before, this is a thrill, and what happened then after the second dart that is, the next releases, | |
whether there was anything else the same, I don’t know, monumental, in fact, a complete rework of the language. | |
or further such an already rather incremental development of ideas | |
which appeared in the second dorm at first did small things, that is, let's say by that time a lot of people were already | |
using flutter and in flater people build uh widget trees, they just write code that, using constructors, creates a | |
representation of this widget tree, which then the flutter renders for these people too there was a need to | |
somehow write code that, first of all, did not have to press a lot of buttons. and to make it clear and there were two | |
problems, one problem is that you need to constantly write new before calling the constructor, and we | |
removed this new, that is, you can simply write the name of the constructor and the constructor is called, an object | |
is created, this removed a fairly large amount of visual noise from the Fluter code, another change was that we | |
added that we call collection literals collection literals in others. languages, this is sometimes called a collection | |
comprehension | |
or something like this when you can write let's say a literal for a list and inside this | |
literal, you can write a loop that puts elements in this list, or you can write if or spread | |
three dots there and which will simply take another list and insert it in the middle of this list, | |
because again, people build these trees and lists of widgets often appear in these trees | |
and it became more convenient to write such code which. lists of widgets of various | |
types, but by that time it also became clear that we made this big change, we switched | |
from dynamic typing to static typing, there was a little thing that people complain about, | |
namely that we have cash quite a lot of people said why don't we do it right away non-stable | |
programming language in which people can't use cash just to please me about the little | |
thing bullshit everything is just on. we have little things little things in life in | |
practice people often underestimate the complexity of changes because they say that you | |
made such a big break in change why not add another break in change to this big break | |
in change but only people who actually work with the language and who need actually | |
planning how the migration will take place understand how difficult it is and a big | |
investment of money and time to migrate all the code for each break in change, so I | |
say. small because people think it's small actually it's a huge break in change and | |
we've been preparing for it quite seriously but we started to prepare almost after dart 2 was | |
done we started talking that most likely the next big change that we will make is most likely | |
the last big change which we will do this will do now save dart oh listen we wanted | |
to talk about this a little more later but let's just now can then tell a little more about your | |
stories and let's send our release plan to hell and will. just to follow this nice conversation | |
and it's very interesting to listen in more detail about your story of migration to the snel | |
safety language because I watched it from the side, I saw specific activities. what you did, | |
for example, it was a very cool story how you used pdf to motivate library authors | |
and switch to safity, that's why I really want to hear the story first hand, yes, when | |
gift 2 came out, we began to plan how to do it all and it became immediately clear a few | |
things the first thing is that by the time dart 2 came out, the ecosystem had grown | |
big enough to just say oh come on. throw it in the trash and start over again this solution | |
is not suitable if it was smaller then it could be done if no one used dart then everything | |
would be great as they say in programming languages the biggest problem is that someone | |
uses them does everything at once | |
it’s more difficult, and that’s when people began to think about how to make this migration | |
and realized that they needed the only approach that would most likely work to do it. | |
something in the language that would allow people to write two versions at the same time, | |
or more than two different versions of dart in the same application, and added to | |
the language such a thing called language versioning in each dart file, you can write | |
from above that this file actually uses the 2.9 version of dart and in another file to write this | |
file use version 2.12 and in. depending on which version of dart you include in a particular | |
file, you get such a version, that is, the compiler supports not one version, but | |
many versions, and the actual solution with migration is that you have all the files that you | |
do not want to migrate, you somehow allow using a comment and either at the package | |
level in papspec, which describes what dependencies you have, what versions you are | |
talking about, but on this package | |
uses the dart version. less than 2.12 and if the version is less than 2.12 then you can | |
write the old dart without nal safety and if the version is greater than 2.12 or equal to 2.12 | |
then it's on your safety you can't just say if you have | |
a variable that can contain cash, you can’t just take it and write a call to the fu method | |
on this variable, because the compiler will tell you and there may be naal you need to first | |
check for cash or mark that this variable is non-nullable, ask for it there. a sign | |
because by default all variables are non-null actually it was such a major change that we | |
made laid the platform for the migration of language eversioning and then we began to plan | |
how to actually pull the ecosystem along with us and as you already mentioned we | |
added let’s say our package manager on dad where u we all packages lie such a | |
thing that says, but you have the score of your package there 120 points out of 130 | |
possible. or there are 10 points out of the possible and give people points for the fact that | |
they, for example, migrated to nal safety, that they formatted the code, wrote tests, and so | |
on, and with the help of these points to motivate people to pull the eco system, as it | |
turned out, people really like to earn points despite the fact that this is some kind of | |
abstract something, and let's note that this is not from zero to 100, but in my opinion | |
now from zero to 130, because when people discussed this they thought. if you make it | |
from zero to 100, then people will always want 100, but it turned out that no matter how much | |
they did, people will always want the maximum and quickly enough, the external | |
ecosystem, it pulled up behind there in just a few years, well, maybe even less than | |
maybe in a year, actually all the popular ones pulled up packages generally migrated | |
in half a year to mine, and then the rest of the ecosystem pulled itself up | |
somewhere in a year and a half inside Google, we are still migrating because there is a lot | |
of code and it’s so easy for people. inside Google it’s impossible to say that, but we’re | |
turning off the version that doesn’t support, that is, we are removing support for the nonnel save code, everything is hello, it’s impossible because there is a lot of code that | |
should continue to be executed, so the migration is still going on, but I’m wondering | |
if you are collecting any data about the use of any features including fit in | |
general do you have any data let from idea let from surveys in general based on this data | |
what is the percentage of projects now. moved to safety there are some numbers there | |
are some numbers but I don’t remember such numbers I know that most people moved | |
the order okay okay it’s already 90 so let’s say as far as I’m talking about it while you were | |
telling me I remembered everything in csarp also when they entered the reference well well | |
safety referen types there, too, I went even while you were talking, I went to read to | |
remember there is not an approach not with files. but they also have some kind of this | |
story about the fact that they prepared a platform and for a gradual migration, so I just | |
got a little lost in the timeline which of these updates happened earlier, I wanted to ask | |
somehow. whether you were inspired by their experience or they were inspired by yours on | |
the contrary, but I got lost in the timeline, so sorry, we look at carp quite often | |
because they have a fairly large ecosystem, they did it well before we did it, but they | |
still haven’t migrated because their ecosystem is too big for that, at some point it just | |
reaches a critical mass and it is impossible to make such a massive change in the | |
language when you just say you need to migrate and pull ko with you. because | |
there is some percentage that will not stretch, and we have, since the ecosystem is large | |
enough, but not so large that this percentage that will not stretch, it will affect something, | |
but for sysarp, the ecosystem is noticeably larger, and if they do not stretch some | |
part of the ecosystem, then | |
it’s like death, so they still haven’t said to mine that we are turning off the previous | |
version, and that’s why they rolled back some other feature, I remember, I already | |
forgot everything, but you. I just remember there was also surprisingly the community didn’t | |
accept it, and it’s like an amazing case that they rolled right back and said it won’t | |
happen, but I don’t remember what exactly, well, hell, it’s not about sisarp, let’s talk about | |
the gift, was there anything in Darth III besides nil safety I remember that you also brought | |
patn records to the third dart and brought three features patn records and the modifiers | |
class I remember this terrible sign on Twitter went how many modifiers the classes now | |
have in dart. what combinations their wild ones are very many answer such a lot of | |
combinations let's start with records and pattern matching records and pattern matchin | |
they serve as such a carrot nalsy it's like a whip and patmatchinka records is a carrot | |
because well if you don't give people a carrot just say that we are you we take | |
something away and we take away from people the ability to run old code that is not | |
written in the nal safety language because we turn everything off. language versions up to | |
2.12, that is, if your d 2.11 code does not start on the third dart, and if 212 s then it starts, | |
of course, people don’t like it when they just take it away and don’t give anything in | |
return, so we decided to give people in return what they really asked for for quite a long | |
time and the fact that we understood that we should give them their own mat and records, | |
since in most of what is called modern programming languages. there are and people say | |
here in kotlin there is in java they even brought it soon or they will bring it soon but you still | |
don’t have it so we strained ourselves and included the patermat itself in the third version, | |
but we included the records because people also asked we want to write without | |
a class declaration just something Let's say we return two values from a function, but now | |
we have to let's return a list, and it's not clear in the list there can be two different types | |
then. return the object list somehow it's all not statically typed and we said ok give you | |
records what we call records in darrt is actually called tuple in other languages and in | |
case you use other languages it's clear what we're talking about here is the modifier | |
class delivered because for pattern matching you need to do what | |
called class hierarchy sild when we know how many specific number of subclasses a | |
certain one has. there are classes and you can’t add subclasses anymore, we call it the silt | |
system, the silt class is herrary, and when we added this one modifier, we decided why | |
not add other modifiers that people always asked too, let’s say people write some kind | |
of library that a lot of people use and they want for themselves for the future to facilitate | |
the development of this library, changes in this library, and for this they should prohibit | |
anyone. let's extend the class that is intended only for use as an interface, or vice | |
versa, prohibit the use of some class as an interface if you only need to inherit from it and | |
it was impossible to do it before, you can write in the comments please do not inherit from | |
this class, but this would not stop anyone and of course when you then change this class, | |
it breaks all the consumers that are inherited from you and from this improve the libraries | |
that are in the center of itself. ecosystems sit and everything is tied to them it was very | |
difficult, but with class modifiers it became easier because now you can hang them in | |
the right places and people cannot inherit if this class is not intended for | |
inheritance and what other modifiers are there actually added enough orthogonal | |
modifiers, but if you just look at them and don’t think about what they mean, it looks very | |
scary | |
a modifier that lets you say it's an interface or not an interface i.e. it can. this is an interface | |
added a modifier which can say that this class is intended to inherit base is called added | |
a modifier which | |
says this class cannot be inherited and cannot be implemented. it’s called final, | |
well, the seal itself was added and more and more nothing was added, just | |
modifiers were added in a very orthogonal configuration, as it were, so you can say | |
abstract interface class or you can just say abstract class or you can say interface class | |
that is, there are many different variations, but they are all something mean different things, | |
okay, but you complicated the interviews with a dart developer quite well, so you just need | |
to draw a multidimensional matrix and. and here and there the answers will be the canonical | |
question for the interview, you have to say that the party line prescribes not to use these | |
modifiers where they are not needed and in most cases they are not needed only if you | |
have 500 developers there or a library that is used by a million people then they are | |
needed but if you are doing some kind of quick application on your knee, then use these | |
modifiers to harm yourself, but I don’t know how it will work at the interview, but if I changed | |
clothes and went. to talk to a fluter developer, then I would try this answer daddy see | |
what would happen it seems to the story it’s more or less understandable I like it | |
I accidentally looked at the timeline and we had an hour of release but I think it was probably | |
we often start releases with a story but it was the most exciting history but we can now | |
move on and summarize and somehow describe the current state of the | |
philosophy of the language now and I have such a capacious question uh. thank you | |
just so you can tell us all about it, how would you describe dart to a person, well, the | |
current version of dart who has never heard anything about him at all and about fluter too, | |
and that's about everything, everything, everything there, well, it depends on what | |
programming languages a person knows, but in general, I would say to this person that if | |
he knows at least some mainstream programming languages, then he most likely knows | |
tart more or less because. from Dart and originally which was and which is still preserved, | |
it consists in the fact that we want to make a programming language that is easy to | |
enter and programs in which they are easy to read, that is, here you write some | |
kind of Dart code, unless of course you use single-letter variables there and so on, I'm sorry, | |
I immediately remembered the abstract final interface, well, here I pulled in the other | |
direction, because. the needs of large teams or the needs, again, of the libraries on | |
which everything depends, they are slightly different from the needs of most developers; | |
indeed, if you dip a person into such a codebase where some people who are especially | |
immersed in dart begin to use these modifiers, it will be difficult to understand what is | |
happening, but generally speaking, if you follow like the recommended style, and we | |
have such a style called effective dart in which it is written. how actually people should | |
write understandable readable code, it will even be quite easy to read even for a person | |
who is not familiar with dart and we heard quite often before the release of the third | |
version, let's see after the release of the third version how it will change that people hire | |
programmers who have nothing to do with dart and they quickly begin to write quite | |
sane code on Dart, and this has always been a kind of goal, but yes, as you yourself have | |
noticed, when you want to give people. some certain features sometimes you give them | |
something that violates this philosophy slightly I think this philosophy is not violated only in | |
lisp in which of all the features there are only brackets and hello and the cat always | |
looks the same like a sea of brackets in which you choke and don’t | |
you can pay from it, but okay, but let's imagine that a person has never heard of it, he heard | |
promenstream there, probably something else about platform support should be | |
added then to him, because he is still there. doesn’t know yes, if there is a platform, then | |
dart supports it, more precisely, we would like it to be so, but we, again, we have our roots | |
in the production of implementations of programming languages, therefore, don’t feed wine | |
with bread, don’t pour wine let us port dart to some platform which is not executable so we | |
try to gradually and constantly expand the number of platforms that dart supports. of course, | |
we must take into account the number of engineers in the team that someone | |
should support these platforms, but we want dart to be executed on any platform | |
where a person’s foot has entered, and at the moment, of course, dart is executed on the | |
browser through compilation to javascript or through compilation of web assembly dart is | |
executed on mobile platforms on android and iose through compilation to native code dart | |
can be run on servers dart can be run on desktop. actually flatter uses this because flatter | |
covers all these platforms web desktop mobile platforms where else you can run dart | |
and it kind of covers it. already quite a large number of platforms that people use, | |
there were even experiments to run dart again on internet of things devices, but those | |
experiments died were very interesting, they were before the second version of dart, but | |
very small such devices where the memory is nothing and you need to shove | |
a virtual machine 200 kb but we were able to shove dart there too, okay, I will now | |
intercept Katya the leading role and try to continue her question. so you told about the | |
platforms that dart now supports, but it’s one thing to support it and another thing to be | |
used here in which niches dart is actively used now, let’s say a little about flutter here, but | |
it’s especially interesting that in addition to flutter there is basically yes, I won’t | |
hide it through flutter there are people developing an application on it for mobile | |
platforms and for the desktop now too. people on the web also use it popularly | |
sometimes if they have some kind of application to quickly launch it on the | |
web as well. This interest in dart that flatter actually spawned, it also starts to pull it to other | |
platforms, that is, we have, for example, always had the opportunity to run dart on our | |
server there are some server libraries out there http server and so on they have never | |
been particularly popular but this popularity is growing gradually because people are | |
allowed. they want to write a fullst application on Dart when you have a client on a dort | |
and some part of the server is also written on dart and if you look at the conferences that | |
the community flatter organizes, you can see that there are more and more reports that | |
actually describe fullstack dart when everything is written entirely dart application Inside | |
Google, dart is mainly used again on mobile platforms and on the web through angular. dart | |
is a version of angular that is written in dart, it has common roots with angular, but it | |
differs quite a lot in how it looks like with the current version of angular, which is | |
written in timescript, there is a certain use of dart on servers, but that's all | |
hidden and invisible niche, we call it niche, but there are some direct server frameworks on | |
Dart, or it’s all self-written that they are starting to use. that is, there was always one | |
very popular good framework called aqueduct, but it died because the people who | |
supported it, they gave up, they moved somewhere else from Dart, but since, | |
again, the community is growing, thanks to the flater, people appeared who intercepted this | |
baton and now there are several competing frameworks there is let's say the framework | |
is called server under there is a fork of this aquiduk. which, well, they begin to gain some | |
popularity again, but very simple applications can be written without any frameworks at all, | |
so we have a built-in http server where you can write something simple if you don’t need | |
something complicated, and by the way, you can tell a little more about the story with | |
angular darth dargulyar Angular Dart Angular Dart Yes, here again, as far as I | |
remember the history of what happened. open source solution available to everyone | |
the same Raik used it in my opinion but at some point you decided to stop public | |
development but continue to use inside what happened like so the story is very | |
shrouded in a veil of secrecy but I can open it a little as it always happened that there are | |
not enough resources to do everything what we want initially, we somehow long ago, | |
when I say initially, it means a long time ago we had some kind of partnership with. the | |
team that developed samgular and we tried to somehow make it so that angular typscript | |
and angular dart were obtained from the same codebase, but it all died because it became | |
clear that it was impossible to write in such a way that we got frameworks for two completely | |
different programming languages, then the whole thing forked and the team one | |
began to develop angular typescript, in fact, this is the team that was originally | |
engaged in angular a. and we got a team that develops angulart and this team she | |
developed it she laid out versions from the internal repository in github which actually | |
used the same vrayk but at some point it became clear that supporting the ecosystem | |
around this open source version needed resources for this support and these resources | |
no and it would be better to focus on internal problems and at that moment we | |
honestly said. that there are no resources, we will stop constantly synchronizing the version | |
from the internal repository to the public github repository and the community if | |
they want they can. someone actually did it there is a fork of this public angular cake | |
I don’t remember the name which people are trying to support but inside it continues | |
to develop and be used and there are some maybe you know large cases besides Google | |
using dirt on the frontend right now that are still alive but I have suddenly flew out of my | |
head the name which means what is. one that I know is a large use case, there is one large | |
one comparable to a district in size, that is, many many many thousands of lines of code, | |
but in my opinion, in detail, that is, the main use, of course, it goes through the flatter | |
web, that is, people who take some kind of application of their own, which was | |
originally mobile and make a web application out of it quickly with the help of flatter, by | |
the way, especially on the last google aio, it was noticeable that it was very | |
large. dart and flatter are betting on the web assembly, now we are trying, that is, the web | |
assembly is a very interesting platform, at least in the browser it has certain | |
advantages compared to | |
javascript as a target for compilation from statically modernized languages like dart or java, | |
and with the advent of native built-in support for the garbage collector, we were interested to | |
see if we could realize these advantages. see them in numbers, that is, if we compile | |
a flatter web application into a web assembly, will it run faster, will it run faster and we | |
are at the moment, that is, if we go to take the latest version of the flatter, then using public | |
flags in comanline, you can compile the web assembly and run it in a browser to see that | |
something is getting better, something is getting worse | |
there is more work. what we actually do is required, then I suggest moving on to the key | |
features of the language, we have already touched on safeity, yes, when we talked about | |
the story about the pattern, the boy talked a little, but I suggest going back to the beginning | |
and let's talk a little about compilation all the same, in general, what is compiled into and how | |
ok compiles like i said in a lot of different things compiles to javascript web assembly for | |
execution in bra. and also compiles to native code we support all the most common | |
platforms, which means we support arm six-four-bit arm intel again thirty-two-bit six-bit | |
risk 5 we also support on platforms such as ios android linux mac windows that is, we | |
support the most commonly used platforms we can execute if . we are talking | |
about the native execution of Dart, we can execute it in the it compilation mode when | |
you just take the sorts, put them in a virtual machine and it starts threshing and | |
executing this dart live there, when the dart is executed in this way, you can, let’s say, at | |
least reload what the fluter itself is and uses, that is, you can say my code has actually | |
changed please update the view of this code inside the live VM. state loss, that is, | |
if you have some kind of ui rendered there and you want to change, let’s say one function | |
that changes how the button does what the button does, then you can simply edit this | |
function and say in the virtual machine, please re-read the code and it will re-read | |
this code without losing the state without, as it were loss Yuya just change the behavior of | |
this one button this mode it is only supported in jit mode. when you are ready to | |
release your application, deploy it somewhere, you take a native aut compiler that compiles | |
the application completely into machine code into an executable binary, in fact, and make | |
this executable binary and you can deploy it, this is actually the main types of | |
Dart execution that we support, but there is in general, there may still be some features | |
of this virtual machine, well, in addition to the fact that it can work in compilation | |
mode. if you look at them from a certain angle, they all look alike, so it’s hard for me to | |
name any special features, but I would say that hot reload is one of the features, that is, the | |
same jvm, it supports certain things that allow you to do something similar to hot reload | |
through the gvmti interface, but when to see how instant run works on androidi, | |
through which people have to jump barriers and how hot reload works in dort. it turns out | |
that everything is somehow easier for us, well, mainly because we control the entire stack | |
from beginning to end, that is, we have our own compiler and our own virtual machine and | |
our own parser for Dart and all these. components they work in unison to provide people | |
with a sane quick edit refresh cycle ok The next topic we always talk about when we try | |
to list the features of a language some features it's naturally a type system Here again I'll be | |
equally trite questions to ask if there are any features in it compare with mainstream | |
languages so it will be as easy as possible for listeners to compare in their heads. I | |
would say that the main feature that really distinguishes dart from many. mainstream | |
languages is that we have generic types reified, that is, if you make a list of dogs, then you | |
send it somewhere, it goes there through the whole program and then it comes to you in | |
a variable of type object and you ask that variable of type object and who is he here it tells | |
you that I am a list of dogs, but in the same Java, if you make a list of dogs and send its | |
type parameter that Generic is given that it was a list of dogs. He | |
the only important difference from other mainstream programming languages is because | |
everything else. more or less the same, that is, there are classes, they are everywhere, there are | |
classes, classes can be inherited, yes, super, you can implement interfaces, there are | |
methods, and so on and so forth, that is, it’s all the same more or less in most mainstream | |
languages, well, yes, we return to philosophy, you said that a language that, in general, if | |
you know moinstream and you already know this, therefore it is logical that by the way is there | |
support for algebraic data types Yegor you were told just to read will just read. and they also said | |
that there a person from Haskell is responsible for language design wait wait ambiguous everything | |
everything is really ambiguous again if the people who developed the first version were | |
told about algebraic data types they would | |
language, it somehow came to people now and there is no very beautiful syntax for them | |
created. but with the advent of patterning, of course, you need to have something like | |
algebraic data types because you want to pattern and these hierarchies actually allow you to model | |
what adt allows you to model in languages with more native support, you want to wrap it up with a | |
little syntactic sugar to make everything really good and so that you can simply write there, let’s | |
say her left or right, as you can write in the same Haskell. it will be necessary to write there class | |
either and then class left extends either class right extends either and hang a forcemodifier | |
somewhere, you will get such a closed class system representing an algebraic data | |
type, yeah, cool, and another big topic tell me that Dart has asynchrony Dart has | |
asynchrony, everything is about as in javascript because, of course, it must be compiled in javascript, | |
and therefore itself. the first days I had to limit myself if I didn’t have to limit myself with javascript, | |
then maybe we would do everything very cool with vibers and so on, but now we do everything with | |
futures like in javascript there is a promise and we have a future we have incawate syntax that | |
allows you to write more or less such a structural linear code that works with these futures and | |
there is a one-thread one-thread execution model. which turns the eventlop and it all seems to work | |
in one thread, that is, it doesn’t differ much from a javascript, we improved something, let’s say | |
in the javascript on the web there is such a concept of webworkers when you can make the main | |
page, as it were, or you can run a webworker that can read something in the background there in | |
Dart there is the concept of isolates that can also be launched so that they in the background | |
consider something there, of course, they are not. they share no memory with the main | |
thread, or with the main isolate, that is, they are absolutely isolated as their name says and does not | |
hide anything directly, but the difference from webworkers is that we made them very lightweight, | |
that is, they have a very small overhead, they can be launched very quickly and they have | |
something to consider selectors on the web, they run for a very long time in this more like a | |
model similar to the same airland in which there are lightweight processes. our system is not as | |
lightweight as in Ireland, but much less heavy than in the same vasscript. By the way, here is an | |
interesting question, you say that the roots of how | |
it is lost, it exists only at the compilation stage and not at the execution stage, so when this list comes | |
back to you, you ask him who are you and he tells you, but I’m just a list and who I had there I | |
don’t know maybe dogs or maybe cats or maybe bhemoths, but in Dark this does not happen | |
typical variables in Generics they are reified and exist during execution I think that | |
they said it is too difficult, but understanding that it is not difficult and it is important to have in | |
implemented. synchronicity in Dart sticks out to the need to compile to javascript, but | |
if you look at how dart is used now, it seems that compilation to javascript is such | |
a percentage of cases have you thought about possibly abandoning compilation to | |
js, but at the same time, for example, to open your way to a more complete one there | |
multithreading on platforms where it can be done there native gvm we thought about it i.e. | |
er. in general, we have a process of this thinking about our multithreading about our | |
asynchrony about how we execute e-code, it started a long time ago because well, | |
when it became clear that we are not only used on the web, not so much used on the web, | |
it became interesting to think about how to improve the native implementation we we are | |
quite actively thinking about shared memory multithreading itself, is it possible to just take | |
and add this box completely open this door. from which all these problems with data | |
flights and so on will break out later, but this is a very difficult decision, firstly, because we | |
cannot refuse to compile to javascript, as I already said, we have millions of lines of | |
code inside and outside people get certain how to tell people this is useful the possibility | |
sometimes that you can just take the fluter application to compile and it will run on the web | |
portability is a very important property to which we devote quite a lot of time. | |
because it also positions dart as if separate from many other languages that have, as it | |
were, subdialects that can be executed on certain platforms, and Dart, as it were, has a | |
kernel that is all portable between all the platforms that it supports, so the solution | |
is very complex, but we are actively thinking about it that is, maybe at some point we will | |
open this door to a completely crazy world of multi-threaded programming, okay. it’s | |
also interesting to listen to your point of view on what, in your opinion, are the | |
weakest sides and you can look at both sides of such weaknesses like piedesign with which | |
you can’t do anything anymore due to the fact that some choices were made and | |
weaknesses that are like this list pains that you want to fix in the future ok there are two | |
categories of problems Darth has the first category it has to do with compiling to javascript. | |
since we, as we have just said, limit ourselves in adding non-portable features to the | |
language, that is, if we didn’t have compilation in javascript, we would most likely have | |
added some fibers there, lightweight streams, maybe even completely shead | |
memory malting would have been added because people ask about it and we would like | |
to add it too but but compilation to javascript limits us and it's one of the weaknesses | |
i.e. everything that javascript can't express or everything that javascript is. does not support | |
well, we need to somehow think whether we can add it or somehow we add it from | |
the side, and so on. Another problem lies in the historical decisions that were made | |
back in the days of dart 0 about how the syntax of the language looks like, that is, our | |
syntax is based on the language c, more or less well, or in Java, when the types of | |
variables go before the nominal variable of the function, they are declared without a special | |
keyword, as in some programming languages. there you need to write fun or something | |
else and this imposes certain restrictions on what syntactic features we can add to the | |
language, that is, in the same boiler or swift there is such a feature trailing closure | |
sometimes it is called when you can write a closure after the function that looks like it just a | |
block of code with curly braces and this allows you to make very beautiful dsl or in dart this | |
feature is very difficult to add because it arises. grammar problems that neither Swift | |
nor Kotlin have because they chose a different function declaration syntax | |
syntax for declaring variable types and such problems Dart has that it is very difficult | |
to make it a language for writing Dislls just because of these decisions that were | |
made 12 years ago about what to do c-like syntax turns out c-like syntax is not a | |
good idea if you want to do it dsl and then. ok something else comes to mind from | |
weaknesses i would say these are the two biggest problems people want to do decels this | |
is known to everyone people don't want to write code people want to write one word and | |
that it means a whole book and they are used to the fact that you can create some sort | |
of libraries that have a very unreadable sometimes api, but if it gets dirty, it looks like a | |
native that you can write. sql which is directly immersed in the syntax of your programming | |
language, you don’t need to write any lines there, inside the line sits sql syntax, and | |
you directly write all sorts of selects there at the level of the language itself and. thanks | |
to the rich features of this language, and it magically works in Dart, it's not so simple and | |
of course it imposes a restriction on which category | |
we can offer this language to programmers because there is a category of | |
programmers who, as soon as they see that this is impossible, they and I will go write | |
on the rock further in the rock, everything can be written in such a way that no one | |
but me will understand and get hurt okay let's talk a little. about the ecosystem in different | |
languages, the line between what is written in the core libraries of the language | |
development team and what is given to the community, this line is in different places where | |
it strikes that in your standard libraries we actually have two concepts here, or even more | |
than two but we have the concept of the actual core libraries, these are the libraries that | |
you get if you install it. dart is dk and just run a bare virtual machine, it already has | |
some built-in libraries, they can work with hatchtable lists, they can make http requests | |
or run an htp server with files, and so on, that is, some basic things are actually | |
core libraries, then there are around this package cloud which we support, that is, in the | |
pub we publish packages there for, let's say, beat the system. a package or there is a | |
package for platform independent work with http requests, that is, not just a native http | |
request, but also on the web, let's say an http request, or there is an http request through | |
objectivec api ns url session, I don't remember what it's called, but that is, there is such | |
a package that provides platform-independent access to all these platform-dependent | |
ways to make http requests and we support such packages. in a team or there is | |
a package for working with a deserialization sterilization protob or a deserialization | |
serialization json and then around this all there is already a user ecosystem that we | |
ourselves do not directly support and people do how to decide which package we support | |
and which someone else should support this is very difficult for us in our own time we | |
wrote a lot of packages and they were supported with a creak, and then somewhere | |
3-4 years ago we decided that we would die. and we will be crushed by the weight of | |
these packages, so we just said a lot of packages, we will not support we will support | |
only those packages that are really or completely the core, that is, an ordinary person | |
cannot write or will write so that it will be bad, and we give everything else to people, | |
that is, I don’t know any formats serializations that two people in the world want to use or | |
there is a calendar widget that is purely specific. we don’t support such things | |
directly, but you can then, well, okay, about exotic cases it’s clear yes, I wanted to | |
joke about xml about the exotic format that two people need, well, as in copylization xml, | |
parsing is also not supported, the same story, but maybe then | |
all sorts of things I honestly don’t use any of these packages myself, so it’s hard for | |
me to immediately say which package everyone should include protobuff inside Google if | |
you do something, you must always include protobuff because everything goes through | |
protobuffs you already mentioned that there are packages that encapsulate | |
inside . work with platform-specific logic there is a network client that pulls a session | |
under the hood and so on, but how do we give the first two questions. with themes, you | |
generally have such an interop, and the second, how it is implemented, there are two | |
schools of the interop, there is the Water school of the interop, which consists in the fact | |
that you make a Dart interface that sends a message to the native side, this is called a | |
method channel, that is, your native side, as it were, listens to this messages | |
processes them sends back responses to dart and here is such an asynchronous | |
primitive types of parameters are such or there the structure is passed here or there | |
is a pointer to native memory and you directly call it this is a very direct very low-level way | |
of communication it works with all sorts of low-level libraries based on this method we also | |
built two packages that allow you to communicate with swift. c, that is, you can give, | |
let's say, some kind of header file that declares the objectivec interface and code will be | |
generated from it that allows you to communicate with this interface, call methods there | |
and so on, even pass blocks there, that is, if you have a function on the Dart | |
side, you will | |
to understand also the scale and liveliness of the community, it can be listed there a couple | |
of three of the most significant projects, just there, rather, it’s not about exoticism, but | |
now the question is about some kind of mass character and some projects like that. which | |
have become, well, they already go to the set of a gentleman's developer, no matter what | |
platform, well, let's say if we look at the flatter, again, when we talk about dart, we say | |
dart, we mean flatter, we say flatter, we mean dart, but we stayed until the end of | |
the release practically so that yes there, let's say There are several popular solutions | |
for how to manage state within an application. There are several very common packages. | |
one is called a provider there one is called riverpot one is called block these names | |
mean nothing to anyone if you are not immersed in the flutter ecosystem but these are | |
packages on which almost any application on flutter depends there are packages as I | |
said let's say a package for platform independent work with http we have our own and there | |
is a Chinese community that has developed another variant called dio which wraps around | |
our package. all sorts of annotations are there, and the built-in parsing of various | |
jesson formats is there and so on, some kind of declarative api, and a lot of things also | |
depend on it, that is, there is | |
communication channel is the advantage of this approach. is that the Dart side does | |
not know at all with whom it is talking to the same channel method can be implemented | |
in c ++ it can be in Java it can be written in objectivec or in javascript even and the | |
Dart part is completely portable understandable the thing is that not all api can be | |
integrated in this way there are problems with the fact that this is an asynchronous | |
communication channel there are problems with the fact that there is some kind of | |
serialization deserialization of these messages is almost like you are talking. with some | |
kind of server that is not clear where it is located, that is, there are some costs, the | |
communication speed is of course not very high, because there are these costs Dart's | |
approach to interoperability, therefore, much more low-level, we have such a thing called | |
ffi which allows you to call everything that has a sish abi then there is if you have some | |
kind of native function that has, as it were. abi you can find her and you can call her | |
you say she has such a signature she has there | |
you pass to objectivec an interface that expects a block automatically, all this | |
happens when you call this block, then the function will be called on the side of the otort | |
and what are the restrictions. this approach is immediately just ask like again it will | |
somehow not be fast enough or some other restrictions there I can’t think of why | |
but it’s very low-level again it’s fast enough it’s not slow because everything is kind of raw | |
hardcore low-level main limitation is the fact that the cake and the same swift or objective c | |
c ++ or oc have different approaches to multithreading. he thinks everything in terms of | |
isolates, one thread of execution, and the native side has built-in multithreading, so if | |
you are in a situation where the native code wants to call dart from some threads that | |
Dar does not know anything about, then you need to send messages, you need to switch to | |
synchronous communication, and for this, again, we have a coherent mechanism when | |
we can say that we are listening instead of receiving a response from the native | |
side synchronously, we magically convert. these calls to send messages is the main | |
problem, the main one, as it were, is a weak side, but nothing can be done about it, | |
because well, different approaches to multithreading, and again returning to rewinding | |
it back, we also have a package that is based on the low-level interface for function through | |
gni allows us to communicate with Java, that is, if we have an android application, we | |
want to call a method of some synchronous class. or there to do something else on the | |
java side, you can say to this package we want to call this class, it will generate a dart | |
code that, through a low-level interface via gni, will call methods on the java side. dart | |
into native code and then from native code through gi to get into djav many of these jumps | |
across the boundaries of virtual machines, they of course accumulate | |
overhead. | |
therefore, if you make a lot of such calls, you can see that they are not very fast always, | |
but this generated, let’s say swift objective code, how idiomatic it is from the point of view of | |
these languages, are you trying to make it so more idiomatic for consumers, we are | |
trying to make Dart code because our consumers are dart programmers, of course, | |
what they want is to get a dart interface that is understandable in a well-understood | |
way. it looks like on them, and this code on objectivec swift that we generate, it is usually | |
just like a deep code and no one should really read it, so we generate a rather raw code | |
that uh-huh. what ideas are most often used to work with dart, again, you can talk about | |
flutter and about other cases, they mainly use vs code and intellij or android studio use of | |
course if android applications are developed, but vs code and intellij are different options, | |
this is the most basic thing we have lsp server which is the language server protocol if you | |
have one. my favorite editor is vi or max or I don’t even know what helicix what hipster | |
words can be mentioned here if he can speak lsp he can provide completion formatting and | |
so on out of the box and actually there are people who write vi and everything works for | |
them thanks to this a as far as we have already talked about it a little, but all the same, | |
how alive and actively developing the ecosystem from the community, that is. again, | |
there are two states, it happens that everything has already been written as a whole, all | |
the main packages are, it somehow lives, little new appears, but it is full or it continues | |
to grow sharply, a lot of new appears constantly, that’s what we have, I think we are still in | |
the development stage because that again, five years ago, we almost died, I don’t know, it’s | |
not five, of course, seven, maybe time flies very quickly, I already forgot | |
when the flater came out and now we are still growing. that is, as I said, if you look at what | |
people represent at community conferences, and I think this is a fairly good indicator of | |
what is happening in the community, that people organize conferences and that they | |
represent at these conferences, you can see that there are interests and libraries for | |
work appear to wlstack Dart on the server for a library for working with databases | |
on the server there are people who are interested in writing games on dart, for example, | |
they also build some libraries for this dart vm. not only to flutter or to the server, but | |
they take it there, let’s say they have some kind of game engine, and they put dvm there, it’s | |
enough, as it were, we have an actively developing community, okay, in conclusion, | |
then I would like to talk a little about the future of dart, it’s not dart, about flutter, we will | |
definitely do it someday a separate release let's go back to dart again maybe not do yes | |
let's wait again you pro qut first promised to release from me we decided to go through all | |
the ee framework for desktop. first of all, developments are cross-platform and focus a | |
little on the desktop yes, so we have a wonderful release ahead, let's talk | |
a little about the future, please tell us what major changes are on the horizon, and | |
I also have such a terrible habit of asking two questions at once, but I explain this by | |
the fact that I I give guests the opportunity to choose from which side it is better to answer | |
and I will remember that at the very beginning of the issue I still had a question about how | |
exactly these | |
solutions. retrospectively, we have already looked at why the tepization appeared, why | |
toto, but the team is changing, times are changing, therefore, to sum up two questions, | |
what is the future and how exactly did we come to these decisions, to implement such | |
features there or not to implement them, and the like, okay, I have a pen here, when | |
they ask several questions at once, I write it down on my hand so that the guest won’t cheer at last | |
refuses, but only we enter into synergy super, in fact, this one is how to say baptism. our | |
team structure went through fire at the time of the transition from dart 1 to dart 2, I would say | |
that at the time of dart 1 we had a rather authoritarian model of language evolution | |
when the main uncle said how to do it and everyone immediately rushed to execute | |
orders, but of course then the language walked only in the direction that a particular | |
person saw if a person has some kind of blinders in front of his eyes, then maybe he walked | |
forward and then fell himself. break because I didn’t notice that there was a break there | |
and during the transition to dart 2 we switched to such a more debatable approach to | |
the evolution of the language when we formed a team that deals with the actual design | |
of language features that understands quite a lot in the languages \u200b\u200bof which | |
everyone has experience this is a different experience that is, let's say this team has a | |
fairly strong background in Haskell, as I already mentioned, but there are people who are | |
there. worked on some more mainstream languages they have experience there is let's say | |
a person who was involved in the evolution of javascript in the old days, that is, he | |
understands how this process works there is a person who was once a professor at a local | |
university he just studied the theoretical foundations of programming, that is, he has | |
a very understanding how to write specifications, how all these features at the level of a | |
formal description interact with each other and there are some people in this team | |
who are more general. which they may not have such an academic background but they | |
feel in their gut how and what people want and they let's go look at the existing code | |
we have let's say. tools are written that download from our repository from pubdef all | |
packages parse all the Dart code that is there and analyze which | |
patterns appear there and people look like they are doing de-mining on the information | |
that this tool produces and can give feedback about specific features, and now such a | |
team has formed, they all work quite well with each other, respect each other and they | |
sit and many times. they talk to each other their job is to sit and talk about it purely about | |
me and Egor yes they also need to maybe organize a podcast organize the whole thing | |
about this whole thing record all their discussions and they actually decide how | |
and where the language goes this team can be asked and we can give her some | |
kind of feedback, we have a public repository on github called language, ordinary users | |
can go there and write. and I want such a feature and in return they can get a detailed | |
answer why this feature is impossible or they can get an answer that this is an | |
interesting feature but now we don’t have resources for this, but in the future we will | |
return in the same repository there is a project called github in my opinion when you can | |
see such a kind of conban or I don’t know how to call it what features are now being | |
actively discussed which features are, as it were, frozen which features are in the process | |
of writing a formal one. the specifications of what features are ready for implementation | |
there everything is quite transparent and that’s actually what concerns the | |
programming language itself and the platform we have, as it were, separate teams | |
that deal with different parts of the platform, they also have some kind of cartblank inside | |
the commands to decide where to move, of course we have some kind of hierarchy | |
where all this information is collected up the hierarchy, then the gray board sits down and. | |
discusses whether the comrades are going the right way or the wrong way, some | |
decisions are made and then execution is all about data mining cool story in Kotlin we | |
are also doing this I was wondering if this is a standard approach in all programming | |
languages or not now in the team who deals with them but for this you need to write down | |
the latest issues to go through programming languages, call the participants | |
from there and ask them all, and the second moment you will now laugh, but I again. I’m | |
making a reference about csarp I just really remember this issue myself on carp I | |
wrote at the university a little more than on Dart there were a lot of lavas but the experience | |
is about the same but I remember the issue very much shorter | |
we just joked about a podcast and that people meet and talk and make a decision they | |
need to make a podcast so that’s all the ball if I don’t confuse anything there they stream or | |
design rallies, well, there are just some meetings where they sort out props and all | |
that, they stream it right, well, there’s some kind of conditional on twitch something like | |
that therefore. i just when i, well, when i heard this, i think wow cool, so maybe you can | |
also adopt such a practice for yourself, but that was the second question and the | |
first one i forgot now because despite the fact that i am for the future of the flatter yes | |
i say stupid habit i'm from someday I will get rid of it but not in this issue wait for the | |
future of the fluter there you already asked the future of dart in my opinion I said forgive | |
me I stepped into this future of dart dart dart everything we have now if you look at | |
what we are basically. we are doing what we are mainly talking about from | |
language features most likely the biggest feature will be metrogramming we are | |
looking at adding something similar to macros to the language or actually macros when | |
people can write code in Dort that will generate code in Dort which is then built into the | |
program transparently, at the moment we have support for code generation when | |
people run some tool on the side, it generates dart files and then actually these. | |
they are used in the main application this has ergonomic problems because this tool for | |
generating Dart is not built into the main one like it used to be | |
the developer needs to be launched somewhere from the side with a hint, and I would like | |
that just in normal crushing there would be support for generating a Dart code that | |
would be immediately embedded in the application and executed, this would close our | |
problems with serialization, for example, because people want to work very easily. with | |
different data formats but they don’t want to write serialization deserialization they want | |
them to hang an annotation somewhere and boom serialization deserialization happened | |
we have tools for this if deserialization happens but for this you need to run code generation | |
on the side and I would like to not have to run anything but just everything would | |
magically appear and macros solve this problem, but macros have a lot of questions, | |
for example, will everything become very slow because there are people. they will write an | |
infinite loop there and your id will just hang there or this code was generated there and | |
where to put it so that people can debug it so that people can. they clicked on some kind of | |
cross reference in the idi so they land in this generated code and understand | |
where it came from and what it does try to solve these problems in different ways if it | |
works out maybe in a year we can record a podcast from metaprogramming in dart if it | |
doesn't work out well oh well we are you hitting the sick, our dream is already, I don’t | |
know, for 3 years to record an issue about metrogramming in general and compare | |
different approaches. To | |
macros in different languages to talk about annotations compiler plugins in short all ways | |
of metaprogramming to analyze with examples from different languages we can’t find a | |
polyglot guest we need such a metapolyglot yes any guest wants to talk about how it | |
works in a particular language we like conditionally with Tonsky wanted to sign up but he | |
this one is ready for laying down, well, I want to talk about everything, but in general it’s | |
interesting macros I don’t know macros new black swift rolled out a new version with | |
macros. and now, in general, the entire ios community only talks about vision pro and | |
about macros, it’s not clear which is cooler, only macros on vision pro, most | |
likely. By the way, from the possible limitations and difficulties, macros seem to greatly | |
complicate this support, especially the fact that you provide ellsp how to work with | |
macros there is incomprehensible Yes and we think that we have found the right approach, because we allothere are systems in which, as you have already mentioned, some compiler plugins are | |
used. which mutate the internal representation that compilers use for users it is | |
difficult to debug difficult from just from edi to observe how it all works we want to try an | |
approach where dart code is simply generated somewhere on disk in the file | |
system and this code is integrated with the rest of the start-up code through we | |
have such a notion called augmentation libraries when you can make a dart file that sort | |
of mixes with the . to other dart files, that is, he says, let's say there is a class like this | |
here there is a class like this freeze them here there is a method like this here there is | |
a method like this one overrides the other and so on and through this one, the generation | |
of dart files directly on the disk magically turns out right away and edi works it's ok | |
and the debugger works fine but we'll see if we can do it or not it's an open question | |
it will be very interesting to follow you sounds like a cool feature because well the story is | |
about. the fact that you need to manually pull in code generation there, even me, who | |
doesn’t write in Dart, I still have somewhere in the back of my mind, people are | |
talking about it, it’s cool, so it seems we have gone through all the issues that we had in the | |
plan and it’s time to draw the line of release today we were able to discuss darts almost | |
without talking about flutter and I think that's it. very cool because this is the release I at | |
least wanted to get | |
and bye bye everyone | |
We talked about the history of development and it reads like I don’t know how such a good good good | |
book, but we talked about where and why the Gift is now used about its key features about what | |
it can compile into | |
about the virtual machine type system generics asynchrony talked about the weaknesses of Dart | |
about the ecosystem and. about the future and the macro thank you very much for coming to us and in | |
the release it is always more interesting to talk about the language with those who develop it, and | |
considering that you are there from the very beginning of the story, it seems to me that this gave the | |
release a special buzz thank you thank you for the invitation was it’s very nice to talk with you, | |
and in the meantime, Egor and Katya unexpectedly called me a question for you, drove you today to | |
wear such a T-shirt, I paid attention. and for listeners who are still listening to us and not looking at | |
YouTube, this is an invitation, yes, this is an invitation to watch our video version, I won’t describe | |
you here, come take a look, but I have a question for you Egor such that you like more than finally to | |
take a break from the constant discussion of the cauldron that you just have happens 24x7 and finally | |
talk about other great programming languages, for example, now Flutor should have said yes, for | |
example. more episodes about programming languages I don’t like absolutely anything in life | |
because it seems this podcast was created only to talk about programming languages and wait for | |
sure the release of prozic is shorter my new dream is to find a guest to talk about zik but in fact I like it | |
more only when you listen to our podcast like it tweet retweet tell your friends subscribe to our youtube to | |
justify what we film ourselves on. it’s not just that’s why you should definitely look at us there and what | |
else come to the chat with us and write, throw in your questions and we’ll coolly discuss them here | |
in the issue. Well, and most importantly, as I already said, most of all I like it when you listen to our | |
podcast. That's all thanks to everyone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment